James Kuszmaul | 4b81d30 | 2019-12-14 20:53:14 -0800 | [diff] [blame] | 1 | ext { |
| 2 | nativeName = 'wpilibOldCommands' |
| 3 | devMain = 'edu.wpi.first.wpilibj.commands.DevMain' |
| 4 | } |
| 5 | |
| 6 | evaluationDependsOn(':ntcore') |
| 7 | evaluationDependsOn(':cscore') |
| 8 | evaluationDependsOn(':hal') |
| 9 | evaluationDependsOn(':wpilibc') |
| 10 | evaluationDependsOn(':cameraserver') |
| 11 | evaluationDependsOn(':wpilibj') |
| 12 | |
| 13 | apply from: "${rootDir}/shared/javacpp/setupBuild.gradle" |
| 14 | |
| 15 | dependencies { |
| 16 | implementation project(':wpiutil') |
| 17 | implementation project(':ntcore') |
| 18 | implementation project(':cscore') |
| 19 | implementation project(':hal') |
| 20 | implementation project(':wpilibj') |
| 21 | devImplementation project(':wpiutil') |
| 22 | devImplementation project(':ntcore') |
| 23 | devImplementation project(':cscore') |
| 24 | devImplementation project(':hal') |
| 25 | devImplementation project(':wpilibj') |
| 26 | } |
| 27 | |
| 28 | nativeUtils.exportsConfigs { |
| 29 | wpilibOldCommands { |
| 30 | x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure', |
| 31 | '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure', |
| 32 | '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range', |
| 33 | '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast'] |
| 34 | x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure', |
| 35 | '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure', |
| 36 | '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range', |
| 37 | '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast'] |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | apply plugin: DisableBuildingGTest |
| 42 | |
| 43 | model { |
| 44 | components {} |
| 45 | binaries { |
| 46 | all { |
| 47 | if (!it.buildable || !(it instanceof NativeBinarySpec)) { |
| 48 | return |
| 49 | } |
| 50 | lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared' |
| 51 | lib project: ':ntcore', library: 'ntcore', linkage: 'shared' |
| 52 | project(':hal').addHalDependency(it, 'shared') |
| 53 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
| 54 | |
| 55 | if (it.component.name == "${nativeName}Dev") { |
| 56 | lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared' |
| 57 | project(':hal').addHalJniDependency(it) |
| 58 | } |
| 59 | |
| 60 | if (it instanceof GoogleTestTestSuiteBinarySpec) { |
| 61 | nativeUtils.useRequiredLibrary(it, 'opencv_shared') |
| 62 | lib project: ':cscore', library: 'cscore', linkage: 'shared' |
| 63 | } |
| 64 | if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
| 65 | nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared') |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | tasks { |
| 70 | def c = $.components |
| 71 | def found = false |
| 72 | def systemArch = getCurrentArch() |
| 73 | c.each { |
| 74 | if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") { |
| 75 | it.binaries.each { |
| 76 | if (!found) { |
| 77 | def arch = it.targetPlatform.name |
| 78 | if (arch == systemArch) { |
| 79 | def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib' |
| 80 | |
| 81 | found = true |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | test { |
| 91 | testLogging { |
| 92 | outputs.upToDateWhen {false} |
| 93 | showStandardStreams = true |
| 94 | } |
| 95 | } |