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