-
Notifications
You must be signed in to change notification settings - Fork 78
/
vendordeps.gradle
130 lines (122 loc) · 3.05 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import groovy.json.JsonOutput
Map<String, Object> vendorJson() {
return [
fileName: "PathfinderOLD.json",
name: "PathfinderOld",
version: project.version,
uuid: "7194a2d4-2860-4bcc-86c0-97879737d875",
mavenUrls: [
"https://dev.imjac.in/maven"
],
jsonUrl: "https://dev.imjac.in/maven/jaci/pathfinder/PathfinderOLD-latest.json",
cppDependencies: [
[
groupId: project.group,
artifactId: "Pathfinder-Core",
version: project.version,
libName: "pathfinder",
configuration: "native_pathfinder_old",
headerClassifier: "headers",
sharedLibrary: true,
skipInvalidPlatforms: true,
binaryPlatforms: [
"linuxx86-64",
"windowsx86-64",
"osxx86-64",
"linuxathena",
"linuxraspbian"
]
],
[
groupId: project.group,
artifactId: "Pathfinder-FRCSupport",
version: project.version,
libName: "pathfinder_frc",
configuration: "native_pathfinder_old",
headerClassifier: "headers",
binaryPlatforms: []
]
],
javaDependencies: [
[
groupId: project.group,
artifactId: "Pathfinder-Java",
version: project.version
],
[
groupId: "jaci.jniloader",
artifactId: "JNILoader",
version: "1.0.1"
],
[
groupId: project.group,
artifactId: "Pathfinder-FRCSupport",
version: project.version
]
],
jniDependencies: [
[
groupId: project.group,
artifactId: "Pathfinder-JNI",
version: project.version,
isJar: true,
skipInvalidPlatforms: true,
validPlatforms: [
"linuxx86-64",
"windowsx86-64",
"osxx86-64",
"linuxathena",
"linuxraspbian"
]
],
[
groupId: project.group,
artifactId: "Pathfinder-CoreJNI",
version: project.version,
isJar: true,
skipInvalidPlatforms: true,
validPlatforms: [
"linuxx86-64",
"windowsx86-64",
"osxx86-64",
"linuxathena",
"linuxraspbian"
]
]
]
]
}
String vendorJsonString() {
return JsonOutput.prettyPrint(JsonOutput.toJson(vendorJson()))
}
task generateVendorDepsJson() {
def outfile = new File(buildDir, "PathfinderOLD.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), "jaci/pathfinder/PathfinderOLD-latest.json")
outputs.file(outfile)
doLast {
outfile.text = vendorJsonString()
}
}
tasks.withType(PublishToMavenRepository).all {
dependsOn vendorTask
}
}
}