Squashed 'third_party/allwpilib_2019/' content from commit bd05dfa1c
Change-Id: I2b1c2250cdb9b055133780c33593292098c375b7
git-subtree-dir: third_party/allwpilib_2019
git-subtree-split: bd05dfa1c7cca74c4fac451e7b9d6a37e7b53447
diff --git a/simulation/lowfi_simulation/build.gradle b/simulation/lowfi_simulation/build.gradle
new file mode 100644
index 0000000..2b97416
--- /dev/null
+++ b/simulation/lowfi_simulation/build.gradle
@@ -0,0 +1,201 @@
+apply plugin: 'cpp'
+apply plugin: 'google-test-test-suite'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: SingleNativeBuild
+apply plugin: ExtraTasks
+
+
+ext {
+ nativeName = 'lowfi_sim'
+}
+
+apply from: "${rootDir}/shared/config.gradle"
+
+if (!project.hasProperty('onlyAthena')) {
+
+ ext {
+ sharedCvConfigs = [lowfi_simTest: []]
+ staticCvConfigs = [:]
+ useJava = false
+ useCpp = true
+ }
+ apply from: "${rootDir}/shared/opencv.gradle"
+
+ ext {
+ staticGtestConfigs = [:]
+ }
+ staticGtestConfigs["${nativeName}Test"] = []
+ apply from: "${rootDir}/shared/googletest.gradle"
+
+ project(':').libraryBuild.dependsOn build
+
+ ext {
+ chipObjectComponents = ["$nativeName".toString(), "${nativeName}Dev".toString(), "${nativeName}Base".toString(),
+ "${nativeName}Test".toString()]
+ netCommComponents = ["$nativeName".toString(), "${nativeName}Dev".toString(), "${nativeName}Base".toString(),
+ "${nativeName}Test".toString()]
+ useNiJava = false
+ }
+
+ apply from: "${rootDir}/shared/nilibraries.gradle"
+
+ model {
+ exportsConfigs {
+ lowfi_sim(ExportsConfig) {
+ x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+ '_CT??_R0?AVbad_cast',
+ '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+ '_TI5?AVfailure']
+ x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+ '_CT??_R0?AVbad_cast',
+ '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+ '_TI5?AVfailure']
+ }
+ }
+ components {
+ "${nativeName}Base"(NativeLibrarySpec) {
+ sources {
+ cpp {
+ source {
+ srcDirs = ['src/main/native/cpp']
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs 'src/main/native/include'
+ }
+ }
+ }
+ binaries.all {
+ if (it instanceof SharedLibraryBinarySpec) {
+ it.buildable = false
+ return
+ }
+ if (it.targetPlatform.architecture.name == 'athena') {
+ it.buildable = false
+ return
+ }
+ project(':hal').addHalDependency(it, 'shared')
+ lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+ lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+ }
+ }
+ "${nativeName}"(NativeLibrarySpec) {
+ sources {
+ cpp {
+ source {
+ srcDirs "${rootDir}/shared/singlelib"
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs 'src/main/native/include'
+ }
+ }
+ }
+ binaries.all {
+ if (it.targetPlatform.architecture.name == 'athena') {
+ it.buildable = false
+ return
+ }
+ project(':hal').addHalDependency(it, 'shared')
+ lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+ lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+ }
+ }
+ // By default, a development executable will be generated. This is to help the case of
+ // testing specific functionality of the library.
+ "${nativeName}Dev"(NativeExecutableSpec) {
+ targetBuildTypes 'debug'
+ sources {
+ cpp {
+ source {
+ srcDirs 'src/dev/native/cpp'
+ include '**/*.cpp'
+ lib library: "${nativeName}"
+ }
+ exportedHeaders {
+ srcDirs 'src/dev/native/include'
+ }
+ }
+ }
+ binaries.all {
+ if (it.targetPlatform.architecture.name == 'athena') {
+ it.buildable = false
+ return
+ }
+ project(':hal').addHalDependency(it, 'shared')
+ lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+ lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+ lib library: nativeName, linkage: 'shared'
+ }
+ }
+ }
+ binaries {
+ withType(GoogleTestTestSuiteBinarySpec) {
+ lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
+ lib project: ':cscore', library: 'cscore', linkage: 'shared'
+ project(':hal').addHalDependency(it, 'shared')
+ lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+ lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
+ lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
+ lib project: ':simulation:halsim_adx_gyro_accelerometer', library: 'halsim_adx_gyro_accelerometer', linkage: 'shared'
+ lib library: nativeName, linkage: 'shared'
+ }
+ }
+ }
+
+ apply from: "publish.gradle"
+}
+
+model {
+
+ testSuites {
+ if (!project.hasProperty('onlyAthena') && !project.hasProperty('onlyRaspbian')) {
+ "${nativeName}Test"(GoogleTestTestSuiteSpec) {
+ for(NativeComponentSpec c : $.components) {
+ if (c.name == nativeName) {
+ testing c
+ break
+ }
+ }
+ sources {
+ cpp {
+ source {
+ srcDirs 'src/test/native/cpp'
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs 'src/test/native/include', 'src/main/native/cpp'
+ }
+ }
+ }
+ }
+ }
+ }
+ tasks {
+ def c = $.components
+ project.tasks.create('runCpp', Exec) {
+ def found = false
+ c.each {
+ if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
+ it.binaries.each {
+ if (!found) {
+ def arch = it.targetPlatform.architecture.name
+ if (arch == 'x86-64' || arch == 'x86') {
+ dependsOn it.tasks.install
+ commandLine it.tasks.install.runScriptFile.get().asFile.toString()
+
+ found = true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+tasks.withType(RunTestExecutable) {
+ args "--gtest_output=xml:test_detail.xml"
+ outputs.dir outputDir
+}