Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -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') |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 9 | evaluationDependsOn(':wpimath') |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 10 | evaluationDependsOn(':wpilibc') |
| 11 | evaluationDependsOn(':cameraserver') |
| 12 | evaluationDependsOn(':wpilibj') |
| 13 | |
| 14 | apply from: "${rootDir}/shared/javacpp/setupBuild.gradle" |
| 15 | |
| 16 | dependencies { |
| 17 | implementation project(':wpiutil') |
| 18 | implementation project(':ntcore') |
| 19 | implementation project(':cscore') |
| 20 | implementation project(':hal') |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 21 | implementation project(':wpimath') |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 22 | implementation project(':wpilibj') |
| 23 | devImplementation project(':wpiutil') |
| 24 | devImplementation project(':ntcore') |
| 25 | devImplementation project(':cscore') |
| 26 | devImplementation project(':hal') |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 27 | devImplementation project(':wpimath') |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 28 | devImplementation project(':wpilibj') |
| 29 | } |
| 30 | |
| 31 | nativeUtils.exportsConfigs { |
| 32 | wpilibOldCommands { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 33 | x86ExcludeSymbols = [ |
| 34 | '_CT??_R0?AV_System_error', |
| 35 | '_CT??_R0?AVexception', |
| 36 | '_CT??_R0?AVfailure', |
| 37 | '_CT??_R0?AVruntime_error', |
| 38 | '_CT??_R0?AVsystem_error', |
| 39 | '_CTA5?AVfailure', |
| 40 | '_TI5?AVfailure', |
| 41 | '_CT??_R0?AVout_of_range', |
| 42 | '_CTA3?AVout_of_range', |
| 43 | '_TI3?AVout_of_range', |
| 44 | '_CT??_R0?AVbad_cast' |
| 45 | ] |
| 46 | x64ExcludeSymbols = [ |
| 47 | '_CT??_R0?AV_System_error', |
| 48 | '_CT??_R0?AVexception', |
| 49 | '_CT??_R0?AVfailure', |
| 50 | '_CT??_R0?AVruntime_error', |
| 51 | '_CT??_R0?AVsystem_error', |
| 52 | '_CTA5?AVfailure', |
| 53 | '_TI5?AVfailure', |
| 54 | '_CT??_R0?AVout_of_range', |
| 55 | '_CTA3?AVout_of_range', |
| 56 | '_TI3?AVout_of_range', |
| 57 | '_CT??_R0?AVbad_cast' |
| 58 | ] |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 59 | } |
| 60 | } |
| 61 | |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 62 | model { |
| 63 | components {} |
| 64 | binaries { |
| 65 | all { |
| 66 | if (!it.buildable || !(it instanceof NativeBinarySpec)) { |
| 67 | return |
| 68 | } |
| 69 | lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared' |
| 70 | lib project: ':ntcore', library: 'ntcore', linkage: 'shared' |
| 71 | project(':hal').addHalDependency(it, 'shared') |
| 72 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 73 | lib project: ':wpimath', library: 'wpimath', linkage: 'shared' |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 74 | |
| 75 | if (it.component.name == "${nativeName}Dev") { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 76 | lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared' |
| 77 | project(':hal').addHalJniDependency(it) |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | if (it instanceof GoogleTestTestSuiteBinarySpec) { |
| 81 | nativeUtils.useRequiredLibrary(it, 'opencv_shared') |
| 82 | lib project: ':cscore', library: 'cscore', linkage: 'shared' |
| 83 | } |
| 84 | if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 85 | nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries') |
Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 86 | } |
| 87 | } |
| 88 | } |
| 89 | tasks { |
| 90 | def c = $.components |
| 91 | def found = false |
| 92 | def systemArch = getCurrentArch() |
| 93 | c.each { |
| 94 | if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") { |
| 95 | it.binaries.each { |
| 96 | if (!found) { |
| 97 | def arch = it.targetPlatform.name |
| 98 | if (arch == systemArch) { |
| 99 | def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib' |
| 100 | |
| 101 | found = true |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | test { |
| 111 | testLogging { |
| 112 | outputs.upToDateWhen {false} |
| 113 | showStandardStreams = true |
| 114 | } |
| 115 | } |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 116 | |
| 117 | tasks.withType(JavaCompile) { |
| 118 | options.compilerArgs += "-Xlint:-removal" |
| 119 | } |