Skip to content

Commit

Permalink
implemented disable-fatjar-property
Browse files Browse the repository at this point in the history
  • Loading branch information
cansik committed Mar 8, 2021
1 parent 54d903c commit 9dc21b3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ outputName=deepvision
outputNamePostfix=

# Uncomment for continues build with cuda:
# cuda
# cuda

# Uncomment for no fat jar building
# disable-fatjar
31 changes: 25 additions & 6 deletions processing-library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ task releaseProcessingLib {
clean
build
javadoc
fatJar
if (project.hasProperty("disable-fatjar")) {
jar
} else {
fatJar
}
}

finalizedBy 'packageRelease', 'renameRelease'
Expand All @@ -36,13 +40,28 @@ task releaseProcessingLib {
doLast {
println "creating package..."

println "copy library..."
project.copy {
from "$buildDir/libs/$outputName-complete.jar"
into "$releaseDirectory/library"
rename "$outputName-complete.jar", "${outputName}.jar"
if (project.hasProperty("disable-fatjar")) {
println "copy library..."
project.copy {
from "$buildDir/libs/${outputName}.jar"
into "$releaseDirectory/library"
}

println "copy dependencies..."
project.copy {
from configurations.runtime
into "$releaseDirectory/library"
}
} else {
println "copy fatjar library..."
project.copy {
from "$buildDir/libs/$outputName-complete.jar"
into "$releaseDirectory/library"
rename "$outputName-complete.jar", "${outputName}.jar"
}
}


println "copy assets (only if necessary)..."
project.copy {
from("$rootDir") {
Expand Down

0 comments on commit 9dc21b3

Please sign in to comment.