diff --git a/.github/workflows/build_jar.yml b/.github/workflows/build_jar.yml deleted file mode 100644 index ca7f0f2..0000000 --- a/.github/workflows/build_jar.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow will build the extension jar and retain the artifact. - # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - - name: Build jar - - on: [workflow_dispatch] - - jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt-hotspot' - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build -P toolchain=11 - - uses: actions/upload-artifact@v2 - with: - name: libs - path: build/libs - retention-days: 1 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0566ee6..91adc77 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,21 +1,41 @@ -# This workflow will build a Java project with Gradle - # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - - name: Java CI with Gradle - - on: [pull_request] - - jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt-hotspot' - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build -P toolchain=11 +name: Run gradle build + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + workflow_dispatch: + workflow_call: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle + run: | + ./gradlew build + + - uses: actions/upload-artifact@v4 + with: + path: build/libs/*.jar + name: build + retention-days: 7 \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 64190b3..0000000 --- a/build.gradle +++ /dev/null @@ -1,56 +0,0 @@ -plugins { - id 'java-library' - // To create a shadow/fat jar, including dependencies - // (not very useful here) - id 'com.github.johnrengelman.shadow' version '8.1.1' - id 'org.openjfx.javafxplugin' version '0.1.0' -} - -repositories { - - mavenCentral() - - maven { - url "https://maven.scijava.org/content/repositories/releases" - } - - maven { - url "https://maven.scijava.org/content/repositories/snapshots" - } - -} - -ext.moduleName = 'qupath.extension.align' - -base { - description = 'QuPath extension for interactive image alignment' - version = "0.4.0" - group = "io.github.qupath" -} -ext.qupathVersion = gradle.ext.qupathVersion -ext.qupathJavaVersion = 17 - -dependencies { - shadow "io.github.qupath:qupath-gui-fx:${qupathVersion}" - shadow "org.slf4j:slf4j-api:1.7.30" -} - -processResources { - from ("${projectDir}/LICENSE") { - into 'licenses/' - } -} - -// Copy dependencies -task copyDependencies(type: Copy) { - from configurations.default - into 'build/libs' -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(qupathJavaVersion) - } - withSourcesJar() - withJavadocJar() -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..d894b19 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("qupath-conventions") +} + +qupathExtension { + name = "qupath-extension-align" + version = "0.5.0-SNAPSHOT" + group = "io.github.qupath" + description = "QuPath extension for interactive image alignment" + automaticModule = "qupath.extension.align" +} + +dependencies { + + implementation(libs.bundles.qupath) + implementation(libs.bundles.logging) + + // For testing + testImplementation(libs.junit) + +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..d64cd49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e09..e2847c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index ad8f915..0000000 --- a/settings.gradle +++ /dev/null @@ -1,28 +0,0 @@ -rootProject.name = 'qupath-extension-align' - -gradle.ext.qupathVersion = "0.5.0" - -dependencyResolutionManagement { - - // Access QuPath's version catalog for dependency versions - versionCatalogs { - libs { - from("io.github.qupath:qupath-catalog:${gradle.ext.qupathVersion}") - } - } - - repositories { - - mavenCentral() - - // Add scijava - which is where QuPath's jars are hosted - maven { - url "https://maven.scijava.org/content/repositories/releases" - } - - maven { - url "https://maven.scijava.org/content/repositories/snapshots" - } - - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..af78ffe --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { + url = uri("https://maven.scijava.org/content/repositories/releases") + } + } +} + +qupath { + version = "0.5.0" +} + +// Apply QuPath Gradle settings plugin to handle configuration +plugins { + id("io.github.qupath.qupath-extension-settings") version "0.2.1" +}