blob: d60fcde1e4c40201b3255b041f19ca8de2a9cc1c [file] [log] [blame]
Austin Schuh812d0d12021-11-04 20:16:48 -07001ext {
2 nativeName = 'wpilibNewCommands'
James Kuszmaulb13e13f2023-11-22 20:44:04 -08003 devMain = 'edu.wpi.first.wpilibj2.commands.DevMain'
Austin Schuh812d0d12021-11-04 20:16:48 -07004}
5
6evaluationDependsOn(':ntcore')
7evaluationDependsOn(':cscore')
8evaluationDependsOn(':hal')
9evaluationDependsOn(':wpimath')
10evaluationDependsOn(':wpilibc')
11evaluationDependsOn(':cameraserver')
12evaluationDependsOn(':wpilibj')
13
14apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
15
16dependencies {
17 implementation project(':wpiutil')
James Kuszmaulcf324122023-01-14 14:07:17 -080018 implementation project(':wpinet')
Austin Schuh812d0d12021-11-04 20:16:48 -070019 implementation project(':ntcore')
20 implementation project(':cscore')
21 implementation project(':hal')
22 implementation project(':wpimath')
23 implementation project(':wpilibj')
Austin Schuh75263e32022-02-22 18:05:32 -080024 testImplementation 'org.mockito:mockito-core:4.1.0'
Austin Schuh812d0d12021-11-04 20:16:48 -070025}
26
27nativeUtils.exportsConfigs {
28 wpilibNewCommands {
Austin Schuh812d0d12021-11-04 20:16:48 -070029 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
45model {
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 Kuszmaulcf324122023-01-14 14:07:17 -080053 project(':ntcore').addNtcoreDependency(it, 'shared')
Austin Schuh812d0d12021-11-04 20:16:48 -070054 project(':hal').addHalDependency(it, 'shared')
55 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
James Kuszmaulcf324122023-01-14 14:07:17 -080056 lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
Austin Schuh812d0d12021-11-04 20:16:48 -070057 lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
58
59 if (it.component.name == "${nativeName}Dev") {
James Kuszmaulcf324122023-01-14 14:07:17 -080060 project(':ntcore').addNtcoreJniDependency(it)
61 lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
Austin Schuh75263e32022-02-22 18:05:32 -080062 lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
James Kuszmaulb13e13f2023-11-22 20:44:04 -080063 lib project: ':wpimath', library: 'wpimathJNIShared', linkage: 'shared'
Austin Schuh812d0d12021-11-04 20:16:48 -070064 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
97test {
98 testLogging {
99 outputs.upToDateWhen {false}
100 showStandardStreams = true
101 }
102}