blob: 39870ee35394d09074ac2678e9896fbf44d03cad [file] [log] [blame]
Brian Silverman8fce7482020-01-05 13:18:21 -08001ext {
2 nativeName = 'wpilibOldCommands'
3 devMain = 'edu.wpi.first.wpilibj.commands.DevMain'
4}
5
6evaluationDependsOn(':ntcore')
7evaluationDependsOn(':cscore')
8evaluationDependsOn(':hal')
Austin Schuh1e69f942020-11-14 15:06:14 -08009evaluationDependsOn(':wpimath')
Brian Silverman8fce7482020-01-05 13:18:21 -080010evaluationDependsOn(':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')
Austin Schuh1e69f942020-11-14 15:06:14 -080021 implementation project(':wpimath')
Brian Silverman8fce7482020-01-05 13:18:21 -080022 implementation project(':wpilibj')
23 devImplementation project(':wpiutil')
24 devImplementation project(':ntcore')
25 devImplementation project(':cscore')
26 devImplementation project(':hal')
Austin Schuh1e69f942020-11-14 15:06:14 -080027 devImplementation project(':wpimath')
Brian Silverman8fce7482020-01-05 13:18:21 -080028 devImplementation project(':wpilibj')
29}
30
31nativeUtils.exportsConfigs {
32 wpilibOldCommands {
Austin Schuh812d0d12021-11-04 20:16:48 -070033 x86ExcludeSymbols = [
34 '_CT??_R0?AV_System_error',
35 '_CT??_R0?AVexception',
36 '_CT??_R0?AVfailure',
37 '_CT??_R0?AVruntime_error',
38 '_CT??_R0?AVsystem_error',
39 '_CTA5?AVfailure',
40 '_TI5?AVfailure',
41 '_CT??_R0?AVout_of_range',
42 '_CTA3?AVout_of_range',
43 '_TI3?AVout_of_range',
44 '_CT??_R0?AVbad_cast'
45 ]
46 x64ExcludeSymbols = [
47 '_CT??_R0?AV_System_error',
48 '_CT??_R0?AVexception',
49 '_CT??_R0?AVfailure',
50 '_CT??_R0?AVruntime_error',
51 '_CT??_R0?AVsystem_error',
52 '_CTA5?AVfailure',
53 '_TI5?AVfailure',
54 '_CT??_R0?AVout_of_range',
55 '_CTA3?AVout_of_range',
56 '_TI3?AVout_of_range',
57 '_CT??_R0?AVbad_cast'
58 ]
Brian Silverman8fce7482020-01-05 13:18:21 -080059 }
60}
61
Brian Silverman8fce7482020-01-05 13:18:21 -080062model {
63 components {}
64 binaries {
65 all {
66 if (!it.buildable || !(it instanceof NativeBinarySpec)) {
67 return
68 }
69 lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
70 lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
71 project(':hal').addHalDependency(it, 'shared')
72 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
Austin Schuh1e69f942020-11-14 15:06:14 -080073 lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
Brian Silverman8fce7482020-01-05 13:18:21 -080074
75 if (it.component.name == "${nativeName}Dev") {
Austin Schuh812d0d12021-11-04 20:16:48 -070076 lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
77 project(':hal').addHalJniDependency(it)
Brian Silverman8fce7482020-01-05 13:18:21 -080078 }
79
80 if (it instanceof GoogleTestTestSuiteBinarySpec) {
81 nativeUtils.useRequiredLibrary(it, 'opencv_shared')
82 lib project: ':cscore', library: 'cscore', linkage: 'shared'
83 }
84 if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
Austin Schuh812d0d12021-11-04 20:16:48 -070085 nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
Brian Silverman8fce7482020-01-05 13:18:21 -080086 }
87 }
88 }
89 tasks {
90 def c = $.components
91 def found = false
92 def systemArch = getCurrentArch()
93 c.each {
94 if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
95 it.binaries.each {
96 if (!found) {
97 def arch = it.targetPlatform.name
98 if (arch == systemArch) {
99 def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
100
101 found = true
102 }
103 }
104 }
105 }
106 }
107 }
108}
109
110test {
111 testLogging {
112 outputs.upToDateWhen {false}
113 showStandardStreams = true
114 }
115}
Austin Schuh812d0d12021-11-04 20:16:48 -0700116
117tasks.withType(JavaCompile) {
118 options.compilerArgs += "-Xlint:-removal"
119}