Skip to content

Commit

Permalink
Drop buildSrc/ directory, use gradle-josm-plugin 0.5.3 that provide…
Browse files Browse the repository at this point in the history
…s Markdown conversion task

Also updated errorprone version and CI now builds on Java 11 & 12.
  • Loading branch information
floscher committed Oct 13, 2018
1 parent bd00439 commit 34e0ca2
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 96 deletions.
34 changes: 34 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ assemble with java 10:
paths:
- build/

assemble with java 11:
stage: build
image: registry.gitlab.com/josm/docker-library/openjdk-11-josmplugin:latest
script:
- ./gradlew assemble --stacktrace
artifacts:
paths:
- build/

assemble with java 12:
stage: build
image: registry.gitlab.com/josm/docker-library/openjdk-12-josmplugin:latest
script:
- ./gradlew assemble --stacktrace
artifacts:
paths:
- build/


##############
# Test stage #
Expand Down Expand Up @@ -58,6 +76,22 @@ build with java 10:
dependencies:
- assemble with java 10

build with java 11:
stage: test
image: registry.gitlab.com/josm/docker-library/openjdk-11-josmplugin:latest
script:
- ./gradlew build --stacktrace
dependencies:
- assemble with java 11

build with java 12:
stage: test
image: registry.gitlab.com/josm/docker-library/openjdk-12-josmplugin:latest
script:
- ./gradlew build --stacktrace
dependencies:
- assemble with java 12


################
# Deploy stage #
Expand Down
18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.openstreetmap.josm.gradle.plugin.config.I18nConfig
import org.openstreetmap.josm.gradle.plugin.config.JosmManifest
import org.openstreetmap.josm.plugins.mapillary.build.ConvertMarkdown
import org.openstreetmap.josm.gradle.plugin.task.MarkdownToHtml
import java.net.URL

plugins {
id("org.sonarqube") version "2.6.2"
id("org.openstreetmap.josm") version "0.5.1"
id("org.openstreetmap.josm") version "0.5.3"
id("com.github.ben-manes.versions") version "0.20.0"
id("com.github.spotbugs") version "1.6.4"
id("net.ltgt.errorprone") version "0.6"
Expand All @@ -27,12 +27,12 @@ repositories {

// Set up ErrorProne
dependencies {
errorprone("com.google.errorprone:error_prone_core:2.3.1")
errorprone("com.google.errorprone:error_prone_core:2.3.2")
if (!JavaVersion.current().isJava9Compatible) {
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
}
}
tasks.withType<JavaCompile>().configureEach {
tasks.withType(JavaCompile::class).configureEach {
options.compilerArgs.addAll(listOf("-Xlint:all", "-Xlint:-serial"))
options.errorprone {
check("ClassCanBeStatic", CheckSeverity.ERROR)
Expand Down Expand Up @@ -83,16 +83,16 @@ tasks {
}
}

tasks.create("md2html", ConvertMarkdown::class) {
srcDir = projectDir
tasks.create("md2html", MarkdownToHtml::class) {
destDir = File(buildDir, "md2html")
includes = arrayOf("README.md", "LICENSE.md")
source(projectDir)
include("README.md", "LICENSE.md")
tasks.withType(ProcessResources::class)["processResources"].from(this)
}

josm {
debugPort = 7051
manifest.closureOf<JosmManifest> {
manifest {
// See https://floscher.github.io/gradle-josm-plugin/kdoc/current/gradle-josm-plugin/org.openstreetmap.josm.gradle.plugin.config/-josm-manifest/old-version-download-link.html
oldVersionDownloadLink(13733, "v1.5.15", URL("https://github.com/JOSM/Mapillary/releases/download/v1.5.15/Mapillary.jar"))
oldVersionDownloadLink(13643, "v1.5.14", URL("https://github.com/JOSM/Mapillary/releases/download/v1.5.14/Mapillary.jar"))
Expand All @@ -102,7 +102,7 @@ josm {
oldVersionDownloadLink(12128, "v1.5.5", URL("https://github.com/JOSM/Mapillary/releases/download/v1.5.5/Mapillary.jar"))
oldVersionDownloadLink(10824, "v1.5.3", URL("https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar"))
}
i18n.closureOf<I18nConfig> {
i18n {
pathTransformer = getPathTransformer("gitlab.com/JOSM/Mapillary/blob")
}
}
Expand Down
2 changes: 0 additions & 2 deletions buildSrc/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions buildSrc/build.gradle.kts

This file was deleted.

52 changes: 0 additions & 52 deletions buildSrc/src/main/kotlin/ConvertMarkdown.kt

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugin.main.version=14149
# Version of JOSM against which the plugin is compiled
# Please check, if the specified version is available for download from https://josm.openstreetmap.de/download/ .
# If not, choose the next higher number that is available, or the gradle build will break.
plugin.compile.version=14178
plugin.compile.version=14289
plugin.requires=apache-commons;apache-http

# Character encoding of Gradle files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void remove(MapillaryAbstractImage image) {
}

private void setUser(String userKey) {
(new Thread(() -> {
new Thread(() -> {
UserProfile cachedProfile = Caches.UserProfileCache.getInstance().get(userKey);
if (cachedProfile == null) {
try {
Expand All @@ -190,6 +190,6 @@ private void setUser(String userKey) {
}

this.user = Caches.UserProfileCache.getInstance().get(userKey);
}, "userProfileDownload_" + userKey)).start();
}, "userProfileDownload_" + userKey).start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@ public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
if (!(obj instanceof KeyIndexedObject)) {
return false;
}
KeyIndexedObject other = (KeyIndexedObject) obj;
if (!key.equals(other.key)) {
return false;
}
return true;
return key.equals(other.key);
}

}

0 comments on commit 34e0ca2

Please sign in to comment.