Ticket #19998: 19208.streetside_build.2.patch

File 19208.streetside_build.2.patch, 6.4 KB (added by taylor.smock, 5 years ago)

Update patch for changes, now with working tests (ant test/./gradlew test). Fails with ./gradlew build due to non-conformant code. Code can be made conformant with ./gradlew spotlessApply or the spotless plugin can be removed (since the coding style wasn't always followed).

  • 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}
     
    3437  mavenCentral()
    3538}
    3639
     40def versions = [
     41  awaitility: "4.0.3",
     42  jackson: "2.11.0",
     43  jmockit: "1.46",
     44  junit: "5.7.0",
     45  wiremock: "2.27.1"
     46]
     47
    3748dependencies {
    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   compile 'us.monoid.web:resty:0.3.2'
    42   compile 'log4j:log4j:1.2.17'
    43   testImplementation ('org.openstreetmap.josm:josm-unittest'){changing=true}
    44   testImplementation 'com.github.tomakehurst:wiremock:2.17.0'
    45   testImplementation 'junit:junit:4.12'
     49  if (!JavaVersion.current().isJava9Compatible()) {
     50    errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
     51  }
     52  compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
     53  compile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
     54  compile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
     55  compile "us.monoid.web:resty:0.3.2"
     56  compile "log4j:log4j:1.2.17"
     57  testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
     58  testCompile("org.junit.jupiter:junit-jupiter-params:${versions.junit}")
     59  testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
     60  testImplementation("org.junit.vintage:junit-vintage-engine:${versions.junit}")
     61  testImplementation ("org.openstreetmap.josm:josm-unittest"){changing=true}
     62  testImplementation "com.github.tomakehurst:wiremock:${versions.wiremock}"
     63  testImplementation("org.jmockit:jmockit:${versions.jmockit}") { because("versions >= 1.47 are incompatible with JOSM, see https://josm.openstreetmap.de/ticket/18200") }
     64  testImplementation("org.awaitility:awaitility:${versions.awaitility}")
    4665}
    4766
    4867sourceSets {
     
    6887  }
    6988}
    7089
     90spotless {
     91  format("misc") {
     92    target("**/*.gradle", "**.*.md", "**/.gitignore")
     93
     94    trimTrailingWhitespace()
     95    indentWithSpaces(2)
     96    endWithNewline()
     97  }
     98  java {
     99    trimTrailingWhitespace()
     100    indentWithSpaces(2)
     101    endWithNewline()
     102    removeUnusedImports()
     103  }
     104}
     105
    71106josm {
    72107  debugPort = 7051
    73108  manifest {
    74109      //oldVersionDownloadLink 10824, 'v1.5.3', new URL('https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar')
    75110  }
    76   i18n {
    77     pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
    78   }
     111  //i18n {
     112   // pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside')
     113  //}
    79114}
    80115
    81116eclipse {
     
    99134tasks.withType(Javadoc) {
    100135  failOnError false
    101136}
    102 tasks.withType(com.github.spotbugs.SpotBugsTask) {
     137tasks.withType(SpotBugsTask) {
    103138  reports {
    104139    xml.enabled = false
    105140    html.enabled = true
     
    109144import org.gradle.api.tasks.testing.logging.TestLogEvent
    110145
    111146test {
     147  project.afterEvaluate {
     148    jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}")
     149  }
     150  useJUnitPlatform()
    112151  testLogging {
    113152    exceptionFormat "full"
    114153    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
  • 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"/>