blob: 3c9f0c4dd753fa94ea97bb563a84544448771cbd [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')
Austin Schuh75263e32022-02-22 18:05:32 -080029 testImplementation 'org.mockito:mockito-core:4.1.0'
Austin Schuh812d0d12021-11-04 20:16:48 -070030}
31
32nativeUtils.exportsConfigs {
33 wpilibNewCommands {
34 x86ExcludeSymbols = [
35 '_CT??_R0?AV_System_error',
36 '_CT??_R0?AVexception',
37 '_CT??_R0?AVfailure',
38 '_CT??_R0?AVruntime_error',
39 '_CT??_R0?AVsystem_error',
40 '_CTA5?AVfailure',
41 '_TI5?AVfailure',
42 '_CT??_R0?AVout_of_range',
43 '_CTA3?AVout_of_range',
44 '_TI3?AVout_of_range',
45 '_CT??_R0?AVbad_cast'
46 ]
47 x64ExcludeSymbols = [
48 '_CT??_R0?AV_System_error',
49 '_CT??_R0?AVexception',
50 '_CT??_R0?AVfailure',
51 '_CT??_R0?AVruntime_error',
52 '_CT??_R0?AVsystem_error',
53 '_CTA5?AVfailure',
54 '_TI5?AVfailure',
55 '_CT??_R0?AVout_of_range',
56 '_CTA3?AVout_of_range',
57 '_TI3?AVout_of_range',
58 '_CT??_R0?AVbad_cast'
59 ]
60 }
61}
62
63model {
64 components {}
65 binaries {
66 all {
67 if (!it.buildable || !(it instanceof NativeBinarySpec)) {
68 return
69 }
70 lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
71 lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
72 project(':hal').addHalDependency(it, 'shared')
73 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
74 lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
75
76 if (it.component.name == "${nativeName}Dev") {
77 lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
Austin Schuh75263e32022-02-22 18:05:32 -080078 lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
Austin Schuh812d0d12021-11-04 20:16:48 -070079 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}