Commit 0db5b677 authored by Florian Schäfer's avatar Florian Schäfer

Update tool versions, add more compilation linting

parent 23f42a70
......@@ -83,7 +83,7 @@ jobs:
- attach_workspace:
at: .
# Main commands
- run: ./gradlew minJosmVersionClasses
- run: ./gradlew compileJava_minJosm
check:
docker: *jdk8_image
......
......@@ -6,23 +6,24 @@ import java.util.jar.JarInputStream
import java.util.regex.Pattern
import java.util.stream.Collectors
import org.openstreetmap.josm.gradle.plugin.task.GeneratePluginList
import com.github.spotbugs.SpotBugsTask
plugins {
id "java"
id "eclipse"
id "jacoco"
id "pmd"
id "com.github.ben-manes.versions" version "0.17.0"
id "com.github.spotbugs" version "1.6.1"
id "com.github.ben-manes.versions" version "0.20.0"
id "com.github.spotbugs" version "1.6.2"
id "net.ltgt.errorprone" version "0.0.14"
id "org.openstreetmap.josm" version "0.4.8"
id "org.openstreetmap.josm" version "0.5.0"
}
def versions = [
errorprone: "2.3.1",
jacoco: "0.8.1",
junit: "5.2.0",
pmd: "6.3.0",
spotbugs: "3.1.3"
spotbugs: "3.1.5",
]
repositories {
......@@ -39,8 +40,8 @@ dependencies {
testImplementation "com.github.tomakehurst:wiremock:2.18.0"
}
task copyToLib(type: Sync) {
from configurations.packIntoJar
into file("$projectDir/lib")
from(configurations.packIntoJar)
into(file("$projectDir/lib"))
}
classes.dependsOn(copyToLib)
......@@ -64,7 +65,6 @@ tasks.processResources {
}
archivesBaseName = "wikipedia"
version = getVersion()
josm {
manifest {
oldVersionDownloadLink 13597, "v1.0.1", new URL("https://github.com/JOSM/wikipedia/releases/download/v1.0.1/wikipedia.jar")
......@@ -72,23 +72,25 @@ josm {
oldVersionDownloadLink 12878, "33635", new URL("https://svn.openstreetmap.org/applications/editors/josm/dist/wikipedia.jar?p=33636")
}
i18n {
pathTransformer = getGithubPathTransformer('JOSM/wikipedia')
pathTransformer = getPathTransformer("github.com/JOSM/wikipedia/blob")
}
}
// Set up ErrorProne
tasks.withType(JavaCompile) {
options.compilerArgs += [
"-Xep:DefaultCharset:ERROR",
"-Xep:StringEquality:ERROR",
"-Xep:ConstantField:WARN",
"-Xep:LambdaFunctionalInterface:WARN",
"-Xep:MethodCanBeStatic:WARN",
"-Xep:MultiVariableDeclaration:WARN",
"-Xep:PrivateConstructorForUtilityClass:WARN",
"-Xep:RemoveUnusedImports:WARN",
"-Xep:UngroupedOverloads:WARN",
"-Xep:WildcardImport:WARN",
"-Xep:DefaultCharset:ERROR",
"-Xep:StringEquality:ERROR",
"-Xep:ConstantField:WARN",
"-Xep:LambdaFunctionalInterface:WARN",
"-Xep:MethodCanBeStatic:WARN",
"-Xep:MultiVariableDeclaration:WARN",
"-Xep:PrivateConstructorForUtilityClass:WARN",
"-Xep:RemoveUnusedImports:WARN",
"-Xep:UngroupedOverloads:WARN",
"-Xep:WildcardImport:WARN",
"-Xlint:deprecation",
"-Xlint:unchecked",
]
}
......@@ -99,8 +101,8 @@ jacoco {
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.enabled true
xml.enabled = true
html.enabled = true
}
}
check.dependsOn jacocoTestReport
......@@ -120,7 +122,7 @@ spotbugs {
ignoreFailures = true
sourceSets = [sourceSets.main]
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
tasks.withType(SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
......@@ -130,7 +132,7 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) {
task generateMasterPluginList(type: GeneratePluginList) {
dependsOn(tasks.processResources)
outputFile = file("$buildDir/pluginMasterSnapshots")
outputFile = new File(project.buildDir, "pluginMasterSnapshots")
def defaultVersionSuffix = versionSuffix
versionSuffix = {String s ->
if (s.startsWith(archivesBaseName)) {
......
......@@ -18,7 +18,7 @@
<include name="README"/>
<include name="LICENSE*"/>
<include name="*GPL*"/>
<exclude name="*.md"/>
<include name="*.md"/>
</fileset>
</copy>
</target>
......
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=203f4537da8b8075e38c036a6d14cb71b1149de5bf0a8f6db32ac2833a1d1294
\ No newline at end of file
distributionSha256Sum=ce1645ff129d11aad62dab70d63426fdce6cfd646fa309dc5dc5255dd03c7c11
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment