Hi everyone I’m using Compose Multiplatform Deskto...
# compose-desktop
m
Hi everyone I’m using Compose Multiplatform Desktop and I’m building my app on an Apple Silicon Mac (M4). When I run the command:
Copy code
./gradlew packageDistributionForCurrentOS
it successfully generates a
.deb
package for amd64
under
/artifacts/build-mac/binaries/main/deb/dev-analyser_1.0.0-1_amd64.deb
. But now I also want to create a build for Intel/ARM64 Mac — for example, an
.arm64.dmg
package. Is it possible to generate an ARM64
.dmg
file using Compose Multiplatform? Or is it only possible to build for the architecture of the current machine? Or any other way using ci/cd?
m
You are confusing me. Are you running Linux on your beautiful M4 Mac 😱? If you are running MacOS, then you can of course create packages for MacOS. From an M4 Mac you can even create both ARM and Intel packages.
m
Oops path mistake
Can you tell how can?
m
If you have configured TargetFormat.Dmg in your build script, then
Copy code
./gradlew packageDistributionForCurrentOS
should just build a DMG package for ARM if you are running on MacOS on your M4.
m
It work also arm Intel?
m
No, this will work only on ARM. But you can create an Intel package by installing an Intel Java SDK somewhere on your machine and then call something like this.
Copy code
(export JAVA_HOME=/Users/mpaus/Downloads/jdk-17.0.9+9/Contents/Home; ./gradlew clean desktopApp:packageReleaseDmg)
You also have to have Rosetta 2 installed because that is used under the hood then. The path above must point to the Intel JDK.
m
Letter bit not understand
m
What exactly did you not unterstand?
This is my current release
What remining build here if you can tell me it will very helpful for me
I not much experience in desktop distribution so I will figure out
m
The above command line will use Rosetta 2 to do the build because you have set the current JAVA_HOME to an Intel JDK. The outcome then is an Intel DMG package. I do that all the time when I create a distribution.
m
thank you so it possible we can directly add on ci/cd
m
I think so although I have tested this kind of cross-building only on a local Mac. But if you use, e.g., a GitHub ARM Mac runner, then Rosetta 2 should already be pre-installed. (The Intel runners don't have the latest OS version anymore.)
m
ok thank you
hii i have one question packageDmg and packageReleaseDmg any difference
m
Yes. The packageReleaseDmg builds with release settings and automatically uses ProGuard.
m
Ohhh I use packageDistributionForCurrentOS so it release build or not
Thanks for sharing information I have many questions in mind sorry to disturb
m
There is also a task
packageReleaseDistributionForCurrentOS
. So what do you think 🧐😇?
m
Ok got it thanks