blob: 82fc4700364400f5858d6807ff825f0176294fd3 [file] [log] [blame]
Austin Schuh812d0d12021-11-04 20:16:48 -07001ext {
2 nativeName = 'wpilibNewCommands'
3 devMain = 'edu.wpi.first.wpilibj.commands.DevMain'
4}
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')
24 devImplementation project(':wpiutil')
James Kuszmaulcf324122023-01-14 14:07:17 -080025 devImplementation project(':wpinet')
Austin Schuh812d0d12021-11-04 20:16:48 -070026 devImplementation project(':ntcore')
27 devImplementation project(':cscore')
28 devImplementation project(':hal')
29 devImplementation project(':wpimath')
30 devImplementation project(':wpilibj')
Austin Schuh75263e32022-02-22 18:05:32 -080031 testImplementation 'org.mockito:mockito-core:4.1.0'
Austin Schuh812d0d12021-11-04 20:16:48 -070032}
33
34nativeUtils.exportsConfigs {
35 wpilibNewCommands {
Austin Schuh812d0d12021-11-04 20:16:48 -070036 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
52model {
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 Kuszmaulcf324122023-01-14 14:07:17 -080060 project(':ntcore').addNtcoreDependency(it, 'shared')
Austin Schuh812d0d12021-11-04 20:16:48 -070061 project(':hal').addHalDependency(it, 'shared')
62 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
James Kuszmaulcf324122023-01-14 14:07:17 -080063 lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
Austin Schuh812d0d12021-11-04 20:16:48 -070064 lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
65
66 if (it.component.name == "${nativeName}Dev") {
James Kuszmaulcf324122023-01-14 14:07:17 -080067 project(':ntcore').addNtcoreJniDependency(it)
68 lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
Austin Schuh75263e32022-02-22 18:05:32 -080069 lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
Austin Schuh812d0d12021-11-04 20:16:48 -070070 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
103test {
104 testLogging {
105 outputs.upToDateWhen {false}
106 showStandardStreams = true
107 }
108}