-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from flamingchickens1540/2019-updates
2019 updates
- Loading branch information
Showing
94 changed files
with
544 additions
and
496 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,152 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.3.0' | ||
import edu.wpi.first.gradlerio.GradleRIOPlugin | ||
|
||
repositories { | ||
mavenCentral() | ||
plugins { | ||
id "java" | ||
id "maven" | ||
id "edu.wpi.first.GradleRIO" version "2019.1.1" | ||
id "org.jetbrains.kotlin.jvm" version "1.3.0" | ||
} | ||
|
||
|
||
// Maven/Jitpack configuration | ||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
|
||
javadoc { | ||
options { | ||
header '<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>' | ||
links 'http://first.wpi.edu/FRC/roborio/release/docs/java/' | ||
linksOffline('https://docs.oracle.com/javase/8/docs/api/', 'https://docs.oracle.com/javase/8/docs/api/') | ||
} | ||
options.addStringOption("doctitle", "ROOSTER API") | ||
options.addStringOption("windowtitle", "ROOSTER API") | ||
options.addBooleanOption("-allow-script-in-comments", true) | ||
options.addBooleanOption('Xdoclint:all,-missing', true) | ||
} | ||
|
||
// Dependencies | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name "JitPack" | ||
url "https://jitpack.io/" | ||
} | ||
} | ||
|
||
dependencies { | ||
// FRC dependencies | ||
compile wpi.deps.wpilib() | ||
compile wpi.deps.vendor.java() | ||
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) | ||
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) | ||
|
||
// Non-FRC dependencies | ||
compile 'org.jetbrains:annotations:16.0.3' | ||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.0" | ||
|
||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
compile "com.google.guava:guava:27.0-jre" | ||
compile "org.apache.commons:commons-math3:3.6.1" | ||
// Last release was in 2014, so we're just pinning it to this commit instead | ||
compile "com.github.oxo42:stateless4j:3dd512049f" | ||
} | ||
|
||
// deployment and GradleRIO | ||
|
||
// define the testbots source set | ||
sourceSets { | ||
testbots { | ||
compileClasspath += sourceSets.main.output | ||
runtimeClasspath += sourceSets.main.output | ||
} | ||
} | ||
|
||
task wrapper(type: Wrapper) { | ||
gradleVersion = '4.4' | ||
distributionUrl = "https://services.gradle.org/distributions/gradle-4.4-all.zip" | ||
configurations { | ||
testbotsCompile.extendsFrom compile | ||
testbotsRuntimeOnly.extendsFrom runtimeOnly | ||
} | ||
|
||
subprojects { | ||
apply plugin: "java" | ||
apply plugin: "kotlin" | ||
// task to create robotclass.txt | ||
task createRobotclassTxt { | ||
inputs.property("robotClass", project.hasProperty("robotClass") ? project.robotClass : "") | ||
outputs.files("$buildDir/robotclass.txt") | ||
doLast { | ||
if (!project.hasProperty("robotClass")) { | ||
throw new GradleException("Robot class not set. Pass a value in on the command line by adding -ProbotClass=<your robot class>.") | ||
} else { | ||
System.out.println("Using robot class " + project.robotClass) | ||
new File("$buildDir/robotclass.txt").text = project.robotClass | ||
} | ||
} | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
deploy { | ||
targets { | ||
roboRIO("roborio") { | ||
team = frc.getTeamOrDefault(1540) | ||
} | ||
} | ||
artifacts { | ||
frcJavaArtifact('frcJava') { | ||
targets << "roborio" | ||
/* | ||
IMPORTANT: With the "deploy-debug" property set (i.e. -Pdeploy-debug is on the | ||
command line), the robot code will not start until you connect your debugger to the | ||
robot. Connect by running the "Remote Robot Debug" run configuration which should be | ||
shared through version control. Alternatively, remove this line and redeploy. | ||
*/ | ||
debug = project.hasProperty("deploy-debug") | ||
} | ||
// This is a file (generated by the task above) that contains the name of the robot class we want to deploy. | ||
// The file then gets read by TestbotLoaderMain and it instantiates the class using | ||
// reflection. | ||
// TODO: Maybe a build-time check that said class file actually exists somewhere in the project? | ||
fileArtifact('robotclassTxt') { | ||
targets << "roborio" | ||
|
||
file = file("$buildDir/robotclass.txt") | ||
directory = "/home/lvuser/" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven {url "https://jitpack.io/"} | ||
dependsOn(createRobotclassTxt) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile 'org.jetbrains:annotations:16.0.3' | ||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
jar.dependsOn(compileTestbotsJava) | ||
|
||
jar { | ||
inputs.files(compileTestbotsJava.outputs.files) | ||
gradle.taskGraph.whenReady { | ||
if (gradle.taskGraph.hasTask(":deployFrcJava") || gradle.taskGraph.hasTask(":simulateJava") || gradle.taskGraph.hasTask(":simulateExternalJava")) { | ||
// fully qualified task name is needed | ||
System.out.println("Deployment or simulation detected.") | ||
from((configurations.compile.collect { | ||
it.isDirectory() ? it : zipTree(it) | ||
}) + sourceSets.testbots.output) | ||
manifest GradleRIOPlugin.javaManifest("org.team1540.rooster.testing.TestbotLoaderMain") | ||
} | ||
} | ||
} | ||
|
||
simulateJava.dependsOn.removeAll() | ||
simulateJava.dependsOn(extractTestJNI) | ||
simulateJava.dependsOn(jar) | ||
|
||
// wrapper | ||
|
||
wrapper { | ||
gradleVersion = '5.0' | ||
distributionType = Wrapper.DistributionType.ALL | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Fri Nov 30 17:46:10 PST 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionPath=permwrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip | ||
zipStorePath=permwrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
rootProject.name = 'ROOSTER' | ||
|
||
include 'lib' | ||
include 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.