Skip to content

Commit 00765a4

Browse files
authored
Merge pull request #94 from kieler/als/aarch64
Add Apple Silicon dedicated product builds
2 parents 3582cfd + 69dc786 commit 00765a4

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
uses: actions/upload-artifact@v2
117117
with:
118118
name: KIELER RCA MacOS
119-
path: build/de.cau.cs.kieler.semantics.product.repository/target/products/sccharts_rca_*-macosx.cocoa.x86_64.tar.gz
119+
path: build/de.cau.cs.kieler.semantics.product.repository/target/products/sccharts_rca_*-macosx.cocoa.*.tar.gz
120120
if-no-files-found: error
121121

122122
# Kieler Compiler CLI
@@ -167,7 +167,9 @@ jobs:
167167
uses: actions/upload-artifact@v2
168168
with:
169169
name: KIELER Compiler Diagrams CLI MacOS Jar
170-
path: build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.jar
170+
path: |
171+
build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.jar
172+
build/de.cau.cs.kieler.kicool.klighd.cli/target/exe/kicodia.osx.aarch64.jar
171173
if-no-files-found: error
172174

173175
# - name: Archive KIELER Compiler Diagrams CLI Windows

build/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,12 @@
304304
<ws>cocoa</ws>
305305
<arch>x86_64</arch>
306306
</environment>
307-
<!-- TODO Future Apple M1/M2 chip support? -->
308-
<!-- <environment>
307+
<!-- Apple M1/M2 chip support -->
308+
<environment>
309309
<os>macosx</os>
310310
<ws>cocoa</ws>
311-
<arch>arm64</arch>
312-
</environment> -->
311+
<arch>aarch64</arch>
312+
</environment>
313313
</environments>
314314
</configuration>
315315
</plugin>

build/scripts/uberjar.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def extract(args, extracted, merged, klighd):
194194
klighd_swt['win'] = target
195195
elif 'cocoa.macosx.x86_64' in jar:
196196
klighd_swt['osx'] = target
197+
elif 'cocoa.macosx.aarch64' in jar:
198+
klighd_swt['osx.aarch64'] = target
197199
else:
198200
stop('Unknown platform-specific SWT fragment: ', jar)
199201
# Remove unwanted files from fragment directory
@@ -298,8 +300,10 @@ def create_standalone_scripts(args, jar, target_dir, klighd):
298300
jar_linux = jar['linux']
299301
jar_win = jar['win']
300302
jar_osx = jar['osx']
303+
jar_osx_arm = jar['osx.aarch64']
301304
else:
302305
jar_linux = jar_win = jar_osx = jar
306+
jar_osx_arm = None
303307

304308
# linux
305309
if jar_linux:
@@ -336,6 +340,15 @@ def create_standalone_scripts(args, jar, target_dir, klighd):
336340
if args.java8:
337341
with open(join(target_dir, args.name + '-osxJava8'), 'wb') as file:
338342
write_script(file, osx_cmd % default_options, code)
343+
344+
# osx ARM 64
345+
if jar_osx_arm:
346+
with open(jar_osx_arm, 'rb') as jar_file:
347+
code = jar_file.read()
348+
osx_cmd = '#!/usr/bin/env bash\nexec java -XstartOnFirstThread %s -jar $0 "$@" \n'
349+
350+
with open(join(target_dir, args.name + '-osx-aarch64'), 'wb') as file:
351+
write_script(file, osx_cmd % (default_options + java9_options), code)
339352

340353
def write_script(file, command, code):
341354
print('Creating script', basename(file.name))

0 commit comments

Comments
 (0)