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

Last change on this file since 36200 was 36194, checked in by taylor.smock, 15 months ago

Fix loading for newer images

  • Remove jackson dependency
  • Remove log4j dependency
  • Remove bundled resty dependency
  • Fix formatting (2 spaces as per CONTRIBUTING.md, not 4 as the rest of JOSM)
  • Update gradle build
  • Fix some lint issues
File size: 4.0 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.49.0")
10 id("net.ltgt.errorprone").version("3.1.0")
11 id("org.kordamp.markdown.convert").version("1.2.0")
12 id("org.sonarqube").version("3.3")
13 id('com.github.spotbugs').version('5.2.3')
14 id('org.openstreetmap.josm').version("0.8.2")
15 id("com.diffplug.spotless").version("6.22.0")
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 mavenCentral()
37 maven {
38 url "https://josm.openstreetmap.de/nexus/content/repositories/releases/"
39 }
40}
41
42def versions = [
43 awaitility: "4.2.0",
44 jmockit: "1.49.a",
45 junit: "5.10.1",
46 wiremock: "2.27.2"
47]
48
49dependencies {
50 if (!JavaVersion.current().isJava9Compatible()) {
51 errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
52 }
53 testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
54 testImplementation("org.junit.jupiter:junit-jupiter-params:${versions.junit}")
55 testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
56 testImplementation("org.junit.vintage:junit-vintage-engine:${versions.junit}")
57 testImplementation ("org.openstreetmap.josm:josm-unittest"){changing=true}
58 testImplementation "com.github.tomakehurst:wiremock:${versions.wiremock}"
59 testImplementation("org.jmockit:jmockit:${versions.jmockit}")
60 testImplementation("org.awaitility:awaitility:${versions.awaitility}")
61}
62
63sourceSets {
64 main {
65 java {
66 srcDirs = ['src']
67 }
68 resources {
69 srcDirs = ["$projectDir"]
70 include 'data/**'
71 include 'images/**'
72 include 'LICENSE'
73 include 'LICENSE_*'
74 }
75 }
76 test {
77 java {
78 srcDirs = ['test/unit']
79 }
80 resources{
81 srcDirs = ['test/data']
82 }
83 }
84}
85
86spotless {
87 enforceCheck = false
88 format("misc") {
89 target("**/*.gradle", "**.*.md", "**/.gitignore")
90
91 trimTrailingWhitespace()
92 indentWithSpaces(2)
93 endWithNewline()
94 }
95 java {
96 trimTrailingWhitespace()
97 indentWithSpaces(2)
98 endWithNewline()
99 removeUnusedImports()
100 }
101}
102
103josm {
104 debugPort = 7051
105}
106
107eclipse {
108 project {
109 name = 'MicrosoftStreetside'
110 comment = josm.manifest.description
111 natures 'org.sonarlint.eclipse.core.sonarlintNature', 'ch.acanda.eclipse.pmd.builder.PMDNature', 'org.eclipse.buildship.core.gradleprojectnature'
112 buildCommand 'org.sonarlint.eclipse.core.sonarlintBuilder'
113 buildCommand 'ch.acanda.eclipse.pmd.builder.PMDBuilder'
114 buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
115 }
116}
117eclipseClasspath.dependsOn cleanEclipseClasspath
118eclipseProject.dependsOn cleanEclipseProject
119tasks.eclipse.dependsOn = ['eclipseClasspath', 'eclipseProject']
120
121tasks.withType(JavaCompile) {
122 // Character encoding of Java files
123 options.encoding = 'UTF-8'
124}
125tasks.withType(Javadoc) {
126 failOnError false
127}
128tasks.withType(SpotBugsTask) {
129 reports {
130 xml.enabled = false
131 html.enabled = true
132 }
133}
134
135import org.gradle.api.tasks.testing.logging.TestLogEvent
136
137test {
138 project.afterEvaluate {
139 jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}")
140 }
141 useJUnitPlatform()
142 testLogging {
143 exceptionFormat "full"
144 events TestLogEvent.FAILED, TestLogEvent.SKIPPED
145 showCauses true
146
147 info {
148 events TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED, TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR
149 showStandardStreams = true
150 }
151 }
152}
Note: See TracBrowser for help on using the repository browser.