Commit b19e79ae authored by Florian Schäfer's avatar Florian Schäfer

Set up continuous integration

Compile and test on both Java 8 and 9, run other checks and then push translations to Transifex
parent 1b500ab5
images:
jdk8: &jdk8_image
- image: circleci/openjdk:8-jdk-node-browsers
jdk9: &jdk9_image
- image: circleci/openjdk:9-jdk-node-browsers
version: 2
jobs:
assemble-java-9:
docker: *jdk9_image
steps:
- checkout
# Main commands
- run: ./gradlew assemble
# Persist build artifacts
- run: mv -fT build /tmp/jdk9-build-artifacts
- persist_to_workspace:
root: /tmp/
paths: jdk9-build-artifacts
test-java-9:
docker: *jdk9_image
steps:
- checkout
# Attach build artifacts
- attach_workspace:
at: /tmp/
- run: mv -fT /tmp/jdk9-build-artifacts build
# Main commands
- run: ./gradlew test
assemble-java-8:
docker: *jdk8_image
steps:
- checkout
- run: sudo apt install -y gettext
# Main commands
- run: ./gradlew assemble generatePot
# Persist build artifacts
- persist_to_workspace:
root: .
paths: build
test-java-8:
docker: *jdk8_image
steps:
- checkout
# Attach build artifacts
- attach_workspace:
at: .
# Main commands
- run: ./gradlew test
# Persist build artifacts
- persist_to_workspace:
root: .
paths:
- .tx
- build
min-josm:
docker: *jdk8_image
steps:
- checkout
# Attach build artifacts
- attach_workspace:
at: .
# Main commands
- run: ./gradlew minJosmVersionClasses
check:
docker: *jdk8_image
steps:
- checkout
# Attach build artifacts
- attach_workspace:
at: .
# Main commands
- run: ./gradlew check
transifex-upload:
docker:
- image: circleci/python:3.6-node-browsers
steps:
- attach_workspace:
at: .
- run: pip install --user git+https://github.com/transifex/transifex-client.git@699dd42e04074be92a07b5b87e8f1ea672a6571f#egg=transifex-client
- run: |
export PATH="$PATH:$HOME/.local/bin" && echo "$PATH"
if [ ! -z "$TRANSIFEX_TOKEN" ]; then
TX_TOKEN="$TRANSIFEX_TOKEN" tx push -s --no-interactive
fi
workflows:
version: 2
build-workflow:
jobs:
- assemble-java-8
- test-java-8:
requires:
- assemble-java-8
- assemble-java-9
- test-java-9:
requires:
- assemble-java-9
- check:
requires:
- test-java-8
- test-java-9
- min-josm:
requires:
- test-java-8
- test-java-9
- transifex-upload:
requires:
- check
- min-josm
filters:
branches:
only: master
[main]
host = https://www.transifex.com
[josm.josm-plugin_wikipedia]
file_filter = poSrc/<lang>.po
source_file = build/i18n/josm-plugin_wikipedia.pot
source_lang = en
type = PO
minimum_perc=50
lang_map = ca@valencia: ca-valencia
......@@ -7,7 +7,7 @@ plugins {
id "com.github.ben-manes.versions" version "0.17.0"
id "com.github.spotbugs" version "1.6.1"
id "net.ltgt.errorprone" version "0.0.13"
id "org.openstreetmap.josm" version "0.4.0"
id "org.openstreetmap.josm" version "0.4.2"
}
def versions = [
errorprone: "2.3.1",
......@@ -17,7 +17,6 @@ def versions = [
]
// Set up ErrorProne
dependencies.errorprone "com.google.errorprone:error_prone_core:${versions.errorprone}"
tasks.withType(JavaCompile) {
options.compilerArgs += [
'-Xep:DefaultCharset:ERROR',
......@@ -78,6 +77,7 @@ repositories {
jcenter()
}
dependencies {
errorprone "com.google.errorprone:error_prone_core:${versions.errorprone}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${versions.junit}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${versions.junit}"
testImplementation "org.junit.vintage:junit-vintage-engine:${versions.junit}"
......@@ -85,6 +85,7 @@ dependencies {
testImplementation("org.openstreetmap.josm:josm-unittest:"){changing=true}
}
archivesBaseName = "wikipedia"
version = getVersion()
josm {
josmCompileVersion = "13600"
......@@ -94,6 +95,9 @@ josm {
oldVersionDownloadLink 12900, "34109", new URL("https://svn.openstreetmap.org/applications/editors/josm/dist/wikipedia.jar?p=34113")
oldVersionDownloadLink 12878, "33635", new URL("https://svn.openstreetmap.org/applications/editors/josm/dist/wikipedia.jar?p=33636")
}
i18n {
pathTransformer = getGithubPathTransformer('JOSM/wikipedia')
}
}
/**
......
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