File tree Expand file tree Collapse file tree
vscode-wpilib/resources/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11plugins {
22 id " java"
33 id " org.wpilib.GradleRIO" version " ###GRADLERIOREPLACE###"
4+ id " com.gradleup.shadow" version " 9.3.0"
45}
56
67java {
@@ -84,11 +85,11 @@ test {
8485wpi. sim. addGui(). defaultEnabled = true
8586wpi. sim. addDriverstation()
8687
87- // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
88- // in order to make them all available at runtime. Also adding the manifest so WPILib
89- // knows where to look for our Robot Class.
90- jar {
91- from { configurations . runtimeClasspath . collect { it . isDirectory() ? it : zipTree(it) } }
88+ // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat/shaded jar')
89+ // in order to make them all available at runtime and merging service files to make JSON work.
90+ // Also adding the manifest so WPILib knows where to look for our Robot Class.
91+ shadowJar {
92+ mergeServiceFiles()
9293 from(' src' ) { into ' backup/src' }
9394 from(' vendordeps' ) { into ' backup/vendordeps' }
9495 from(' build.gradle' ) { into ' backup' }
9798}
9899
99100// Configure jar and deploy tasks
100- deployArtifact. jarTask = jar
101- wpi. java. configureExecutableTasks(jar )
101+ deployArtifact. jarTask = shadowJar
102+ wpi. java. configureExecutableTasks(shadowJar )
102103wpi. java. configureTestTasks(test)
103104
104105// Configure string concat to always inline compile
Original file line number Diff line number Diff line change @@ -32,16 +32,17 @@ test {
3232}
3333
3434
35- // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
36- // in order to make them all available at runtime. Also adding the manifest so WPILib
37- // knows where to look for our Robot Class.
38- jar {
39- from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
35+ // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat/shaded jar')
36+ // in order to make them all available at runtime and merging service files to make JSON work.
37+ // Also adding the manifest so WPILib knows where to look for our Robot Class.
38+ shadowJar {
39+ mergeServiceFiles()
40+ from sourceSets. main. allSource
4041 manifest org.wpilib.gradlerio.GradleRIOPlugin . javaManifest(ROBOT_MAIN_CLASS )
4142 duplicatesStrategy = DuplicatesStrategy . INCLUDE
4243}
4344
44- wpi. java. configureExecutableTasks(jar )
45+ wpi. java. configureExecutableTasks(shadowJar )
4546wpi. java. configureTestTasks(test)
4647
4748// Configure string concat to always inline compile
Original file line number Diff line number Diff line change @@ -46,16 +46,17 @@ wpi.sim.envVar("HALSIMWS_HOST", "10.0.0.2")
4646wpi. sim. addWebsocketsServer(). defaultEnabled = true
4747wpi. sim. addWebsocketsClient(). defaultEnabled = true
4848
49- // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
50- // in order to make them all available at runtime. Also adding the manifest so WPILib
51- // knows where to look for our Robot Class.
52- jar {
53- from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
49+ // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat/shaded jar')
50+ // in order to make them all available at runtime and merging service files to make JSON work.
51+ // Also adding the manifest so WPILib knows where to look for our Robot Class.
52+ shadowJar {
53+ mergeServiceFiles()
54+ from sourceSets. main. allSource
5455 manifest org.wpilib.gradlerio.GradleRIOPlugin . javaManifest(ROBOT_MAIN_CLASS )
5556 duplicatesStrategy = DuplicatesStrategy . INCLUDE
5657}
5758
58- wpi. java. configureExecutableTasks(jar )
59+ wpi. java. configureExecutableTasks(shadowJar )
5960wpi. java. configureTestTasks(test)
6061
6162// Configure string concat to always inline compile
Original file line number Diff line number Diff line change @@ -45,16 +45,17 @@ wpi.sim.addDriverstation()
4545wpi. sim. envVar(" HALSIMXRP_HOST" , " 192.168.42.1" )
4646wpi. sim. addXRPClient(). defaultEnabled = true
4747
48- // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
49- // in order to make them all available at runtime. Also adding the manifest so WPILib
50- // knows where to look for our Robot Class.
51- jar {
52- from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
48+ // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat/shaded jar')
49+ // in order to make them all available at runtime and merging service files to make JSON work.
50+ // Also adding the manifest so WPILib knows where to look for our Robot Class.
51+ shadowJar {
52+ mergeServiceFiles()
53+ from sourceSets. main. allSource
5354 manifest org.wpilib.gradlerio.GradleRIOPlugin . javaManifest(ROBOT_MAIN_CLASS )
5455 duplicatesStrategy = DuplicatesStrategy . INCLUDE
5556}
5657
57- wpi. java. configureExecutableTasks(jar )
58+ wpi. java. configureExecutableTasks(shadowJar )
5859wpi. java. configureTestTasks(test)
5960
6061// Configure string concat to always inline compile
You can’t perform that action at this time.
0 commit comments