Skip to content

Commit 87c68d6

Browse files
authored
Merge pull request #58 from mori-atsushi/support-macos
Add support for macos
2 parents 435dc38 + 5afdcc6 commit 87c68d6

File tree

6 files changed

+49
-3
lines changed

6 files changed

+49
-3
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181

8282
- name: Run local tests
8383
run: |
84-
./gradlew uikitX64Test uikitSimArm64Test
84+
./gradlew uikitX64Test uikitSimArm64Test macosX64Test macosArm64Test
8585
8686
- name: Upload test reports
8787
if: always()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ kotlin {
2121
sourceSets {
2222
val commonMain by getting {
2323
dependencies {
24-
implementation("com.moriatsushi.insetsx:insetsx:0.1.0-alpha08")
24+
implementation("com.moriatsushi.insetsx:insetsx:0.1.0-alpha09")
2525
}
2626
}
2727
}

example/build.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ kotlin {
2929

3030
jvm("desktop")
3131

32+
macosX64 {
33+
binaries {
34+
executable {
35+
entryPoint = "main"
36+
}
37+
}
38+
}
39+
macosArm64 {
40+
binaries {
41+
executable {
42+
entryPoint = "main"
43+
}
44+
}
45+
}
46+
3247
wasm {
3348
moduleName = "insetsx-example"
3449
browser {
@@ -76,6 +91,15 @@ kotlin {
7691
val uikitSimArm64Main by getting {
7792
dependsOn(uikitMain)
7893
}
94+
val macosMain by creating {
95+
dependsOn(commonMain)
96+
}
97+
val macosX64Main by getting {
98+
dependsOn(macosMain)
99+
}
100+
val macosArm64Main by getting {
101+
dependsOn(macosMain)
102+
}
79103
val desktopMain by getting {
80104
dependsOn(commonMain)
81105

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import androidx.compose.ui.window.Window
2+
import com.moriatsushi.insetsx.example.ExampleApp
3+
import platform.AppKit.NSApp
4+
import platform.AppKit.NSApplication
5+
6+
fun main() {
7+
NSApplication.sharedApplication()
8+
Window("Chat App") {
9+
ExampleApp()
10+
}
11+
NSApp?.run()
12+
}

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ kotlin.native.cacheKind=none
1717

1818
#compose
1919
org.jetbrains.compose.experimental.uikit.enabled=true
20+
org.jetbrains.compose.experimental.macos.enabled=true
2021
org.jetbrains.compose.experimental.jscanvas.enabled=true
2122

2223
# Maven Central
2324
SONATYPE_HOST=S01
2425
RELEASE_SIGNING_ENABLED=true
2526
GROUP=com.moriatsushi.insetsx
26-
VERSION_NAME=0.1.0-alpha08
27+
VERSION_NAME=0.1.0-alpha09
2728

2829
POM_NAME=InsetsX
2930
POM_DESCRIPTION=WindowInsets utility for compose multiplatform

insetsx/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ kotlin {
2727
}
2828
}
2929

30+
macosX64()
31+
macosArm64()
32+
3033
jvm("desktop")
3134

3235
js(IR) {
@@ -77,6 +80,12 @@ kotlin {
7780
val noOpMain by creating {
7881
dependsOn(commonMain)
7982
}
83+
val macosX64Main by getting {
84+
dependsOn(noOpMain)
85+
}
86+
val macosArm64Main by getting {
87+
dependsOn(noOpMain)
88+
}
8089
val desktopMain by getting {
8190
dependsOn(noOpMain)
8291
}

0 commit comments

Comments
 (0)