-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathteams.gradle
executable file
·98 lines (82 loc) · 2.89 KB
/
teams.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Included by team projects (:5333 and :5663), since both follow the same build pattern
apply plugin: 'cpp'
apply plugin: 'google-test-test-suite'
apply plugin: 'edu.wpi.first.GradleRIO'
deploy {
targets {
roboRIO('roborio') {
team = project.hasProperty("team") ? project.team.toInteger() : project.name.toInteger()
// For VSCode Debugging - we won't be able to deploy to every target!
if (project.hasProperty("debugMode"))
failOnMissing = false
}
}
artifacts {
frcNativeArtifact('frcCpp') {
targets << 'roborio'
component = "frcUserProgram${project.name}"
// Debug can be overridden by command line, for use with VSCode (with -PdebugMode)
debug = frc.getDebugOrDefault(false)
}
fileTreeArtifact('frcStaticFileDeploy') {
targets << 'roborio'
files = fileTree(dir: 'src/main/deploy')
// Deploy to RoboRIO target, into /home/lvuser/deploy
directory = '/home/lvuser/deploy'
}
}
}
dependencies {
// The 2019.2.1 release of halsim_ds_socket is broken on windows, so we built a fixed version ourselves while
// we wait for 2019.3.1
if (wpi.platforms.desktop == 'windowsx86-64') {
simulation rootProject.files('libs/halsim_ds_socketd.dll')
} else if (wpi.platforms.desktop == 'osxx86-64') {
simulation rootProject.files('libs/libhalsim_ds_socketd.dylib')
} else if (wpi.platforms.desktop == 'linuxx86-64') {
simulation rootProject.files('libs/libhalsim_ds_socketd.so')
} else {
simulation "edu.wpi.first.halsim:halsim_ds_socket:${wpi.wpilibVersion}:${wpi.platforms.desktop}debug@zip"
}
}
wpi.deps.vendor.loadFrom(project(':common'))
model {
components {
"frcUserProgram${project.name}"(NativeExecutableSpec) {
targetPlatform wpi.platforms.roborio
targetPlatform wpi.platforms.desktop
sources.cpp {
source {
srcDir 'src/main/cpp'
}
exportedHeaders {
srcDir 'src/main/include'
}
}
binaries.all {
lib project: ':common', library: 'curtinFrcCommon', linkage: 'static'
}
useLibrary(it, "wpilib")
wpi.deps.vendor.cpp(it)
}
}
testSuites {
"frcUserProgramTest${project.name}"(GoogleTestTestSuiteSpec) {
testing $.components.get("frcUserProgram${project.name}")
sources.cpp {
source {
srcDir 'src/test/cpp'
include '**/*.cpp'
}
}
binaries.all {
lib project: ':common', library: 'curtinFrcCommon', linkage: 'static'
}
useLibrary(it, "wpilib", "googletest")
wpi.deps.vendor.cpp(it)
}
}
}
task "sim${project.name}"(dependsOn: "simulateFrcUserProgram${project.name}${wpi.platforms.desktop.capitalize()}DebugExecutable")
if (!project.hasProperty('no-common-check'))
tasks.check.dependsOn(':common:check')