-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvendordeps.gradle
101 lines (93 loc) · 2.34 KB
/
vendordeps.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
import groovy.json.JsonOutput
Map<String, Object> vendorJson() {
return [
fileName: "Pathfinder.json",
name: "Pathfinder",
version: project.version,
uuid: "44237bb3-7675-43ba-894a-302083a37bd8",
mavenUrls: [
"https://dev.imjac.in/maven"
],
jsonUrl: "https://dev.imjac.in/maven/grpl/pathfinder/Pathfinder-latest.json",
cppDependencies: [
[
groupId: project.group,
artifactId: "Pathfinder",
version: project.version,
libName: "Pathfinder",
configuration: "native_pathfinder",
headerClassifier: "headers",
binaryPlatforms: []
],
[
groupId: "grpl.thirdparty.tuxfamily.eigen",
artifactId: "Eigen",
version: project(':libs').eigen_version,
libName: "Eigen",
configuration: "native_pathfinder",
headerClassifier: "headers",
binaryPlatforms: []
]
],
javaDependencies: [
[
groupId: project.group,
artifactId: "Pathfinder-Java",
version: project.version
]
],
jniDependencies: [
[
groupId: project.group,
artifactId: "Pathfinder-JNI",
version: project.version,
isJar: true,
skipInvalidPlatforms: true,
validPlatforms: [
"linuxx86-64",
"windowsx86-64",
"osxx86-64",
"linuxx86",
"windowsx86",
"osxx86",
"linuxathena",
"linuxraspbian"
]
]
]
]
}
String vendorJsonString() {
return JsonOutput.prettyPrint(JsonOutput.toJson(vendorJson()))
}
task generateVendorDepsJson() {
def outfile = new File(buildDir, "Pathfinder.json")
outputs.file(outfile)
doLast {
outfile.text = vendorJsonString()
}
}
publishing {
publications {
vendordeps(MavenPublication) {
artifactId 'Pathfinder-FRCDeps'
artifact(generateVendorDepsJson.outputs.files.files[0]) {
builtBy generateVendorDepsJson
}
}
}
}
afterEvaluate {
publishing.repositories.all {
def vendorTask = task "writeLatestVendorDepsTo${name}"() {
def outfile = new File(new File(url), "grpl/pathfinder/Pathfinder-latest.json")
outputs.file(outfile)
doLast {
outfile.text = vendorJsonString()
}
}
tasks.withType(PublishToMavenRepository).all {
dependsOn vendorTask
}
}
}