blob: ed81160285de22d1f6aad88f3a4e902c4bd8e377 [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')
18 implementation project(':ntcore')
19 implementation project(':cscore')
20 implementation project(':hal')
21 implementation project(':wpimath')
22 implementation project(':wpilibj')
23 devImplementation project(':wpiutil')
24 devImplementation project(':ntcore')
25 devImplementation project(':cscore')
26 devImplementation project(':hal')
27 devImplementation project(':wpimath')
28 devImplementation project(':wpilibj')
29 testImplementation 'com.google.guava:guava:19.0'
30 testImplementation 'org.mockito:mockito-core:2.27.0'
31}
32
33nativeUtils.exportsConfigs {
34 wpilibNewCommands {
35 x86ExcludeSymbols = [
36 '_CT??_R0?AV_System_error',
37 '_CT??_R0?AVexception',
38 '_CT??_R0?AVfailure',
39 '_CT??_R0?AVruntime_error',
40 '_CT??_R0?AVsystem_error',
41 '_CTA5?AVfailure',
42 '_TI5?AVfailure',
43 '_CT??_R0?AVout_of_range',
44 '_CTA3?AVout_of_range',
45 '_TI3?AVout_of_range',
46 '_CT??_R0?AVbad_cast'
47 ]
48 x64ExcludeSymbols = [
49 '_CT??_R0?AV_System_error',
50 '_CT??_R0?AVexception',
51 '_CT??_R0?AVfailure',
52 '_CT??_R0?AVruntime_error',
53 '_CT??_R0?AVsystem_error',
54 '_CTA5?AVfailure',
55 '_TI5?AVfailure',
56 '_CT??_R0?AVout_of_range',
57 '_CTA3?AVout_of_range',
58 '_TI3?AVout_of_range',
59 '_CT??_R0?AVbad_cast'
60 ]
61 }
62}
63
64model {
65 components {}
66 binaries {
67 all {
68 if (!it.buildable || !(it instanceof NativeBinarySpec)) {
69 return
70 }
71 lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
72 lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
73 project(':hal').addHalDependency(it, 'shared')
74 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
75 lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
76
77 if (it.component.name == "${nativeName}Dev") {
78 lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
79 project(':hal').addHalJniDependency(it)
80 }
81
82 if (it instanceof GoogleTestTestSuiteBinarySpec) {
83 nativeUtils.useRequiredLibrary(it, 'opencv_shared')
84 lib project: ':cscore', library: 'cscore', linkage: 'shared'
85 }
86 if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
87 nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
88 }
89 }
90 }
91 tasks {
92 def c = $.components
93 def found = false
94 def systemArch = getCurrentArch()
95 c.each {
96 if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
97 it.binaries.each {
98 if (!found) {
99 def arch = it.targetPlatform.name
100 if (arch == systemArch) {
101 def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
102
103 found = true
104 }
105 }
106 }
107 }
108 }
109 }
110}
111
112test {
113 testLogging {
114 outputs.upToDateWhen {false}
115 showStandardStreams = true
116 }
117}