Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Updates to make the build script setup easier to use
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger committed Jan 20, 2019
1 parent 1877501 commit 0206794
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
compile localGroovy()
testCompile gradleTestKit()

compile "edu.wpi.first:GradleRIO:2019.1.1"
compile "edu.wpi.first:GradleRIO:2019.2.1"
}

archivesBaseName = "SnobotSimulatorPlugin"
Expand All @@ -47,7 +47,7 @@ publishing {


group = "com.snobot.simulator.plugin"
version = "2019-0.2.0"
version = "2019-1.0.0"

pluginBundle {
website = 'https://github.com/pjreiniger/SnobotSimPlugin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class SnobotSimulatorPlugin implements Plugin<Project> {
void apply(Project project) {
SnobotSimulatorVersionsExtension snobotSimExtension = project.extensions.create("snobotSim", SnobotSimulatorVersionsExtension, project)

project.configurations.maybeCreate("snobotSimCompile")
project.configurations.maybeCreate("snobotSimJavaNative")
project.configurations.maybeCreate("snobotSimCppNative")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import groovy.transform.CompileStatic
class SnobotSimulatorVersionsExtension {

String snobotSimVersion = "2019-0.0.1-RC"
String snobotSimCtreVersion = "5.12.0_V0_RC"
String snobotSimCtreVersion = "5.12.0_V1_RC"
String jfreechart = "1.0.13"
String jinput = "2.0.7"
String log4j = "2.11.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ class RunJavaSnobotSimPlugin implements Plugin<Project> {
t.group = "SnobotSimulator"
}


if(project.sourceSets.findByName("simulatorExtensions") != null) {
project.tasks.register("simulatorExtensionJavaJar", Jar) {
baseName = "SnobotSimExtensions"
from project.sourceSets.simulatorExtensions.output
}
}


project.tasks.withType(Test).configureEach { Test t ->
t.dependsOn("extractSnobotSimJavaJNI")
}
Expand All @@ -35,8 +44,8 @@ class RunJavaSnobotSimPlugin implements Plugin<Project> {

task.dependsOn jarTask

if(project.tasks.findByName("simulatorExtensionJar")) {
task.dependsOn "simulatorExtensionJar"
if(project.tasks.findByName("simulatorExtensionJavaJar")) {
task.dependsOn "simulatorExtensionJavaJar"
}

task.doLast {
Expand All @@ -45,8 +54,8 @@ class RunJavaSnobotSimPlugin implements Plugin<Project> {
classpath = addToClasspath(project.configurations.getByName("compile"), classpath)
classpath = addToClasspath(project.configurations.getByName("snobotSimCompile"), classpath)

if(project.tasks.findByName("simulatorExtensionJar")) {
project.tasks.getByName("simulatorExtensionJar").outputs.files.each {
if(project.tasks.findByName("simulatorExtensionJavaJar")) {
project.tasks.getByName("simulatorExtensionJavaJar").outputs.files.each {
classpath += it.getAbsolutePath() + envDelimiter()
logger.info("Adding custom extension to the classpath: " + it.getAbsolutePath());
}
Expand Down

0 comments on commit 0206794

Please sign in to comment.