Ticket #19998: 19998.streetside_build.7.patch
File 19998.streetside_build.7.patch, 14.5 KB (added by , 4 years ago) |
---|
-
build.gradle
1 import com.github.spotbugs.snom.SpotBugsTask 2 import net.ltgt.gradle.errorprone.CheckSeverity 3 1 4 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 5 id 'java' 9 6 id 'eclipse' 10 7 id 'jacoco' 11 id 'java'12 8 id 'pmd' 9 id("com.github.ben-manes.versions").version("0.38.0") 10 id("net.ltgt.errorprone").version("2.0.1") 11 id("org.kordamp.markdown.convert").version("1.2.0") 12 id("org.sonarqube").version("3.1.1") 13 id('com.github.spotbugs').version('4.7.0') 14 id('org.openstreetmap.josm').version("0.7.1") 15 id("com.diffplug.spotless").version("5.12.1") 13 16 } 14 17 15 18 apply from: 'gradle/tool-config.gradle' … … 34 37 mavenCentral() 35 38 } 36 39 40 def versions = [ 41 awaitility: "4.0.3", 42 jackson: "2.12.3", 43 jmockit: "1.46", 44 junit: "5.7.1", 45 wiremock: "2.27.2" 46 ] 47 37 48 dependencies { 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 implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" 53 implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" 54 implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" 55 implementation "us.monoid.web:resty:0.3.2" 56 implementation "log4j:log4j:1.2.17" 57 testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}") 58 testImplementation("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}") 46 65 } 47 66 48 67 sourceSets { … … 68 87 } 69 88 } 70 89 71 josm { 72 debugPort = 7051 73 manifest { 74 //oldVersionDownloadLink 10824, 'v1.5.3', new URL('https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar') 90 spotless { 91 enforceCheck = false 92 format("misc") { 93 target("**/*.gradle", "**.*.md", "**/.gitignore") 94 95 trimTrailingWhitespace() 96 indentWithSpaces(2) 97 endWithNewline() 75 98 } 76 i18n { 77 pathTransformer = getGithubPathTransformer('spatialdev/MicrosoftStreetside') 99 java { 100 trimTrailingWhitespace() 101 indentWithSpaces(2) 102 endWithNewline() 103 removeUnusedImports() 78 104 } 79 105 } 80 106 107 josm { 108 debugPort = 7051 109 } 110 81 111 eclipse { 82 112 project { 83 113 name = 'MicrosoftStreetside' … … 99 129 tasks.withType(Javadoc) { 100 130 failOnError false 101 131 } 102 tasks.withType( com.github.spotbugs.SpotBugsTask) {132 tasks.withType(SpotBugsTask) { 103 133 reports { 104 134 xml.enabled = false 105 135 html.enabled = true … … 109 139 import org.gradle.api.tasks.testing.logging.TestLogEvent 110 140 111 141 test { 142 project.afterEvaluate { 143 jvmArgs("-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}") 144 } 145 useJUnitPlatform() 112 146 testLogging { 113 147 exceptionFormat "full" 114 148 events TestLogEvent.FAILED, TestLogEvent.SKIPPED -
config/pmd/ruleset.xml
6 6 <description> 7 7 This ruleset checks some rules that you should normally follow for the ms-streetside-josm-plugin. 8 8 </description> 9 <rule ref="rulesets/java/basic.xml"/>10 <rule ref="rulesets/java/braces.xml">11 <exclude name="IfStmtsMustUseBraces"/>12 </rule>13 <rule ref="rulesets/java/clone.xml"/>14 9 15 <rule ref="rulesets/java/controversial.xml/UnnecessaryConstructor"/> 16 <rule ref="rulesets/java/controversial.xml/AssignmentInOperand"/> 17 <rule ref="rulesets/java/controversial.xml/DontImportSun"/> 18 <rule ref="rulesets/java/controversial.xml/SuspiciousOctalEscape"/> 19 <rule ref="rulesets/java/controversial.xml/UnnecessaryParentheses"/> 20 21 <rule ref="rulesets/java/coupling.xml"> 10 <rule ref="category/java/design.xml"> 22 11 <exclude name="LoosePackageCoupling" /> 23 12 <exclude name="LawOfDemeter" /> 24 13 </rule> 25 <rule ref="rulesets/java/design.xml"> 26 <exclude name="AvoidSynchronizedAtMethodLevel" /> 14 <rule ref="category/java/codestyle.xml"> 27 15 <exclude name="ConfusingTernary" /> 16 <exclude name="LocalVariableCouldBeFinal" /> 17 <exclude name="MethodArgumentCouldBeFinal" /> 18 <exclude name="UselessParentheses" /> 19 <exclude name="IfStmtsMustUseBraces"/> 28 20 </rule> 29 <rule ref="rulesets/java/empty.xml"/> 30 <rule ref="rulesets/java/finalizers.xml"/> 31 <rule ref="rulesets/java/imports.xml"/> 32 <rule ref="rulesets/java/naming.xml"> 33 <exclude name="ShortVariable"/> 34 <exclude name="LongVariable"/> 35 <exclude name="AbstractNaming"/> 21 <rule ref="category/java/multithreading.xml"> 22 <exclude name="AvoidSynchronizedAtMethodLevel" /> 36 23 </rule> 37 <rule ref=" rulesets/java/optimizations.xml">38 <exclude name="LocalVariableCouldBeFinal"/>39 <exclude name="MethodArgumentCouldBeFinal" />24 <rule ref="category/java/bestpractices.xml"/> 25 <rule ref="category/java/errorprone.xml"/> 26 <rule ref="category/java/performance.xml"> 40 27 <exclude name="AvoidInstantiatingObjectsInLoops" /> 41 28 </rule> 42 <rule ref="rulesets/java/strictexception.xml"/>43 <rule ref="rulesets/java/strings.xml"/>44 <rule ref="rulesets/java/sunsecure.xml"/>45 <rule ref="rulesets/java/typeresolution.xml"/>46 <rule ref="rulesets/java/unnecessary.xml">47 <exclude name="UselessParentheses" />48 </rule>49 <rule ref="rulesets/java/unusedcode.xml"/>50 29 </ruleset> -
gradle/tool-config.gradle
1 def pmdVersion = " 5.8.0" // TODO: Update to PMD 62 def spotbugsVersion = " 3.1.3"3 def jacocoVersion = "0.8. 1"4 def errorproneVersion = "2.3. 1"1 def pmdVersion = "6.21.0" // TODO: Update to PMD 6 2 def spotbugsVersion = "4.0.3" 3 def jacocoVersion = "0.8.5" 4 def errorproneVersion = "2.3.4" 5 5 6 6 // Set up ErrorProne (currently only for JDK8, until JDK9 is supported) 7 7 dependencies.errorprone "com.google.errorprone:error_prone_core:$errorproneVersion" 8 /* 8 9 tasks.withType(JavaCompile) { 9 10 options.compilerArgs += ['-Xep:DefaultCharset:ERROR', 10 11 '-Xep:ClassCanBeStatic:ERROR', … … 16 17 '-Xep:LambdaFunctionalInterface:WARN', 17 18 '-Xep:ConstantField:WARN'] 18 19 } 20 */ 19 21 20 22 // Spotbugs config 21 23 spotbugs { … … 23 25 ignoreFailures = true 24 26 effort = "max" 25 27 reportLevel = "low" 26 sourceSets = [sourceSets.main, sourceSets.test]28 //sourceSets = [sourceSets.main, sourceSets.test] 27 29 } 28 30 29 31 // JaCoCo config -
gradle/wrapper/gradle-wrapper.properties
Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
1 1 distributionBase=GRADLE_USER_HOME 2 2 distributionPath=wrapper/dists 3 distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip 3 distributionSha256Sum=eb8b89184261025b0430f5b2233701ff1377f96da1ef5e278af6ae8bac5cc305 4 distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip 4 5 zipStoreBase=GRADLE_USER_HOME 5 6 zipStorePath=wrapper/dists -
gradlew
1 1 #!/usr/bin/env sh 2 2 3 # 4 # Copyright 2015 the original author or authors. 5 # 6 # Licensed under the Apache License, Version 2.0 (the "License"); 7 # you may not use this file except in compliance with the License. 8 # You may obtain a copy of the License at 9 # 10 # https://www.apache.org/licenses/LICENSE-2.0 11 # 12 # Unless required by applicable law or agreed to in writing, software 13 # distributed under the License is distributed on an "AS IS" BASIS, 14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 # See the License for the specific language governing permissions and 16 # limitations under the License. 17 # 18 3 19 ############################################################################## 4 20 ## 5 21 ## Gradle start up script for UN*X … … 28 44 APP_BASE_NAME=`basename "$0"` 29 45 30 46 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 DEFAULT_JVM_OPTS= ""47 DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 32 48 33 49 # Use the maximum available, or set MAX_FD != -1 to use that value. 34 50 MAX_FD="maximum" … … 66 82 67 83 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 84 85 69 86 # Determine the Java command to use to start the JVM. 70 87 if [ -n "$JAVA_HOME" ] ; then 71 88 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then … … 109 126 GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 127 fi 111 128 112 # For Cygwin , switch paths to Windows format before running java113 if $cygwin; then129 # For Cygwin or MSYS, switch paths to Windows format before running java 130 if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 114 131 APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 132 CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 116 134 JAVACMD=`cygpath --unix "$JAVACMD"` 117 135 118 136 # We build the pattern for arguments to be converted via cygpath … … 138 156 else 139 157 eval `echo args$i`="\"$arg\"" 140 158 fi 141 i= $((i+1))159 i=`expr $i + 1` 142 160 done 143 161 case $i in 144 (0) set -- ;;145 (1) set -- "$args0" ;;146 (2) set -- "$args0" "$args1" ;;147 (3) set -- "$args0" "$args1" "$args2" ;;148 (4) set -- "$args0" "$args1" "$args2" "$args3" ;;149 (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;150 (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;151 (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;152 (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;153 (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;162 0) set -- ;; 163 1) set -- "$args0" ;; 164 2) set -- "$args0" "$args1" ;; 165 3) set -- "$args0" "$args1" "$args2" ;; 166 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 172 esac 155 173 fi 156 174 … … 159 177 for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 178 echo " " 161 179 } 162 APP_ARGS= $(save "$@")180 APP_ARGS=`save "$@"` 163 181 164 182 # Collect all arguments for the java command, following the shell quoting and substitution rules 165 183 eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 184 167 # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong168 if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then169 cd "$(dirname "$0")"170 fi171 172 185 exec "$JAVACMD" "$@" -
gradlew.bat
1 @rem 2 @rem Copyright 2015 the original author or authors. 3 @rem 4 @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 @rem you may not use this file except in compliance with the License. 6 @rem You may obtain a copy of the License at 7 @rem 8 @rem https://www.apache.org/licenses/LICENSE-2.0 9 @rem 10 @rem Unless required by applicable law or agreed to in writing, software 11 @rem distributed under the License is distributed on an "AS IS" BASIS, 12 @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 @rem See the License for the specific language governing permissions and 14 @rem limitations under the License. 15 @rem 16 1 17 @if "%DEBUG%" == "" @echo off 2 18 @rem ########################################################################## 3 19 @rem … … 13 29 set APP_BASE_NAME=%~n0 14 30 set APP_HOME=%DIRNAME% 15 31 32 @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 16 35 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 set DEFAULT_JVM_OPTS= 36 set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 18 37 19 38 @rem Find java.exe 20 39 if defined JAVA_HOME goto findJavaFromJavaHome … … 65 84 66 85 set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 86 87 68 88 @rem Execute Gradle 69 89 "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 90 -
ivy_settings.xml
1 1 <ivysettings> 2 < version-matchers usedefaults="true">2 <!--<version-matchers usedefaults="true"> 3 3 <maven-tsnap-vm/> 4 </version-matchers> 4 </version-matchers>--> 5 5 <settings defaultResolver="central"/> 6 6 <resolvers> 7 7 <ibiblio name="central" m2compatible="true"/>