Ticket #19208: 19208.streetside_build.patch

File 19208.streetside_build.patch, 6.7 KB (added by taylor.smock, 6 years ago)

Get StreetSide compiling again. Adds spotless (not run) that enforces the formatting rules stated in CONTRIBUTING.md, various items are commented out to get the build working, gradle dependency updates (note: gradle 4.7 -> 6.4). ant clean dist and ./gradlew clean build both work now (Java 11 and older -- Java 14 has some issues). Some tests fail. ant test does not work.

  • build.gradle

     
     1import com.github.spotbugs.snom.SpotBugsTask
     2import net.ltgt.gradle.errorprone.CheckSeverity
     3
    14plugins {
    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 
     5  id 'java'
    96  id 'eclipse'
    107  id 'jacoco'
    11   id 'java'
    128  id 'pmd'
     9  id("com.github.ben-manes.versions").version("0.28.0")
     10  id("net.ltgt.errorprone").version("1.1.1")
     11  id("org.kordamp.markdown.convert").version("1.2.0")
     12  id("org.sonarqube").version("2.8")
     13  id('com.github.spotbugs').version('4.0.3')
     14  id('org.openstreetmap.josm').version("0.7.0")
     15  id("com.diffplug.gradle.spotless").version("4.0.1")
    1316}
    1417
    1518apply from: 'gradle/tool-config.gradle'
     
    2326versionProcess.waitFor()
    2427if (versionProcess.exitValue() != 0) {
    2528  logger.error("Could not determine the current version of this JOSM plugin!")
    26   version = "‹unknown›"
     29  version = "<Unknown>"
    2730} else {
    2831  version = versionProcess.in.text.trim()
    2932}
     
    3538}
    3639
    3740dependencies {
    38   compile 'com.fasterxml.jackson.core:jackson-core:2.2.4'
    39   compile 'com.fasterxml.jackson.core:jackson-databind:2.2.4'
    40   compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.4'
     41  if (!JavaVersion.current().isJava9Compatible()) {
     42    errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
     43  }
     44  compile 'com.fasterxml.jackson.core:jackson-core:2.11.0'
     45  compile 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
     46  compile 'com.fasterxml.jackson.core:jackson-annotations:2.11.0'
    4147  compile 'us.monoid.web:resty:0.3.2'
    4248  compile 'log4j:log4j:1.2.17'
    4349  testImplementation ('org.openstreetmap.josm:josm-unittest'){changing=true}
    44   testImplementation 'com.github.tomakehurst:wiremock:2.17.0'
    45   testImplementation 'junit:junit:4.12'
     50  testImplementation 'com.github.tomakehurst:wiremock:2.26.3'
     51  testImplementation 'junit:junit:4.13'
     52  testImplementation("org.jmockit:jmockit:1.46") { because("versions >= 1.47 are incompatible with JOSM, see https://josm.openstreetmap.de/ticket/18200") }
     53  testImplementation("org.awaitility:awaitility:4.0.2")
    4654}
    4755
    4856sourceSets {
     
    6876  }
    6977}
    7078
     79spotless {
     80  format("misc") {
     81    target("**/*.gradle", "**.*.md", "**/.gitignore")
     82
     83    trimTrailingWhitespace()
     84    indentWithSpaces(2)
     85    endWithNewline()
     86  }
     87  java {
     88    trimTrailingWhitespace()
     89    indentWithSpaces(2)
     90    endWithNewline()
     91    removeUnusedImports()
     92  }
     93}
     94
    7195josm {
    7296  debugPort = 7051
    7397  manifest {
    7498      //oldVersionDownloadLink 10824, 'v1.5.3', new URL('https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar')
    7599  }
    76   i18n {
    77     pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
    78   }
     100  //i18n {
     101   // pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
     102  //}
    79103}
    80104
    81105eclipse {
     
    99123tasks.withType(Javadoc) {
    100124  failOnError false
    101125}
    102 tasks.withType(com.github.spotbugs.SpotBugsTask) {
     126tasks.withType(SpotBugsTask) {
    103127  reports {
    104128    xml.enabled = false
    105129    html.enabled = true
     
    109133import org.gradle.api.tasks.testing.logging.TestLogEvent
    110134
    111135test {
     136  project.afterEvaluate {
     137    jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}")
     138  }
    112139  testLogging {
    113140    exceptionFormat "full"
    114141    events TestLogEvent.FAILED, TestLogEvent.SKIPPED
  • gradle/tool-config.gradle

     
    1 def pmdVersion = "5.8.0" // TODO: Update to PMD 6
    2 def spotbugsVersion = "3.1.3"
    3 def jacocoVersion = "0.8.1"
    4 def errorproneVersion = "2.3.1"
     1def pmdVersion = "6.21.0" // TODO: Update to PMD 6
     2def spotbugsVersion = "4.0.3"
     3def jacocoVersion = "0.8.5"
     4def errorproneVersion = "2.3.4"
    55
    66// Set up ErrorProne (currently only for JDK8, until JDK9 is supported)
    77dependencies.errorprone "com.google.errorprone:error_prone_core:$errorproneVersion"
     8/*
    89tasks.withType(JavaCompile) {
    910options.compilerArgs += ['-Xep:DefaultCharset:ERROR',
    1011  '-Xep:ClassCanBeStatic:ERROR',
     
    1617  '-Xep:LambdaFunctionalInterface:WARN',
    1718  '-Xep:ConstantField:WARN']
    1819}
     20*/
    1921
    2022// Spotbugs config
    2123spotbugs {
     
    2325  ignoreFailures = true
    2426  effort = "max"
    2527  reportLevel = "low"
    26   sourceSets = [sourceSets.main, sourceSets.test]
     28  //sourceSets = [sourceSets.main, sourceSets.test]
    2729}
    2830
    2931// JaCoCo config
  • gradle/wrapper/gradle-wrapper.properties

     
    11distributionBase=GRADLE_USER_HOME
    22distributionPath=wrapper/dists
    3 distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
     3distributionSha256Sum=e58cdff0cee6d9b422dcd08ebeb3177bc44eaa09bd9a2e838ff74c408fe1cbcd
     4distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
    45zipStoreBase=GRADLE_USER_HOME
    56zipStorePath=wrapper/dists
  • gradle.properties

     
    77
    88# Minimum required JOSM version to run this plugin, choose the lowest version possible that is compatible.
    99# You can check if the plugin compiles against this version by executing `./gradlew minJosmVersionClasses`.
    10 plugin.main.version=14460
     10plugin.main.version=16402
    1111#plugin.version=
    1212# Version of JOSM against which the plugin is compiled
    1313# Please check, if the specified version is available for download from https://josm.openstreetmap.de/download/ .
    1414# If not, choose the next higher number that is available, or the gradle build will break.
    15 plugin.compile.version=14460
     15plugin.compile.version=16402
    1616plugin.requires=apache-commons;apache-http;utilsplugin2;javafx
    1717
    1818# Character encoding of Gradle files
  • ivy_settings.xml

     
    11<ivysettings>
    2     <version-matchers usedefaults="true">
     2    <!--<version-matchers usedefaults="true">
    33        <maven-tsnap-vm/>
    4     </version-matchers>
     4    </version-matchers>-->
    55    <settings defaultResolver="central"/>
    66    <resolvers>
    77        <ibiblio name="central" m2compatible="true"/>