1 | plugins {
|
---|
2 | id "org.sonarqube" version "2.6.2"
|
---|
3 | id "org.kordamp.markdown.convert" version "1.1.0"
|
---|
4 | id 'org.openstreetmap.josm' version "0.4.4"
|
---|
5 | id "com.github.ben-manes.versions" version "0.17.0"
|
---|
6 | id 'com.github.spotbugs' version '1.6.1'
|
---|
7 | id "net.ltgt.errorprone" version "0.0.14"
|
---|
8 |
|
---|
9 | id 'eclipse'
|
---|
10 | id 'jacoco'
|
---|
11 | id 'java'
|
---|
12 | id 'pmd'
|
---|
13 | }
|
---|
14 |
|
---|
15 | apply from: 'gradle/tool-config.gradle'
|
---|
16 | //apply from: 'gradle/markdown.gradle'
|
---|
17 |
|
---|
18 | sourceCompatibility = '1.8'
|
---|
19 |
|
---|
20 | def versionProcess = new ProcessBuilder("git", "describe", "--always", "--dirty").start()
|
---|
21 | versionProcess.waitFor()
|
---|
22 | if (versionProcess.exitValue() != 0) {
|
---|
23 | logger.error("Could not determine the current version of this JOSM plugin!")
|
---|
24 | version = "‹unknown›"
|
---|
25 | } else {
|
---|
26 | version = versionProcess.in.text.trim()
|
---|
27 | }
|
---|
28 | archivesBaseName = 'MicrosoftStreetside'
|
---|
29 |
|
---|
30 | repositories {
|
---|
31 | jcenter()
|
---|
32 | mavenCentral()
|
---|
33 | }
|
---|
34 |
|
---|
35 | dependencies {
|
---|
36 | compile 'com.fasterxml.jackson.core:jackson-core:2.2.4'
|
---|
37 | compile 'com.fasterxml.jackson.core:jackson-databind:2.2.4'
|
---|
38 | compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.4'
|
---|
39 | compile 'us.monoid.web:resty:0.3.2'
|
---|
40 | compile 'log4j:log4j:1.2.17'
|
---|
41 | testImplementation ('org.openstreetmap.josm:josm-unittest'){changing=true}
|
---|
42 | testImplementation 'com.github.tomakehurst:wiremock:2.17.0'
|
---|
43 | testImplementation 'junit:junit:4.12'
|
---|
44 | }
|
---|
45 |
|
---|
46 | sourceSets {
|
---|
47 | main {
|
---|
48 | java {
|
---|
49 | srcDirs = ['src']
|
---|
50 | }
|
---|
51 | resources {
|
---|
52 | srcDirs = ["$projectDir"]
|
---|
53 | include 'data/**'
|
---|
54 | include 'images/**'
|
---|
55 | include 'LICENSE'
|
---|
56 | include 'LICENSE_*'
|
---|
57 | }
|
---|
58 | }
|
---|
59 | test {
|
---|
60 | java {
|
---|
61 | srcDirs = ['test/unit']
|
---|
62 | }
|
---|
63 | resources{
|
---|
64 | srcDirs = ['test/data']
|
---|
65 | }
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 | josm {
|
---|
70 | debugPort = 7051
|
---|
71 | manifest {
|
---|
72 | //oldVersionDownloadLink 10824, 'v1.5.3', new URL('https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar')
|
---|
73 | }
|
---|
74 | i18n {
|
---|
75 | pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
|
---|
76 | }
|
---|
77 | }
|
---|
78 |
|
---|
79 | eclipse {
|
---|
80 | project {
|
---|
81 | name = 'MicrosoftStreetside'
|
---|
82 | comment = josm.manifest.description
|
---|
83 | natures 'org.sonarlint.eclipse.core.sonarlintNature', 'ch.acanda.eclipse.pmd.builder.PMDNature', 'org.eclipse.buildship.core.gradleprojectnature'
|
---|
84 | buildCommand 'org.sonarlint.eclipse.core.sonarlintBuilder'
|
---|
85 | buildCommand 'ch.acanda.eclipse.pmd.builder.PMDBuilder'
|
---|
86 | buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
|
---|
87 | }
|
---|
88 | }
|
---|
89 | eclipseClasspath.dependsOn cleanEclipseClasspath
|
---|
90 | eclipseProject.dependsOn cleanEclipseProject
|
---|
91 | tasks.eclipse.dependsOn = ['eclipseClasspath', 'eclipseProject']
|
---|
92 |
|
---|
93 | tasks.withType(JavaCompile) {
|
---|
94 | // Character encoding of Java files
|
---|
95 | options.encoding = 'UTF-8'
|
---|
96 | }
|
---|
97 | tasks.withType(Javadoc) {
|
---|
98 | failOnError false
|
---|
99 | }
|
---|
100 | tasks.withType(com.github.spotbugs.SpotBugsTask) {
|
---|
101 | reports {
|
---|
102 | xml.enabled = false
|
---|
103 | html.enabled = true
|
---|
104 | }
|
---|
105 | }
|
---|
106 |
|
---|
107 | import org.gradle.api.tasks.testing.logging.TestLogEvent
|
---|
108 |
|
---|
109 | test {
|
---|
110 | testLogging {
|
---|
111 | exceptionFormat "full"
|
---|
112 | events TestLogEvent.FAILED, TestLogEvent.SKIPPED
|
---|
113 | showCauses true
|
---|
114 |
|
---|
115 | info {
|
---|
116 | events TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED, TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR
|
---|
117 | showStandardStreams = true
|
---|
118 | }
|
---|
119 | }
|
---|
120 | }
|
---|