Skip to content

Commit

Permalink
Merge pull request #1391 from pjonsson/gradle-dist-plugin
Browse files Browse the repository at this point in the history
build.gradle: configure distributions plugin
  • Loading branch information
nfi authored Jan 9, 2024
2 parents 643d19f + 8dc3ebe commit eb4df2d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,30 @@ tasks.register('fullJar', Jar) {
}
}

// Make startScripts use the fullJar and application settings.
tasks.named("startScripts") {
mainClass = application.mainClass
defaultJvmOpts = application.applicationDefaultJvmArgs
classpath = fullJar.outputs.files
doLast {
delete windowsScript
}
}

distributions {
main {
// Exclude default libraries and include fullJar instead.
contents {
exclude { FileTreeElement details ->
details.file.name.endsWith('.jar') && !details.file.name.contains('cooja-full')
}
into('lib') {
from fullJar
}
}
}
}

run {
// Bad Cooja location detected with gradle run, explicitly pass -cooja.
doFirst {
Expand Down

0 comments on commit eb4df2d

Please sign in to comment.