From 12b9ad2d98717cb0d2889d6857bec1990c6ce573 Mon Sep 17 00:00:00 2001 From: Alexander Schulz-Rosengarten Date: Tue, 17 Oct 2023 13:18:37 +0200 Subject: [PATCH] Added apple silicon dedicated product builds --- .github/workflows/ci.yml | 6 ++++-- build/pom.xml | 8 ++++---- build/scripts/uberjar.py | 13 +++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53e8b38388..00926791ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,7 +116,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: KIELER RCA MacOS - path: build/de.cau.cs.kieler.semantics.product.repository/target/products/sccharts_rca_*-macosx.cocoa.x86_64.tar.gz + path: build/de.cau.cs.kieler.semantics.product.repository/target/products/sccharts_rca_*-macosx.cocoa.*.tar.gz if-no-files-found: error # Kieler Compiler CLI @@ -167,7 +167,9 @@ jobs: uses: actions/upload-artifact@v2 with: name: KIELER Compiler Diagrams CLI MacOS Jar - path: build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.jar + path: | + build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.jar + build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.aarch64.jar if-no-files-found: error # - name: Archive KIELER Compiler Diagrams CLI Windows diff --git a/build/pom.xml b/build/pom.xml index 938ea9d2fe..61859beb7c 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -304,12 +304,12 @@ cocoa x86_64 - - + macosx cocoa - arm64 - --> + aarch64 + diff --git a/build/scripts/uberjar.py b/build/scripts/uberjar.py index c7a998cef8..535b352c05 100644 --- a/build/scripts/uberjar.py +++ b/build/scripts/uberjar.py @@ -194,6 +194,8 @@ def extract(args, extracted, merged, klighd): klighd_swt['win'] = target elif 'cocoa.macosx.x86_64' in jar: klighd_swt['osx'] = target + elif 'cocoa.macosx.aarch64' in jar: + klighd_swt['osx.aarch64'] = target else: stop('Unknown platform-specific SWT fragment: ', jar) # Remove unwanted files from fragment directory @@ -298,8 +300,10 @@ def create_standalone_scripts(args, jar, target_dir, klighd): jar_linux = jar['linux'] jar_win = jar['win'] jar_osx = jar['osx'] + jar_osx_arm = jar['osx.aarch64'] else: jar_linux = jar_win = jar_osx = jar + jar_osx_arm = None # linux if jar_linux: @@ -336,6 +340,15 @@ def create_standalone_scripts(args, jar, target_dir, klighd): if args.java8: with open(join(target_dir, args.name + '-osxJava8'), 'wb') as file: write_script(file, osx_cmd % default_options, code) + + # osx ARM 64 + if jar_osx_arm: + with open(jar_osx_arm, 'rb') as jar_file: + code = jar_file.read() + osx_cmd = '#!/usr/bin/env bash\nexec java -XstartOnFirstThread %s -jar $0 "$@" \n' + + with open(join(target_dir, args.name + '-osx-aarch64'), 'wb') as file: + write_script(file, osx_cmd % (default_options + java9_options), code) def write_script(file, command, code): print('Creating script', basename(file.name))