Skip to content

Commit

Permalink
Fix shadowJar build
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
petebankhead committed Dec 14, 2023
1 parent 45df6ac commit 0026ae8
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ plugins {
// TODO: Change the module name
ext.moduleName = 'io.github.qupath.extension.template'

// TODO: Define the extension version & provide a short description
description = 'A simple QuPath extension template'

// TODO: Define the extension name & version, and provide a short description
base {
archivesName = rootProject.name
version = '0.0.1-SNAPSHOT'
description = 'A simple QuPath extension template'
}

// TODO: Specify the QuPath version, compatible with the extension.
// The default 'gradle.ext.qupathVersion' reads this from settings.gradle.
Expand Down Expand Up @@ -54,7 +57,6 @@ dependencies {
testImplementation libs.junit
}


/*
* Manifest info
*/
Expand All @@ -66,6 +68,19 @@ jar {
}
}

/**
* Copy necessary attributes, see
* - https://github.com/qupath/qupath-extension-template/issues/9
* - https://github.com/openjfx/javafx-gradle-plugin#variants
*/
configurations.shadow {
def runtimeAttributes = configurations.runtimeClasspath.attributes
runtimeAttributes.keySet().each { key ->
if (key in [Usage.USAGE_ATTRIBUTE, OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, MachineArchitecture.ARCHITECTURE_ATTRIBUTE])
attributes.attribute(key, runtimeAttributes.getAttribute(key))
}
}

/*
* Copy the LICENSE file into the jar... if we have one (we should!)
*/
Expand Down

0 comments on commit 0026ae8

Please sign in to comment.