forked from wpilibsuite/vscode-wpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (90 loc) · 2.59 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
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
99
100
101
102
103
104
105
106
107
108
109
plugins {
id "edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin" version "2.2" apply false
id "base"
}
def azureRelease = System.getenv('BUILD_SOURCEBRANCH')
if (azureRelease != null) {
println azureRelease
if (azureRelease.startsWith('refs/tags/')) {
project.ext.releaseType = 'OFFICIAL'
println 'tagged build'
}
}
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
configurations {
cppSource
javaSource
}
dependencies {
cppSource 'edu.wpi.first.wpilibc:examples:+:@zip'
javaSource 'edu.wpi.first.wpilibj:examples:+:@zip'
cppSource 'edu.wpi.first.wpilibc:templates:+:@zip'
javaSource 'edu.wpi.first.wpilibj:templates:+:@zip'
cppSource 'edu.wpi.first.wpilibc:commands:+:@zip'
javaSource 'edu.wpi.first.wpilibj:commands:+:@zip'
}
task extractCppDependencies(type: Copy) {
dependsOn configurations.cppSource
from {
configurations.cppSource.collect { it }
configurations.cppSource.collect { zipTree(it) }
}
into 'vscode-wpilib/resources/cpp/src'
}
task extractJavaDependencies(type: Copy) {
dependsOn configurations.javaSource
from {
configurations.javaSource.collect { zipTree(it) }
}
into 'vscode-wpilib/resources/java/src'
}
task copyFromVsCodeToStandaloneResources(type: Copy) {
dependsOn extractCppDependencies
dependsOn extractJavaDependencies
from ('vscode-wpilib/resources/java') {
into 'java'
}
from ('vscode-wpilib/resources/cpp') {
into 'cpp'
}
from ('vscode-wpilib/resources/gradle') {
into 'gradle'
}
from ('vscode-wpilib/resources/eclipseprojectmain.java') {
into '/'
}
into 'wpilib-utility-standalone/resources'
}
task copyFromVsCodeToStandaloneSrc(type: Copy) {
from ('vscode-wpilib/src/riolog/shared') {
into 'riolog/shared'
}
from ('vscode-wpilib/src/shared') {
into 'shared'
}
into 'wpilib-utility-standalone/src'
}
task updateAllDependencies() {
dependsOn copyFromVsCodeToStandaloneResources
dependsOn copyFromVsCodeToStandaloneSrc
}
// Ensure that the WPILibVersioningPlugin is setup by setting the release type, if releaseType wasn't
// already specified on the command line
if (!hasProperty('releaseType')) {
WPILibVersion {
releaseType = 'dev'
}
}
ext.pubVersion = ''
if (project.hasProperty("publishVersion")) {
pubVersion = project.publishVersion
} else {
pubVersion = WPILibVersion.version
}
if (pubVersion == '') {
pubVersion = '0.0.1-unknown'
}
apply from: 'versions.gradle'
wrapper {
gradleVersion = '5.0'
}