Files
allwpilib/wpilibcIntegrationTests/build.gradle

106 lines
4.2 KiB
Groovy
Raw Normal View History

import org.gradle.language.base.internal.ProjectLayout
2018-04-29 13:29:07 -07:00
apply plugin: 'cpp'
apply plugin: 'visual-studio'
apply plugin: 'edu.wpi.first.NativeUtils'
apply plugin: ExtraTasks
2018-04-29 13:29:07 -07:00
apply from: '../shared/config.gradle'
2018-04-29 13:29:07 -07:00
ext {
sharedCvConfigs = [wpilibcIntegrationTests: []]
staticCvConfigs = [:]
useJava = false
useCpp = true
staticGtestConfigs = [wpilibcIntegrationTests: []]
2018-04-29 13:29:07 -07:00
}
2018-04-29 13:29:07 -07:00
apply from: "${rootDir}/shared/opencv.gradle"
apply from: "${rootDir}/shared/googletest.gradle"
2018-04-29 13:29:07 -07:00
model {
components {
wpilibcIntegrationTests(NativeExecutableSpec) {
targetBuildTypes 'debug'
2018-04-29 13:29:07 -07:00
baseName = 'FRCUserProgram'
nativeUtils.useRequiredLibrary(it, 'googletest_static')
2018-04-29 13:29:07 -07:00
binaries.all { binary ->
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
2018-04-29 13:29:07 -07:00
binary.sources {
athenaCpp(CppSourceSet) {
source {
srcDirs = ['src/main/native/cpp']
includes = ['**/*.cpp']
}
exportedHeaders {
srcDirs = ['src/main/native/include']
includes = ['**/*.h']
}
}
}
2018-04-29 13:29:07 -07:00
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
2022-10-08 10:01:31 -07:00
project(':ntcore').addNtcoreDependency(binary, 'shared')
project(':ntcore').addNtcoreJniDependency(binary)
2018-04-29 13:29:07 -07:00
lib project: ':cscore', library: 'cscore', linkage: 'shared'
lib project: ':cscore', library: 'cscoreJNIShared', linkage: 'shared'
project(':hal').addHalDependency(binary, 'shared')
project(':hal').addHalJniDependency(binary)
2018-04-29 13:29:07 -07:00
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpimath', library: 'wpimathJNIShared', linkage: 'shared'
lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
2018-04-29 13:29:07 -07:00
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
2019-11-13 21:35:52 -08:00
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
2019-11-13 21:35:52 -08:00
}
2018-04-29 13:29:07 -07:00
} else {
binary.sources {
simCpp(CppSourceSet) {
source {
srcDirs 'src/main/native/dt'
includes = ['**/*.cpp']
}
}
}
}
}
}
}
}
def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles")
model {
tasks {
2018-04-29 13:29:07 -07:00
copyWpilibCTestLibrariesToOutput(Copy) {
def task = it
$.binaries.each {
if (it in NativeExecutableBinarySpec && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio && it.buildable) {
2018-04-29 13:29:07 -07:00
def installTask = it.tasks.install
task.dependsOn installTask
task.from(installTask.executableFile) {
into '/cpp'
}
installTask.libs.each {
if (it.absolutePath.endsWith('.debug')) {
return
}
2018-04-29 13:29:07 -07:00
task.from(it) {
into '/libs'
}
}
}
}
2018-04-29 13:29:07 -07:00
destinationDir testOutputFolder
}
// This is in a separate if statement because of what I would assume is a bug in grade.
// Will file an issue on their side.
if (!project.hasProperty('skiponlyathena')) {
build.dependsOn copyWpilibCTestLibrariesToOutput
}
}
}