blob: 82affa053c7a6d47194969cdec1314720b5f804f [file] [log] [blame]
Brian Silverman8fce7482020-01-05 13:18:21 -08001ext {
2 nativeName = 'wpilibNewCommands'
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 testImplementation 'com.google.guava:guava:19.0'
30 testImplementation 'org.mockito:mockito-core:2.27.0'
31}
32
33nativeUtils.exportsConfigs {
34 wpilibNewCommands {
35 x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
36 '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
37 '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
38 '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
39 x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
40 '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
41 '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
42 '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
43 }
44}
45
46apply plugin: DisableBuildingGTest
47
48model {
49 components {}
50 binaries {
51 all {
52 if (!it.buildable || !(it instanceof NativeBinarySpec)) {
53 return
54 }
55 lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
56 lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
57 project(':hal').addHalDependency(it, 'shared')
58 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
Austin Schuh1e69f942020-11-14 15:06:14 -080059 lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
Brian Silverman8fce7482020-01-05 13:18:21 -080060
61 if (it.component.name == "${nativeName}Dev") {
62 lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
63 project(':hal').addHalJniDependency(it)
64 }
65
66 if (it instanceof GoogleTestTestSuiteBinarySpec) {
67 nativeUtils.useRequiredLibrary(it, 'opencv_shared')
68 lib project: ':cscore', library: 'cscore', linkage: 'shared'
69 }
70 if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
71 nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared')
72 }
73 }
74 }
75 tasks {
76 def c = $.components
77 def found = false
78 def systemArch = getCurrentArch()
79 c.each {
80 if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
81 it.binaries.each {
82 if (!found) {
83 def arch = it.targetPlatform.name
84 if (arch == systemArch) {
85 def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
86
87 found = true
88 }
89 }
90 }
91 }
92 }
93 }
94}
95
96test {
97 testLogging {
98 outputs.upToDateWhen {false}
99 showStandardStreams = true
100 }
101}