Skip to content

Commit

Permalink
Convert ivy to maven dependencies, update workflows, update gradle
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Oct 1, 2024
1 parent 2fd8294 commit c0329fa
Show file tree
Hide file tree
Showing 12 changed files with 417 additions and 256 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ant-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ on:
release:
types: [created]

permissions:
id-token: write
attestations: write
contents: write
packages: write
checks: write

jobs:
call-workflow:
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
josm-revision: "r18173"
josm-revision: "r19044"
secrets: inherit
permissions:
contents: write

38 changes: 34 additions & 4 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,46 @@ on:
branches:
- master
- $default-branch
schedule:
- cron: "43 19 * * 3"
workflow_dispatch:

permissions:
id-token: write
attestations: write
contents: write
packages: write
checks: write

jobs:
check-release-needed:
runs-on: ubuntu-latest
outputs:
release_needed: ${{ steps.create_release_needed.outputs.release_needed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ (github.repository == 'JOSM/areaselector' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request') && '0' || '1' }}

- name: Set release needed
id: create_release_needed
run: |
last_tag=$(git describe --tags --abbrev=0 --always)
release_needed="false"
for file in $(git diff ${last_tag}..HEAD --name-only); do
if [[ $file = "src/"* ]] || [[ $file = "data/"* ]] || [[ $file = "lib/"* ]] || [[ $file = "resources/"* ]] || [[ $file = "images/"* ]]; then
release_needed="true"
break
fi
done
echo "release_needed=$release_needed" >> $GITHUB_OUTPUT
call-workflow:
needs: check-release-needed
strategy:
matrix:
josm-revision: ["", "r18173"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2
josm-revision: ["", "r19044"]
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
josm-revision: ${{ matrix.josm-revision }}
perform-revision-tagging: false
secrets: inherit
13 changes: 0 additions & 13 deletions .github/workflows/reports.yaml

This file was deleted.

71 changes: 28 additions & 43 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,33 @@ import org.openstreetmap.josm.gradle.plugin.task.MarkdownToHtml
import java.net.URL

plugins {
id("com.github.ben-manes.versions") version "0.39.0"
id("org.openstreetmap.josm") version "0.7.1"
id("com.github.spotbugs") version "4.7.9"
id("net.ltgt.errorprone") version "2.0.2"
id("com.github.ben-manes.versions") version "0.51.0"
id("org.openstreetmap.josm") version "0.8.2"
id("com.github.spotbugs") version "6.0.23"
id("net.ltgt.errorprone") version "4.0.1"
java
pmd
`maven-publish`
}

java.sourceCompatibility = JavaVersion.VERSION_1_8
java.sourceCompatibility = JavaVersion.VERSION_11
base.archivesBaseName = "areaselector"

val versions = mapOf(
"austriaaddresshelper" to "v0.8.0",
// Note: boofcv 0.39.1 is NOT Java 8 compatible
"boofcv" to "0.39",
"ddogleg" to "0.20",
"errorprone" to "2.10.0",
"junit" to "5.8.2",
"austriaaddresshelper" to "v0.8.2",
"boofcv" to "1.1.6",
"ddogleg" to "0.23.3",
"errorprone" to "2.33.0",
"junit" to "5.11.1",
"pmd" to "6.18.0",
"spotbugs" to "4.5.2",
"xmlpull" to "1.1.3.1",
"spotbugs" to "4.8.6",
"xmlpull" to "1.1.3.4a",
"xpp" to "1.1.6",
"xstream" to "1.4.18"
"xstream" to "1.4.20"
)

repositories {
jcenter()
mavenCentral()
// Note: This may become unnecessary in future josm gradle plugin versions.
// See https://gitlab.com/floscher/gradle-josm-plugin/-/merge_requests/9
ivy {
url = uri("https://github.com/JOSM/austriaaddresshelper/releases/download/")
content {
includeModule("org.openstreetmap.josm.plugins", "austriaaddresshelper")
}
patternLayout {
artifact("/${versions["austriaaddresshelper"]}/[artifact].[ext]")
//ivy("${versions["austriaaddresshelper"]}/ivy.xml")
}
metadataSources {
artifact()
}
}
flatDir {
dirs("lib")
}
Expand Down Expand Up @@ -83,18 +66,18 @@ val libsImplementation by configurations.getting {
}

dependencies {
packIntoJar("com.thoughtworks.xstream:xstream:${versions["xstream"]}")
packIntoJar("org.ogce:xpp3:${versions["xpp"]}")
packIntoJar("xmlpull:xmlpull:${versions["xmlpull"]}")

packIntoJar("org.boofcv:boofcv-core:${versions["boofcv"]}")
packIntoJar("org.boofcv:boofcv-feature:${versions["boofcv"]}")
packIntoJar("org.boofcv:boofcv-swing:${versions["boofcv"]}")
packIntoJar("org.boofcv:boofcv-ip:${versions["boofcv"]}")
packIntoJar("org.boofcv:boofcv-io:${versions["boofcv"]}")
packIntoJar("org.ddogleg:ddogleg:${versions["ddogleg"]}")
packIntoJar(files("lib/marvin-custom.jar"))
packIntoJar(files("lib/marvinplugins-custom.jar"))
implementation("com.thoughtworks.xstream:xstream:${versions["xstream"]}")
implementation("org.ogce:xpp3:${versions["xpp"]}")
implementation("xmlpull:xmlpull:${versions["xmlpull"]}")

implementation("org.boofcv:boofcv-core:${versions["boofcv"]}")
implementation("org.boofcv:boofcv-feature:${versions["boofcv"]}")
implementation("org.boofcv:boofcv-swing:${versions["boofcv"]}")
implementation("org.boofcv:boofcv-ip:${versions["boofcv"]}")
implementation("org.boofcv:boofcv-io:${versions["boofcv"]}")
implementation("org.ddogleg:ddogleg:${versions["ddogleg"]}")
implementation(files("lib/marvin-custom.jar"))
implementation(files("lib/marvinplugins-custom.jar"))

libsImplementation("org.boofcv:boofcv-core:${versions["boofcv"]}")
libsImplementation("org.boofcv:boofcv-feature:${versions["boofcv"]}")
Expand All @@ -119,7 +102,7 @@ tasks.withType(JavaCompile::class).configureEach {
options.compilerArgs.addAll(listOf("-Xlint:all", "-Xlint:-serial"))
options.errorprone {
check("ClassCanBeStatic", CheckSeverity.ERROR)
check("StringEquality", CheckSeverity.ERROR)
check("ReferenceEquality", CheckSeverity.ERROR)
check("WildcardImport", CheckSeverity.ERROR)
check("MethodCanBeStatic", CheckSeverity.WARN)
check("RemoveUnusedImports", CheckSeverity.WARN)
Expand Down Expand Up @@ -148,6 +131,7 @@ josm {
pathTransformer = getPathTransformer(project.projectDir, "github.com/JOSM/areaselector/blob")
}
manifest {
oldVersionDownloadLink(18173, "v2.6.2", URL("https://github.com/JOSM/areaselector/releases/download/v2.6.2/areaselector.jar"))
oldVersionDownloadLink(16871, "v2.6.0-beta.1", URL("https://github.com/JOSM/areaselector/releases/download/v2.6.0-beta.1/areaselector.jar"))
oldVersionDownloadLink(15017, "v2.5.1", URL("https://github.com/JOSM/areaselector/releases/download/v2.5.1/areaselector.jar"))
oldVersionDownloadLink(12859, "v2.4.9", URL("https://github.com/JOSM/areaselector/releases/download/v2.4.9/areaselector.jar"))
Expand All @@ -165,6 +149,7 @@ tasks.withType(SpotBugsTask::class) {
reports.create("html")
reports.create("xml")
}

tasks.create("md2html", MarkdownToHtml::class) {
destDir = File(buildDir, "md2html")
source(projectDir)
Expand Down
26 changes: 0 additions & 26 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="areaselector" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">

<!-- enter the SVN commit message -->
<property name="commit.message" value="Commit message" />

<!-- Configure these properties (replace "..." accordingly).
See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
-->
Expand All @@ -13,28 +9,6 @@
<!-- ** include targets that all plugins have in common ** -->
<import file="../build-common.xml" />

<!-- Disable build below java 11 -->
<condition property="skip-compile">
<not>
<isset property="isJava11"/>
</not>
</condition>
<condition property="skip-dist">
<not>
<isset property="isJava11"/>
</not>
</condition>
<condition property="skip-javadoc">
<not>
<isset property="isJava11"/>
</not>
</condition>
<condition property="skip-test">
<not>
<isset property="isJava11"/>
</not>
</condition>

<fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
<include name="apache-commons.jar"/>
<include name="austriaaddresshelper.jar"/>
Expand Down
6 changes: 2 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ plugin.link=https://github.com/JOSM/areaselector
plugin.requires=apache-commons;austriaaddresshelper;ejml;log4j
# Minimum required JOSM version to run this plugin, choose the lowest version possible that is compatible.
# You can check if the plugin compiles against this version by executing `./gradlew minJosmVersionClasses`.
plugin.main.version=18173
plugin.main.version=19044
# 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=18303
plugin.compile.version=19067
plugin.canloadatruntime=true
plugin.minimum.java.version=11
java.lang.version=11
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=8c12154228a502b784f451179846e518733cf856efc7d45b2e6691012977b2fe
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c0329fa

Please sign in to comment.