-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.savant
195 lines (170 loc) · 7.05 KB
/
build.savant
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*
* Copyright (c) 2014-2024, Inversoft Inc., All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
asmVersion = "9.5.0"
dropWizardVersion = "3.2.6"
easyMockVersion = "5.1.0"
freemarkerVersion = "2.3.32"
fusionAuthJWTVersion = "5.3.2"
javaHTTPVersion = "0.3.5"
jsonPatchVersion = "1.13.0"
guavaVersion = "32.1.2-jre"
guiceVersion = "6.0.0"
jacksonVersion = "2.15.2"
jsoupVersion = "1.16.1"
logbackVersion = "1.4.14"
slf4jVersion = "2.0.13"
testngVersion = "7.8.0"
project(group: "org.primeframework", name: "prime-mvc", version: "4.28.0", licenses: ["ApacheV2_0"]) {
workflow {
fetch {
// Dependency resolution order:
//
// 1. Hit the savant cache
cache()
//
// 2. Look in public savant repo
url(url: "https://repository.savantbuild.org")
//
// 3. No dice, see if we can find it in Maven central
maven()
}
publish {
cache()
}
semanticVersions {
mapping(id: "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava", version: "9999.0.0")
mapping(id: "com.google.guava:guava-parent:26.0-android", version: "26.0.0")
}
}
publishWorkflow {
subversion(repository: "https://svn.savantbuild.org")
}
dependencies {
group(name: "compile") {
dependency(id: "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}")
dependency(id: "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}")
dependency(id: "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
dependency(id: "com.github.java-json-tools:json-patch:${jsonPatchVersion}")
dependency(id: "com.google.code.findbugs:jsr305:3.0.2", skipCompatibilityCheck: true)
dependency(id: "com.google.inject:guice:${guiceVersion}")
dependency(id: "io.dropwizard.metrics:metrics-core:${dropWizardVersion}")
dependency(id: "io.fusionauth:fusionauth-jwt:${fusionAuthJWTVersion}")
dependency(id: "io.fusionauth:java-http:${javaHTTPVersion}")
dependency(id: "jakarta.inject:jakarta.inject-api:2.0.1")
dependency(id: "javax.inject:javax.inject:1.0.0")
dependency(id: "org.freemarker:freemarker:${freemarkerVersion}")
dependency(id: "org.ow2.asm:asm:${asmVersion}")
dependency(id: "org.slf4j:slf4j-api:${slf4jVersion}", skipCompatibilityCheck: true)
}
group(name: "runtime") {
dependency(id: "com.google.guava:guava:${guavaVersion}", skipCompatibilityCheck: true)
}
group(name: "test-compile", export: false) {
dependency(id: "org.easymock:easymock:${easyMockVersion}")
dependency(id: "org.testng:testng:${testngVersion}")
dependency(id: "org.jsoup:jsoup:${jsoupVersion}")
}
group(name: "test-runtime", export: false) {
dependency(id: "ch.qos.logback:logback-classic:${logbackVersion}")
dependency(id: "ch.qos.logback:logback-core:${logbackVersion}")
}
}
publications {
standard()
main {
publication(name: "${project.name}-simulator", type: "jar",
file: "build/jars/${project.name}-simulator-${project.version}.jar",
source: "build/jars/${project.name}-simulator-${project.version}-src.jar"
)
}
}
}
// Plugins
file = loadPlugin(id: "org.savantbuild.plugin:file:2.0.0")
dependency = loadPlugin(id: "org.savantbuild.plugin:dependency:2.0.0")
java = loadPlugin(id: "org.savantbuild.plugin:java:2.0.0")
javaTestNG = loadPlugin(id: "org.savantbuild.plugin:java-testng:2.0.0")
idea = loadPlugin(id: "org.savantbuild.plugin:idea:2.0.0")
pom = loadPlugin(id: "org.savantbuild.plugin:pom:2.0.0")
release = loadPlugin(id: "org.savantbuild.plugin:release-git:2.0.0")
// Plugin settings
java.settings.javaVersion = "17"
javaTestNG.settings.javaVersion = "17"
javaTestNG.settings.jvmArguments = "--add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"
target(name: "clean", description: "Cleans the project") {
java.clean()
}
target(name: "compile", description: "Compiles the project") {
java.compileMain()
// Allow the user of sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl in tests (but not in production code)
java.settings.compilerArguments = "-XDignore.symbol.file --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.util=ALL-UNNAMED"
java.compileTest()
file.copy(to: "build/classes/main") {
fileSet(dir: "src/main/ftl")
}
}
target(name: "jar", description: "JARs the project", dependsOn: ["compile"]) {
java.jar()
// Create a separate test jar that only includes org/primeframework
file.copy(to: "build/classes/simulator") {
fileSet(dir: "build/classes/test", includePatterns: [~/org\/primeframework.+/])
}
// Create a separate test jar that only includes org/primeframework
file.copy(to: "build/src/simulator") {
fileSet(dir: "src/test/java", includePatterns: [~/org\/primeframework.+/])
}
file.jar(file: "build/jars/${project.name}-simulator-${project.version}.jar") {
fileSet(dir: "build/classes/simulator")
}
file.jar(file: "build/jars/${project.name}-simulator-${project.version}-src.jar") {
fileSet(dir: "build/src/simulator")
}
}
target(name: "pom", description: "Updates the pom.xml file") {
updatePOM()
}
target(name: "test", description: "Runs the project's tests", dependsOn: ["jar"]) {
javaTestNG.test()
}
target(name: "doc", description: "Generate the project's JavaDoc", dependsOn: ["jar"]) {
java.document()
}
target(name: "int", description: "Releases a local integration build of the project", dependsOn: ["test"]) {
dependency.integrate()
}
target(name: "list-unused-dependencies", description: "Lists the unused dependencies of the project", dependsOn: ["compile"]) {
dependency.listUnusedDependencies()
}
target(name: "release", description: "Releases a full version of the project", dependsOn: ["test"]) {
release.release()
}
target(name: "idea", description: "Updates the IntelliJ IDEA module file") {
idea.iml()
updatePOM()
}
void updatePOM() {
pom.update()
// Hack. I think we need to update the pom plugin to optionally have a version mapping back to maven.
file.copy(to: ".") {
fileSet(dir: ".", includePatterns: [~/pom.xml/])
// com.github.java-json-tools:json-patch:1.13.0 -> 1.13
filter(token: "<version>1.13.0</version>", value: "<version>1.13</version>")
// org.ow2.asm:asm:9.5.0 --> 9.5
filter(token: "<version>9.5.0</version>", value: "<version>9.5</version>")
// javax.inject:javax.inject:1.0.0 -> 1
filter(token: "<version>1.0.0</version>", value: "<version>1</version>")
}
}