Browse Source

Log distribution output path

pull/45/head
Alexey Tsvetkov 4 years ago
parent
commit
37cc9665c1
  1. 6
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/TargetFormat.kt
  2. 7
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

6
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/TargetFormat.kt

@ -18,4 +18,10 @@ enum class TargetFormat(
val isCompatibleWithCurrentOS: Boolean by lazy { isCompatibleWith(currentOS) }
internal fun isCompatibleWith(targetOS: OS): Boolean = targetOS in compatibleOSs
val fileExt: String
get() {
check(this != AppImage) { "$this cannot have a file extension" }
return ".$id"
}
}

7
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

@ -292,6 +292,13 @@ abstract class AbstractJPackageTask @Inject constructor(
exec.executable = jpackage.absolutePath
exec.setArgs(listOf("@${argsFile.absolutePath}"))
}.assertNormalExitValue()
val destinationDirFile = destinationDir.asFile.get()
val finalLocation = when (targetFormat) {
TargetFormat.AppImage -> destinationDirFile
else -> destinationDirFile.walk().first { it.isFile && it.name.endsWith(targetFormat.fileExt) }
}
logger.lifecycle("The distribution is written to ${finalLocation.canonicalPath}")
} finally {
tmpDir.deleteRecursively()
}

Loading…
Cancel
Save