Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 1 | ext { |
| 2 | nativeName = 'wpilibNewCommands' |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 3 | devMain = 'edu.wpi.first.wpilibj2.commands.DevMain' |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 4 | } |
| 5 | |
| 6 | evaluationDependsOn(':ntcore') |
| 7 | evaluationDependsOn(':cscore') |
| 8 | evaluationDependsOn(':hal') |
| 9 | evaluationDependsOn(':wpimath') |
| 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') |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 18 | implementation project(':wpinet') |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 19 | implementation project(':ntcore') |
| 20 | implementation project(':cscore') |
| 21 | implementation project(':hal') |
| 22 | implementation project(':wpimath') |
| 23 | implementation project(':wpilibj') |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 24 | testImplementation 'org.mockito:mockito-core:4.1.0' |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | nativeUtils.exportsConfigs { |
| 28 | wpilibNewCommands { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 29 | x64ExcludeSymbols = [ |
| 30 | '_CT??_R0?AV_System_error', |
| 31 | '_CT??_R0?AVexception', |
| 32 | '_CT??_R0?AVfailure', |
| 33 | '_CT??_R0?AVruntime_error', |
| 34 | '_CT??_R0?AVsystem_error', |
| 35 | '_CTA5?AVfailure', |
| 36 | '_TI5?AVfailure', |
| 37 | '_CT??_R0?AVout_of_range', |
| 38 | '_CTA3?AVout_of_range', |
| 39 | '_TI3?AVout_of_range', |
| 40 | '_CT??_R0?AVbad_cast' |
| 41 | ] |
| 42 | } |
| 43 | } |
| 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' |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 53 | project(':ntcore').addNtcoreDependency(it, 'shared') |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 54 | project(':hal').addHalDependency(it, 'shared') |
| 55 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 56 | lib project: ':wpinet', library: 'wpinet', linkage: 'shared' |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 57 | lib project: ':wpimath', library: 'wpimath', linkage: 'shared' |
| 58 | |
| 59 | if (it.component.name == "${nativeName}Dev") { |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 60 | project(':ntcore').addNtcoreJniDependency(it) |
| 61 | lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared' |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 62 | lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared' |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 63 | lib project: ':wpimath', library: 'wpimathJNIShared', linkage: 'shared' |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 64 | project(':hal').addHalJniDependency(it) |
| 65 | } |
| 66 | |
| 67 | if (it instanceof GoogleTestTestSuiteBinarySpec) { |
| 68 | nativeUtils.useRequiredLibrary(it, 'opencv_shared') |
| 69 | lib project: ':cscore', library: 'cscore', linkage: 'shared' |
| 70 | } |
| 71 | if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
| 72 | nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries') |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | tasks { |
| 77 | def c = $.components |
| 78 | def found = false |
| 79 | def systemArch = getCurrentArch() |
| 80 | c.each { |
| 81 | if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") { |
| 82 | it.binaries.each { |
| 83 | if (!found) { |
| 84 | def arch = it.targetPlatform.name |
| 85 | if (arch == systemArch) { |
| 86 | def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib' |
| 87 | |
| 88 | found = true |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | test { |
| 98 | testLogging { |
| 99 | outputs.upToDateWhen {false} |
| 100 | showStandardStreams = true |
| 101 | } |
| 102 | } |