mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Add deploy options to myRobot (#2079)
Will only deploy to USB by default, and will not deploy the JRE, but will deploy a Java app.
This commit is contained in:
committed by
Peter Johnson
parent
b7bc1ea745
commit
bf5388393e
@@ -5,5 +5,5 @@ repositories {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation "edu.wpi.first:native-utils:2020.5.1"
|
||||
implementation "edu.wpi.first:native-utils:2020.5.2"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import jaci.gradle.toolchains.*
|
||||
import jaci.gradle.nativedeps.*
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
@@ -6,6 +9,7 @@ plugins {
|
||||
}
|
||||
|
||||
apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
apply plugin: 'jaci.gradle.EmbeddedTools'
|
||||
|
||||
apply from: '../shared/config.gradle'
|
||||
|
||||
@@ -19,6 +23,106 @@ ext {
|
||||
|
||||
apply from: "${rootDir}/shared/opencv.gradle"
|
||||
|
||||
deploy {
|
||||
targets {
|
||||
target('roborio') {
|
||||
directory = '/home/admin'
|
||||
maxChannels = 4
|
||||
locations {
|
||||
ssh {
|
||||
address = "172.22.11.2"
|
||||
user = 'admin'
|
||||
password = ''
|
||||
ipv6 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
artifacts {
|
||||
all {
|
||||
targets << 'roborio'
|
||||
predeploy << { ctx ->
|
||||
ctx.execute('/usr/local/frc/bin/frcKillRobot.sh -t')
|
||||
}
|
||||
postdeploy << { ctx ->
|
||||
ctx.execute("sync")
|
||||
ctx.execute("ldconfig")
|
||||
}
|
||||
}
|
||||
|
||||
javaArtifact('myRobotJava') {
|
||||
jar = 'shadowJar'
|
||||
postdeploy << { ctx ->
|
||||
ctx.execute("echo '/usr/local/frc/JRE/bin/java -XX:+UseConcMarkSweepGC -Djava.library.path=/usr/local/frc/third-party/lib -Djava.lang.invoke.stringConcat=BC_SB -jar /home/admin/myRobot-all.jar' > /home/admin/myRobotJavaRun")
|
||||
ctx.execute("chmod +x /home/admin/myRobotJavaRun; chown lvuser /home/admin/myRobotJavaRun")
|
||||
}
|
||||
}
|
||||
|
||||
nativeArtifact('myRobotCpp') {
|
||||
component = 'myRobotCpp'
|
||||
targetPlatform = nativeUtils.wpi.platforms.roborio
|
||||
libraryDirectory = '/usr/local/frc/third-party/lib'
|
||||
buildType = 'debug'
|
||||
postdeploy << { ctx ->
|
||||
ctx.execute('chmod +x myRobotCpp')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
nativeArtifact('myRobotCppRelease') {
|
||||
component = 'myRobotCpp'
|
||||
targetPlatform = nativeUtils.wpi.platforms.roborio
|
||||
libraryDirectory = '/usr/local/frc/third-party/lib'
|
||||
buildType = 'release'
|
||||
postdeploy << { ctx ->
|
||||
ctx.execute('chmod +x myRobotCpp')
|
||||
}
|
||||
}
|
||||
|
||||
nativeArtifact('myRobotCppStatic') {
|
||||
component = 'myRobotCppStatic'
|
||||
targetPlatform = nativeUtils.wpi.platforms.roborio
|
||||
buildType = 'debug'
|
||||
|
||||
postdeploy << { ctx ->
|
||||
ctx.execute('chmod +x myRobotCppStatic')
|
||||
}
|
||||
}
|
||||
|
||||
nativeArtifact('myRobotCppStaticRelease') {
|
||||
component = 'myRobotCppStatic'
|
||||
targetPlatform = nativeUtils.wpi.platforms.roborio
|
||||
buildType = 'release'
|
||||
postdeploy << { ctx ->
|
||||
ctx.execute('chmod +x myRobotCppStatic')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('deployJava') {
|
||||
dependsOn tasks.named('deployMyRobotJavaRoborio')
|
||||
dependsOn tasks.named('deployMyRobotCppLibrariesRoborio')
|
||||
}
|
||||
|
||||
tasks.register('deployShared') {
|
||||
dependsOn tasks.named('deployMyRobotCppLibrariesRoborio')
|
||||
dependsOn tasks.named('deployMyRobotCppRoborio')
|
||||
}
|
||||
|
||||
tasks.register('deployStatic') {
|
||||
dependsOn tasks.named('deployMyRobotCppStaticRoborio')
|
||||
}
|
||||
|
||||
tasks.register('deployReleaseShared') {
|
||||
dependsOn tasks.named('deployMyRobotCppReleaseLibrariesRoborio')
|
||||
dependsOn tasks.named('deployMyRobotCppReleaseRoborio')
|
||||
}
|
||||
|
||||
tasks.register('deployReleaseStatic') {
|
||||
dependsOn tasks.named('deployMyRobotCppReleaseStaticRoborio')
|
||||
}
|
||||
|
||||
mainClassName = 'Main'
|
||||
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
@@ -38,15 +142,10 @@ dependencies {
|
||||
implementation project(':wpilibNewCommands')
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest { attributes 'Robot-Class': 'MyRobot' }
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
myRobotCpp(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
baseName = 'FRCUserProgram'
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
@@ -78,7 +177,6 @@ model {
|
||||
}
|
||||
myRobotCppStatic(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
baseName = 'FRCUserProgram'
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
|
||||
Reference in New Issue
Block a user