| import org.gradle.language.base.internal.ProjectLayout |
| import edu.wpi.first.deployutils.deploy.target.RemoteTarget |
| import edu.wpi.first.deployutils.deploy.target.location.SshDeployLocation |
| import edu.wpi.first.deployutils.deploy.artifact.* |
| import org.gradle.internal.os.OperatingSystem |
| |
| apply plugin: 'cpp' |
| apply plugin: 'visual-studio' |
| apply plugin: 'edu.wpi.first.NativeUtils' |
| apply plugin: ExtraTasks |
| |
| apply plugin: 'edu.wpi.first.DeployUtils' |
| |
| apply from: '../shared/config.gradle' |
| |
| ext { |
| sharedCvConfigs = [crossConnIntegrationTests: []] |
| staticCvConfigs = [:] |
| useJava = false |
| useCpp = true |
| staticGtestConfigs = [crossConnIntegrationTests: []] |
| } |
| |
| apply from: "${rootDir}/shared/opencv.gradle" |
| |
| apply from: "${rootDir}/shared/googletest.gradle" |
| |
| deploy { |
| targets { |
| roborio(RemoteTarget) { |
| directory = '/home/admin' |
| maxChannels = 4 |
| locations { |
| ssh(SshDeployLocation) { |
| address = "172.22.11.2" |
| user = 'admin' |
| password = '' |
| ipv6 = false |
| } |
| } |
| |
| artifacts { |
| all { |
| predeploy << { ctx -> |
| ctx.execute('/usr/local/frc/bin/frcKillRobot.sh -t') |
| } |
| postdeploy << { ctx -> |
| ctx.execute("sync") |
| ctx.execute("ldconfig") |
| } |
| } |
| |
| crossConnIntegrationTests(NativeExecutableArtifact) { |
| libraryDirectory = '/usr/local/frc/third-party/lib' |
| postdeploy << { ctx -> |
| ctx.execute('chmod +x crossConnIntegrationTests') |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| model { |
| components { |
| crossConnIntegrationTests(NativeExecutableSpec) { |
| targetBuildTypes 'debug' |
| nativeUtils.useRequiredLibrary(it, 'googletest_static') |
| binaries.all { binary -> |
| if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
| if (binary.buildType.name == 'debug') { |
| deploy.targets.roborio.artifacts.crossConnIntegrationTests.binary = binary |
| } |
| |
| binary.sources { |
| athenaCpp(CppSourceSet) { |
| source { |
| srcDirs = ['src/main/native/cpp'] |
| includes = ['**/*.cpp'] |
| } |
| exportedHeaders { |
| srcDirs = ['src/main/native/include'] |
| includes = ['**/*.h'] |
| } |
| } |
| } |
| project(':hal').addHalDependency(binary, 'shared') |
| project(':hal').addHalJniDependency(binary) |
| lib project: ':wpinet', library: 'wpinet', linkage: 'shared' |
| lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
| if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
| nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries') |
| } |
| } else { |
| binary.sources { |
| simCpp(CppSourceSet) { |
| source { |
| srcDirs 'src/main/native/dt' |
| includes = ['**/*.cpp'] |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| tasks.register('deployTests') { |
| try { |
| dependsOn tasks.named('deployCrossConnIntegrationTestsLibrariesRoborio') |
| dependsOn tasks.named('deployCrossConnIntegrationTestsRoborio') |
| } catch (ignored) { |
| } |
| } |