Skip to content

Commit d7bb1f8

Browse files
authored
Merge pull request #5 from petebankhead/next-version
Towards v0.2.0
2 parents 661604a + da06882 commit d7bb1f8

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ plugins {
77

88
base {
99
group = "io.github.qupath"
10-
version = "0.1.1-SNAPSHOT"
10+
version = "0.2.0-SNAPSHOT"
1111
description = "Gradle plugin for developing QuPath extensions"
1212
}
1313

1414
java {
1515
withSourcesJar()
1616
withJavadocJar()
17+
18+
toolchain {
19+
languageVersion = JavaLanguageVersion.of(11)
20+
}
1721
}
1822

1923
repositories {

src/main/java/qupath/gradle/QuPathGradleSettings.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.jetbrains.annotations.NotNull;
88

99
import java.net.URI;
10+
import java.util.List;
1011
import java.util.Set;
1112

1213
/**
@@ -71,7 +72,27 @@ private void createCatalog(QuPathVersion extension, Settings settings) {
7172
catalogBuilder.create(catalogName, catalog -> {
7273
logger.info("Creating QuPath version catalog named \"{}\"", catalogName);
7374
catalog.from("io.github.qupath:qupath-catalog:" + qupathVersion);
75+
76+
if (addQuPathToCatalog(qupathVersion)) {
77+
catalog.version("qupath", qupathVersion);
78+
catalog.library("qupath.gui.fx", "io.github.qupath", "qupath-gui-fx").versionRef("qupath");
79+
catalog.library("qupath.core", "io.github.qupath", "qupath-core").versionRef("qupath");
80+
catalog.library("qupath.core.processing", "io.github.qupath", "qupath-core-processing").versionRef("qupath");
81+
catalog.bundle("qupath", List.of("qupath.gui.fx", "qupath.core", "qupath.core.processing"));
82+
}
7483
});
7584
}
7685

86+
/**
87+
* Before QuPath v0.6.0, the versions for the QuPath jars weren't included in the catalog -
88+
* so we need to add these here
89+
* @param qupathVersion the QuPath version, e.g. "0.5.2"
90+
* @return
91+
*/
92+
private static boolean addQuPathToCatalog(String qupathVersion) {
93+
return qupathVersion.startsWith("0.4") ||
94+
qupathVersion.startsWith("0.5") ||
95+
Set.of("0.6.0-rc1", "0.6.0-rc2", "0.6.0-rc3").contains(qupathVersion);
96+
}
97+
7798
}

src/main/kotlin/qupath-conventions.gradle.kts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@ afterEvaluate {
3434

3535
tasks.jar {
3636
manifest {
37-
attributes(
38-
mapOf(
39-
"Implementation-Title" to qupathExtension.name.get(),
40-
"Implementation-Version" to qupathExtension.version.get(),
41-
"Automatic-Module-Name" to qupathExtension.automaticModule.get()
42-
)
37+
// Core manifest attributes
38+
val attributeMap = mutableMapOf(
39+
"Implementation-Title" to qupathExtension.name.get(),
40+
"Implementation-Version" to qupathExtension.version.get(),
41+
"Automatic-Module-Name" to qupathExtension.automaticModule.get()
4342
)
43+
// Store QuPath version if we can find it
44+
var qupathVersion = findRequiredVersionInCatalog("qupath")
45+
if (!qupathVersion.isNullOrBlank())
46+
attributeMap["QuPath-Version"] = qupathVersion
47+
48+
attributes(attributeMap)
4449
}
4550
}
4651
}
@@ -142,7 +147,7 @@ javafx {
142147
*/
143148
tasks.javadoc {
144149
val strictJavadoc = providers.gradleProperty("strictJavadoc").getOrElse("false")
145-
if ("true" == strictJavadoc) {
150+
if ("true" != strictJavadoc) {
146151
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
147152
}
148153
}

0 commit comments

Comments
 (0)