-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (57 loc) · 1.81 KB
/
build.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
plugins {
id "edu.wpi.first.GradleRIO" version "2019.0.0-alpha-2" apply false
}
// Only clean our code, don't clean googletest
task subclean();
subprojects {
plugins.withType(CppPlugin).whenPluginAdded {
project.apply plugin: "visual-studio"
rootProject.tasks.subclean.dependsOn tasks.clean
}
plugins.withType(GoogleTestPlugin).whenPluginAdded {
model {
binaries {
withType(GoogleTestTestSuiteBinarySpec) {
if (targetPlatform.name == 'roborio') buildable = false; // Don't test on a platform we can't run
else {
lib project: ":", library: "googleTest", linkage: "static"
}
}
all {
if (toolChain instanceof VisualCpp) {
cppCompiler.args << "/FS"
} else {
linker.args << "-pthread"
}
}
}
}
}
}
apply plugin: "edu.wpi.first.GradleRIO"
apply plugin: "cpp"
model {
components {
// G Test is build along with the project, but you could easily use your own prebuilt libraries.
googleTest(NativeLibrarySpec) {
targetPlatform 'desktop'
sources.cpp {
source {
srcDir 'googletest/googletest/src'
include '**/gtest-all.cc'
}
exportedHeaders {
srcDirs 'googletest/googletest', 'googletest/googletest/include'
include '**/*.hpp', '**/*.h'
}
}
}
}
}
task visualStudio() {
dependsOn ':robot:frcUserProgramVisualStudio'
dependsOn ':subsystems:subsystemsVisualStudio'
}
wrapper {
gradleVersion = '4.8.1'
}