source: osm/applications/editors/josm/plugins/MicrosoftStreetside/build.gradle@ 35988

Last change on this file since 35988 was 35779, checked in by Don-vip, 4 years ago

fix #19998 - update Streetside dependencies (patch by taylor.smock, modified)

File size: 4.3 KB
Line 
1import com.github.spotbugs.snom.SpotBugsTask
2import net.ltgt.gradle.errorprone.CheckSeverity
3
4plugins {
5 id 'java'
6 id 'eclipse'
7 id 'jacoco'
8 id 'pmd'
9 id("com.github.ben-manes.versions").version("0.39.0")
10 id("net.ltgt.errorprone").version("2.0.2")
11 id("org.kordamp.markdown.convert").version("1.2.0")
12 id("org.sonarqube").version("3.3")
13 id('com.github.spotbugs').version('4.7.2')
14 id('org.openstreetmap.josm').version("0.7.1")
15 id("com.diffplug.spotless").version("5.14.1")
16}
17
18apply from: 'gradle/tool-config.gradle'
19// TODO: repair Mapillary markdown task
20// error with subdir build/markdown
21//apply from: 'gradle/markdown.gradle'
22
23sourceCompatibility = '1.8'
24
25def versionProcess = new ProcessBuilder("git", "describe", "--always", "--dirty").start()
26versionProcess.waitFor()
27if (versionProcess.exitValue() != 0) {
28 logger.error("Could not determine the current version of this JOSM plugin!")
29 version = "‹unknown›"
30} else {
31 version = versionProcess.in.text.trim()
32}
33archivesBaseName = 'MicrosoftStreetside'
34
35repositories {
36 jcenter()
37 mavenCentral()
38 maven {
39 url "https://josm.openstreetmap.de/nexus/content/repositories/releases/"
40 }
41}
42
43def versions = [
44 awaitility: "4.1.0",
45 jackson: "2.12.4",
46 jmockit: "1.49.a",
47 junit: "5.7.1",
48 wiremock: "2.27.2"
49]
50
51dependencies {
52 if (!JavaVersion.current().isJava9Compatible()) {
53 errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
54 }
55 implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
56 implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
57 implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
58 implementation "us.monoid.web:resty:0.3.2"
59 implementation "log4j:log4j:1.2.17"
60 testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
61 testImplementation("org.junit.jupiter:junit-jupiter-params:${versions.junit}")
62 testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
63 testImplementation("org.junit.vintage:junit-vintage-engine:${versions.junit}")
64 testImplementation ("org.openstreetmap.josm:josm-unittest"){changing=true}
65 testImplementation "com.github.tomakehurst:wiremock:${versions.wiremock}"
66 testImplementation("org.jmockit:jmockit:${versions.jmockit}")
67 testImplementation("org.awaitility:awaitility:${versions.awaitility}")
68}
69
70sourceSets {
71 main {
72 java {
73 srcDirs = ['src']
74 }
75 resources {
76 srcDirs = ["$projectDir"]
77 include 'data/**'
78 include 'images/**'
79 include 'LICENSE'
80 include 'LICENSE_*'
81 }
82 }
83 test {
84 java {
85 srcDirs = ['test/unit']
86 }
87 resources{
88 srcDirs = ['test/data']
89 }
90 }
91}
92
93spotless {
94 enforceCheck = false
95 format("misc") {
96 target("**/*.gradle", "**.*.md", "**/.gitignore")
97
98 trimTrailingWhitespace()
99 indentWithSpaces(2)
100 endWithNewline()
101 }
102 java {
103 trimTrailingWhitespace()
104 indentWithSpaces(2)
105 endWithNewline()
106 removeUnusedImports()
107 }
108}
109
110josm {
111 debugPort = 7051
112}
113
114eclipse {
115 project {
116 name = 'MicrosoftStreetside'
117 comment = josm.manifest.description
118 natures 'org.sonarlint.eclipse.core.sonarlintNature', 'ch.acanda.eclipse.pmd.builder.PMDNature', 'org.eclipse.buildship.core.gradleprojectnature'
119 buildCommand 'org.sonarlint.eclipse.core.sonarlintBuilder'
120 buildCommand 'ch.acanda.eclipse.pmd.builder.PMDBuilder'
121 buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
122 }
123}
124eclipseClasspath.dependsOn cleanEclipseClasspath
125eclipseProject.dependsOn cleanEclipseProject
126tasks.eclipse.dependsOn = ['eclipseClasspath', 'eclipseProject']
127
128tasks.withType(JavaCompile) {
129 // Character encoding of Java files
130 options.encoding = 'UTF-8'
131}
132tasks.withType(Javadoc) {
133 failOnError false
134}
135tasks.withType(SpotBugsTask) {
136 reports {
137 xml.enabled = false
138 html.enabled = true
139 }
140}
141
142import org.gradle.api.tasks.testing.logging.TestLogEvent
143
144test {
145 project.afterEvaluate {
146 jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}")
147 }
148 useJUnitPlatform()
149 testLogging {
150 exceptionFormat "full"
151 events TestLogEvent.FAILED, TestLogEvent.SKIPPED
152 showCauses true
153
154 info {
155 events TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED, TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR
156 showStandardStreams = true
157 }
158 }
159}
Note: See TracBrowser for help on using the repository browser.