From e411535f52489a7d151312471b0f86f5c680f1de Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 6 Jul 2022 15:03:41 -0600 Subject: [PATCH 1/4] Avoid unnecessary allocations from Node#getCoor calls Signed-off-by: Taylor Smock --- .../java/org/wikipedia/actions/WikipediaCopyTemplate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/wikipedia/actions/WikipediaCopyTemplate.java b/src/main/java/org/wikipedia/actions/WikipediaCopyTemplate.java index d6e2b139..e052df9f 100644 --- a/src/main/java/org/wikipedia/actions/WikipediaCopyTemplate.java +++ b/src/main/java/org/wikipedia/actions/WikipediaCopyTemplate.java @@ -84,8 +84,8 @@ public void actionPerformed(ActionEvent e) { return; } ClipboardUtils.copyString(pattern - .replace("{lat}", Double.toString(node.getCoor().lat())) - .replace("{lon}", Double.toString(node.getCoor().lon()))); + .replace("{lat}", Double.toString(node.lat())) + .replace("{lon}", Double.toString(node.lon()))); } @Override From 24d7081a1d37cb505ecb586b1eb4ef843667614e Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Tue, 26 Apr 2022 13:39:25 -0600 Subject: [PATCH 2/4] Initial build action Signed-off-by: Taylor Smock --- .github/workflows/ant.yml | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ant.yml diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml new file mode 100644 index 00000000..5410fed9 --- /dev/null +++ b/.github/workflows/ant.yml @@ -0,0 +1,56 @@ +name: Java CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + - name: Cache + uses: actions/cache@v2.0.0 + with: + path: | + ~/.ivy2/cache/ + $GITHUB_WORKSPACE/josm/core/tools/ + key: ${{ runner.os }}-ivy2-${{ hashFiles('josm/plugins/${{ github.event.repository.name }}/build.xml', 'josm/plugins/00_core_tools/ivy.xml', 'josm/core/ivy.xml', 'josm/core/tools/ivy.xml') }} + - name: Clone JOSM + run: | + svn co --depth=immediates https://josm.openstreetmap.de/osmsvn/applications/editors/josm $GITHUB_WORKSPACE/josm + cd $GITHUB_WORKSPACE/josm + svn up --set-depth=immediates plugins + svn up --set-depth=infinity --accept=theirs-full core i18n plugins/{00_core_test_config,00_core_test_lib,00_core_tools,00_tools} + svn propget svn:externals | grep core | xargs -L1 svn co + cd core + ant dist + cd ../plugins + svn propget svn:externals | grep 00_core | xargs -L1 svn co + - uses: actions/checkout@v3 + with: + path: josm/plugins/${{ github.event.repository.name }} + - name: Build with Ant + run: | + cd $GITHUB_WORKSPACE/josm/plugins/${{ github.event.repository.name }} + if [ $GITHUB_REF_TYPE == "tag" ]; then + version=$GITHUB_REF_NAME + else + version="$GITHUB_REF_NAME-$GITHUB_SHA" + fi + ant -noinput -buildfile build.xml -Dplugin.version=$version + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: josm/dist/${{ github.event.repository.name }}.jar From 7dc8e4f4637c9cd5ac72752d6e5a3d7cc38db315 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 6 Jul 2022 15:37:49 -0600 Subject: [PATCH 3/4] Github workflows: Add tests Signed-off-by: Taylor Smock --- .github/workflows/ant.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index 5410fed9..046959c3 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -10,9 +10,7 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - name: Set up JDK 8 uses: actions/setup-java@v3 @@ -49,8 +47,26 @@ jobs: version="$GITHUB_REF_NAME-$GITHUB_SHA" fi ant -noinput -buildfile build.xml -Dplugin.version=$version + - name: Test with Ant + run: | + cd $GITHUB_WORKSPACE/josm/plugins/${{ github.event.repository.name }} + ant -noinput -buildfile build.xml -Dplugin.version=$version -Dtest.headless test + - name: Dump errors if failed + if: ${{ failure() }} + run: "grep -L ', Failures: 0, Skipped: ' test/report/*.txt | xargs cat" + - name: Upload Ant reports + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: Ant reports for JOSM plugin ${{ github.event.repository.name }} + path: | + $GITHUB_WORKSPACE/josm/plugins/${{ github.event.repository.name }}/test/report/*.txt + $GITHUB_WORKSPACE/josm/plugins/${{ github.event.repository.name }}/test/report/TEST*.xml - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: - files: josm/dist/${{ github.event.repository.name }}.jar + files: | + josm/dist/${{ github.event.repository.name }}.jar + josm/dist/${{ github.event.repository.name }}-javadoc.jar + josm/dist/${{ github.event.repository.name }}-sources.jar From 9e8f60771db2ac214db04bd4a733f020a32483db Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Thu, 7 Jul 2022 10:17:45 -0600 Subject: [PATCH 4/4] TEMP: Run on fixup-tests branch for testing Signed-off-by: Taylor Smock --- .github/workflows/ant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index 046959c3..23f0eb38 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -2,7 +2,7 @@ name: Java CI on: push: - branches: [ master ] + branches: [ master, fixup-tests ] pull_request: branches: [ master ] release: