James Kuszmaul | 4b81d30 | 2019-12-14 20:53:14 -0800 | [diff] [blame] | 1 | ext {
|
| 2 | nativeName = 'wpilibNewCommands'
|
| 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 | testImplementation 'com.google.guava:guava:19.0'
|
| 27 | testImplementation 'org.mockito:mockito-core:2.27.0'
|
| 28 | }
|
| 29 |
|
| 30 | nativeUtils.exportsConfigs {
|
| 31 | wpilibNewCommands {
|
| 32 | x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
|
| 33 | '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
|
| 34 | '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
|
| 35 | '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
|
| 36 | x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
|
| 37 | '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
|
| 38 | '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
|
| 39 | '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
|
| 40 | }
|
| 41 | }
|
| 42 |
|
| 43 | apply plugin: DisableBuildingGTest
|
| 44 |
|
| 45 | model {
|
| 46 | components {}
|
| 47 | binaries {
|
| 48 | all {
|
| 49 | if (!it.buildable || !(it instanceof NativeBinarySpec)) {
|
| 50 | return
|
| 51 | }
|
| 52 | lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
|
| 53 | lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
| 54 | project(':hal').addHalDependency(it, 'shared')
|
| 55 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
| 56 |
|
| 57 | if (it.component.name == "${nativeName}Dev") {
|
| 58 | lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
|
| 59 | project(':hal').addHalJniDependency(it)
|
| 60 | }
|
| 61 |
|
| 62 | if (it instanceof GoogleTestTestSuiteBinarySpec) {
|
| 63 | nativeUtils.useRequiredLibrary(it, 'opencv_shared')
|
| 64 | lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
| 65 | }
|
| 66 | if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
| 67 | nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared')
|
| 68 | }
|
| 69 | }
|
| 70 | }
|
| 71 | tasks {
|
| 72 | def c = $.components
|
| 73 | def found = false
|
| 74 | def systemArch = getCurrentArch()
|
| 75 | c.each {
|
| 76 | if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
|
| 77 | it.binaries.each {
|
| 78 | if (!found) {
|
| 79 | def arch = it.targetPlatform.name
|
| 80 | if (arch == systemArch) {
|
| 81 | def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
|
| 82 |
|
| 83 | found = true
|
| 84 | }
|
| 85 | }
|
| 86 | }
|
| 87 | }
|
| 88 | }
|
| 89 | }
|
| 90 | }
|
| 91 |
|
| 92 | test {
|
| 93 | testLogging {
|
| 94 | outputs.upToDateWhen {false}
|
| 95 | showStandardStreams = true
|
| 96 | }
|
| 97 | }
|