Skip to content

Commit 482d2ec

Browse files
author
Eduard Obolenskiy
committed
add macosArm64 target to gradle and ci yamls
1 parent eb88bd4 commit 482d2ec

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

.github/workflows/check-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
if: ${{ matrix.os == 'ubuntu-latest' }}
4040
- uses: eskatos/gradle-command-action@v1
4141
with:
42-
arguments: macosX64MainKlibrary -s -i
43-
if: ${{ matrix.os == 'macos-latest' }}
42+
arguments: macosX64MainKlibrary macosArm64MainKlibrary -s -i
43+
if: ${{ matrix.os == 'macos-latest' && runner.arch == 'ARM64' }}
4444
- uses: eskatos/gradle-command-action@v1
4545
with:
4646
arguments: mingwX64MainKlibrary -s -i

.github/workflows/gradle-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
name: Publish targets to maven
7878
with:
7979
arguments: publish -d -s -PapiKey=${{ secrets.SONOTYPE_TOKEN }} '-Dorg.gradle.jvmargs=-Xmx2g -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8'
80-
if: ${{ startsWith(matrix.os, 'macos') }}
80+
if: ${{ startsWith(matrix.os, 'macos') && runner.arch == 'ARM64' }}
8181

8282
- uses: eskatos/gradle-command-action@v1
8383
name: Publish targets to maven

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
arguments: clean mingwX64Test
3333
- uses: eskatos/gradle-command-action@v1
3434
name: Test Apple Target
35-
if: ${{ startsWith(matrix.os, 'macos') }}
35+
if: ${{ startsWith(matrix.os, 'macos') && runner.arch == 'ARM64' }}
3636
with:
37-
arguments: clean macosX64Test
37+
arguments: clean macosX64Test macosArm64Test
3838
- uses: eskatos/gradle-command-action@v1
3939
name: Test Linux Target
4040
if: ${{ startsWith(matrix.os, 'ubuntu') }}

build.gradle.kts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ kotlin {
2626
linuxX64()
2727

2828
// darwin macos code
29-
macosX64 {
29+
macosX64() {
30+
if (testApp?.toBoolean() == true) {
31+
binaries {
32+
executable()
33+
}
34+
}
35+
}
3036

37+
macosArm64 {
3138
if (testApp?.toBoolean() == true) {
3239
binaries {
3340
executable()
@@ -47,6 +54,12 @@ kotlin {
4754
val posixMain by creating {
4855
dependsOn(commonMain)
4956
}
57+
val macosArm64Main by getting {
58+
dependsOn(posixMain)
59+
if (testApp?.toBoolean() == true) {
60+
kotlin.srcDirs("src/macosX64Runner/kotlin")
61+
}
62+
}
5063
val macosX64Main by getting {
5164
dependsOn(posixMain)
5265
if (testApp?.toBoolean() == true) {

0 commit comments

Comments
 (0)