Skip to content

Commit

Permalink
Resolve symlink relatively for Docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregor Billing authored and campos20 committed Sep 21, 2020
1 parent d75fedf commit 566dcc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions webscrambles/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ tasks.getByName<ShadowJar>("shadowJar") {
outputs.file(targetLn)

doLast {
val created = archiveFile.orNull?.asFile
?.let { symlink(targetLn, it) } ?: false
val targetFileAbs = archiveFile.orNull?.asFile
?.relativeToOrNull(rootProject.projectDir)

val created = targetFileAbs?.let { symlink(targetLn, it) } ?: false

if (!created) {
logger.warn("Unable to (re-)create symlink for latest release! Using top-level Gradle tasks will implicitly reference an older build!")
Expand Down

0 comments on commit 566dcc5

Please sign in to comment.