Skip to content

Commit 054fc8a

Browse files
committed
Update build.gradle
Helpful for building with QuPath v0.6.0
1 parent 8a20222 commit 054fc8a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

build.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
// Main gradle plugin for building a Java library
33
id 'java-library'
44
// To create a shadow/fat jar that bundle up all dependencies
5-
id 'com.github.johnrengelman.shadow' version '7.1.2'
5+
id 'com.github.johnrengelman.shadow' version '8.1.1'
66
// Add JavaFX dependencies
77
alias(libs.plugins.javafx)
88
// Version in settings.gradle
@@ -13,7 +13,7 @@ ext.moduleName = 'qupath.extension.omero'
1313
version = "0.1.1-rc1"
1414
description = "QuPath extension to support image reading using OMERO APIs."
1515
ext.qupathVersion = gradle.ext.qupathVersion
16-
ext.qupathJavaVersion = 21
16+
ext.qupathJavaVersion = libs.versions.jdk.get()
1717

1818
dependencies {
1919
shadow "io.github.qupath:qupath-gui-fx:${qupathVersion}"
@@ -42,6 +42,19 @@ jar {
4242
}
4343
}
4444

45+
/**
46+
* Copy necessary attributes, see
47+
* - https://github.com/qupath/qupath-extension-template/issues/9
48+
* - https://github.com/openjfx/javafx-gradle-plugin#variants
49+
*/
50+
configurations.shadow {
51+
def runtimeAttributes = configurations.runtimeClasspath.attributes
52+
runtimeAttributes.keySet().each { key ->
53+
if (key in [Usage.USAGE_ATTRIBUTE, OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, MachineArchitecture.ARCHITECTURE_ATTRIBUTE])
54+
attributes.attribute(key, runtimeAttributes.getAttribute(key))
55+
}
56+
}
57+
4558
processResources {
4659
from ("${projectDir}/LICENSE") {
4760
into 'licenses/'

0 commit comments

Comments
 (0)