Skip to content

Commit

Permalink
Fix release on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Dec 29, 2021
1 parent 9f8c1f5 commit 096f701
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ compose.desktop {

val linuxAppDir = project.file("packaging/appimage/Mine in Abyss.AppDir")
val appImageTool = project.file("deps/appimagetool.AppImage")
val composePackageDir = "$buildDir/compose/binaries/main/${if (Os.isFamily(Os.FAMILY_MAC)) "dmg" else "app"}"

tasks {
val downloadAppImageBuilder by registering(Download::class) {
Expand Down Expand Up @@ -108,18 +109,24 @@ tasks {

val zipRelease by registering(Zip::class) {
dependsOn("package")
val dirName = if (Os.isFamily(Os.FAMILY_MAC)) "dmg" else "app"
from("$buildDir/compose/binaries/main/$dirName")
from(composePackageDir)
archiveBaseName.set("$appName-${Os.OS_NAME}")
destinationDirectory.set(file("releases"))
}

val dmgRelease by registering(Copy::class) {
dependsOn("package")
from(composePackageDir)
include("*.dmg")
into("releases")
}

val packageForRelease by registering {
mkdir(project.file("releases"))
if (Os.isFamily(Os.FAMILY_UNIX)) {
dependsOn(executeAppImageBuilder)
} else {
dependsOn(zipRelease)
when {
Os.isFamily(Os.FAMILY_WINDOWS) -> dependsOn(zipRelease)
Os.isFamily(Os.FAMILY_MAC) -> dependsOn(dmgRelease)
else -> dependsOn(executeAppImageBuilder)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group=com.mineinabyss
version=1.0.0
version=1.0.1
idofrontConventions=1.6.10-51
kotlinVersion=1.6.10

0 comments on commit 096f701

Please sign in to comment.