Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/jpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

- uses: actions/checkout@v4

- name: Set up JDK 17 # TODO: check Java version
- name: Set up JDK 21 # TODO: check Java version
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'

- name: Validate Gradle wrapper
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

This repo contains a template and instructions to help create a new extension for [QuPath](https://qupath.github.io).

It already contains two minimal extensions, so the first task is to make sure that they work.
It already contains two minimal extensions - one using Java, one using Groovy - so the first task is to make sure that they work.
Then, it's a matter of customizing the code to make it more useful.

> There are two extensions to show that you can use either Java or Groovy.
> **Update!**
> For QuPath v0.6.0 this repo switched to use Kotlin DSL for Gradle build files -
> and also to use the [QuPath Gradle Plugin](https://github.com/qupath/qupath-gradle-plugin).
>
> The outcome is that the build files are _much_ simpler.


## Build the extension

Expand Down Expand Up @@ -58,14 +63,14 @@ Now when you run QuPath from IntelliJ, your extension should (hopefully) be foun

There are a few fixed steps to customizing the extension, and then the main creative part where you add your own code.

### Update `settings.gradle`
### Update `settings.gradle.kts`

Open `settings.gradle` and check the comment lines flagged with `\\TODO`.
Open `settings.gradle.kts` and check the comment lines flagged with `\\TODO`.
These point you towards parts you may well need to change.

### Update `build.gradle`
### Update `build.gradle.kts`

Open `build.gradle` and follow a similar process to with `settings.gradle`, to update the bits flagged with `\\TODO`.
Open `build.gradle.kts` and follow a similar process to with `settings.gradle.kts`, to update the bits flagged with `\\TODO`.

### Create the extension Java or Groovy file(s)

Expand Down
170 changes: 0 additions & 170 deletions build.gradle

This file was deleted.

34 changes: 34 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
// QuPath Gradle extension convention plugin
id("qupath-conventions")
// Support writing the extension in Groovy (remove this if you don't want to)
groovy
// To optionally create a shadow/fat jar that bundle up any non-core dependencies
id("com.gradleup.shadow") version "8.3.5"
}

// TODO: Configure your extension here (please change the defaults!)
qupathExtension {
name = "qupath-extension-template"
group = "io.github.qupath"
version = "0.1.0-SNAPSHOT"
description = "A simple QuPath extension"
automaticModule = "io.github.qupath.extension.template"
}

// TODO: Define your dependencies here
dependencies {

// Main dependencies for most QuPath extensions
shadow(libs.bundles.qupath)
shadow(libs.bundles.logging)
shadow(libs.qupath.fxtras)

// If you aren't using Groovy, this can be removed
shadow(libs.bundles.groovy)

// For testing
testImplementation(libs.bundles.qupath)
testImplementation(libs.junit)

}
42 changes: 0 additions & 42 deletions settings.gradle

This file was deleted.

18 changes: 18 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = uri("https://maven.scijava.org/content/repositories/releases")
}
}
}

// TODO: Specify which version of QuPath the extension is targeting here
qupath {
version = "0.6.0-SNAPSHOT"
}

// Apply QuPath Gradle settings plugin to handle configuration
plugins {
id("io.github.qupath.qupath-extension-settings") version "0.1.0"
}
7 changes: 5 additions & 2 deletions src/main/java/qupath/ext/template/ui/InterfaceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Spinner;
import javafx.scene.control.TextField;
import javafx.scene.layout.VBox;
import qupath.ext.template.DemoExtension;
import qupath.fx.dialogs.Dialogs;
Expand All @@ -22,6 +20,11 @@ public class InterfaceController extends VBox {
@FXML
private Spinner<Integer> threadSpinner;

/**
* Create a new instance of the interface controller.
* @return
* @throws IOException
*/
public static InterfaceController createInstance() throws IOException {
return new InterfaceController();
}
Expand Down
Loading