Add a java version of the dev app. (#218)

This commit is contained in:
Thad House
2017-08-13 08:02:29 -07:00
committed by Peter Johnson
parent ea028a3822
commit d9c754c30f
2 changed files with 27 additions and 1 deletions

View File

@@ -44,6 +44,10 @@ if (project.hasProperty('onlyAthena')) {
test.enabled = false
}
sourceSets {
dev
}
task nativeTestFilesJar(type: Jar) {
destinationDir = project.buildDir
classifier = "nativeTestFiles"
@@ -62,13 +66,23 @@ task nativeTestFilesJar(type: Jar) {
}
}
task run(type: JavaExec) {
classpath = sourceSets.dev.runtimeClasspath
main = 'edu.wpi.first.ntcore.DevMain'
}
test.dependsOn nativeTestFilesJar
run.dependsOn nativeTestFilesJar
dependencies {
compile 'edu.wpi.first.wpiutil:wpiutil-java:+'
runtime 'edu.wpi.first.wpiutil:wpiutil-java:+'
testCompile 'junit:junit:4.12'
testRuntime files(project(':').nativeTestFilesJar.archivePath)
devCompile 'edu.wpi.first.wpiutil:wpiutil-java:+'
devCompile sourceSets.main.output
devRuntime files(project(':').nativeTestFilesJar.archivePath)
}

View File

@@ -0,0 +1,12 @@
package edu.wpi.first.ntcore;
import edu.wpi.first.wpilibj.networktables.NetworkTablesJNI;
import edu.wpi.first.wpiutil.RuntimeDetector;
public class DevMain {
public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println(RuntimeDetector.getPlatformPath());
NetworkTablesJNI.flush();
}
}