From fe9363c9c0db95d5ce174e923533935a1773727c Mon Sep 17 00:00:00 2001 From: JordonPhillips Date: Thu, 9 Dec 2021 19:27:45 +0100 Subject: [PATCH] Add apple silicon target for smithy cli --- smithy-cli/build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/smithy-cli/build.gradle b/smithy-cli/build.gradle index ce7c7d98589..48dab8ca852 100644 --- a/smithy-cli/build.gradle +++ b/smithy-cli/build.gradle @@ -34,7 +34,14 @@ ext { if (Os.isFamily(Os.FAMILY_WINDOWS)) { ext.set("imageOs", "win64") } else if (Os.isFamily(Os.FAMILY_MAC)) { - ext.set("imageOs", "osx-x86_64") + if (Os.isArch("aarch64")) { + ext.set("imageOs", "osx-aarch_64") + } else if (Os.isArch("x86_64")) { + ext.set("imageOs", "osx-x86_64") + } else { + println("No JDK for ${System.getProperty("os.arch")}") + ext.set("imageOs", "") + } } else if (Os.isFamily(Os.FAMILY_UNIX)) { if (Os.isArch("aarch")) { ext.set("imageOs", "linux-aarch_64") @@ -84,6 +91,10 @@ runtime { jdkHome = jdkDownload("${correttoRoot}-x64-macos-jdk.tar.gz") } + targetPlatform("osx-aarch_64") { + jdkHome = jdkDownload("${correttoRoot}-aarch64-macos-jdk.tar.gz") + } + targetPlatform("win64") { jdkHome = jdkDownload("${correttoRoot}-x64-windows-jdk.zip") }