Skip to content

Commit 3123170

Browse files
committed
Add macos example
1 parent 3604fe2 commit 3123170

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

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+
}

0 commit comments

Comments
 (0)