-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
116 lines (96 loc) · 3.03 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
110
111
112
113
114
115
116
plugins {
id "org.openstreetmap.josm" version "$gradle_josm_plugin_version"
id 'java'
id 'groovy'
}
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
dependencies {
compileOnly "org.projectlombok:lombok:${lombok_version}"
annotationProcessor "org.projectlombok:lombok:${lombok_version}"
packIntoJar "org.apache.commons:commons-lang3:3.17.0"
implementation "javax.validation:validation-api:2.0.1.Final"
testImplementation "org.junit.jupiter:junit-jupiter-api:${jupiter_version}"
testImplementation "org.apache.groovy:groovy-all:${groovy_version}"
testImplementation "org.apache.groovy:groovy-test:${groovy_version}"
testImplementation "org.hamcrest:hamcrest-library:3.0"
testImplementation('org.openstreetmap.josm:josm-unittest:latest'){
changing=true
}
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${jupiter_version}"
}
base {
archivesName = "contourmerge"
}
import org.openstreetmap.josm.plugins.contourmerge.build.Releases
def releases = Releases.fromFile(file("releases.yml"))
version=releases.currentPluginLabel
def deriveJosmCompileVersion(releases) {
final value = project.hasProperty("plugin.josmCompileVersion")
? project.property("plugin.josmCompileVersion")
: null
def josmCompileVersion
//noinspection GroovyFallthrough
switch (value) {
case null:
josmCompileVersion = "latest"
break
case "latest":
case "tested":
josmCompileVersion = value
break
case "release":
josmCompileVersion = releases.getLastCompatibleJosmVersion()
break
default:
josmCompileVersion = value.isInteger() ? value as Integer : "latest"
}
return josmCompileVersion
}
def configuredJosmCompileVersion = deriveJosmCompileVersion(releases)
logger.info("Compiling for JOSM ${configuredJosmCompileVersion}")
josm {
josmCompileVersion = configuredJosmCompileVersion
manifest {
minJavaVersion = 17
includeLinksToGithubReleases = true
minJosmVersion = releases.highestJosmVersion
}
github {
repositoryName = "josm-contourmerge-plugin"
repositoryOwner = "gubaer"
targetCommitish = "master"
}
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-Werror"
}
test {
useJUnitPlatform()
scanForTestClasses = false
systemProperty "josm.home", file("src/test/resources/josm.home").absolutePath
afterTest { desc, result ->
println "Executing test ${desc.name} [${desc.className}] with " +
"result: ${result.resultType}"
}
}
sourceSets {
main.resources {
exclude "images/**/*.svg"
}
}
processResources {
from("$projectDir/README.md")
from("$projectDir/LICENSE")
}
publishToGithubRelease {
remoteJarName = "contourmerge.jar"
}