Skip to content

Commit dfa3bb5

Browse files
committed
Restore demo-swiftui
1 parent 52076a5 commit dfa3bb5

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright 2026 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import androidx.build.AndroidXComposePlugin
18+
import org.jetbrains.kotlin.gradle.dsl.KotlinNativeBinaryContainer
19+
import org.jetbrains.androidx.build.JetBrainsAndroidXPlugin
20+
21+
plugins {
22+
id("AndroidXPlugin")
23+
id("AndroidXComposePlugin")
24+
id("kotlin-multiplatform")
25+
id("JetBrainsAndroidXPlugin")
26+
}
27+
28+
repositories {
29+
mavenLocal()
30+
}
31+
32+
fun KotlinNativeBinaryContainer.configureFramework() {
33+
framework {
34+
baseName = "shared"
35+
freeCompilerArgs += listOf(
36+
"-linker-option", "-framework", "-linker-option", "Metal",
37+
"-linker-option", "-framework", "-linker-option", "CoreText",
38+
"-linker-option", "-framework", "-linker-option", "CoreGraphics"
39+
)
40+
}
41+
}
42+
43+
kotlin {
44+
iosArm64 {
45+
binaries {
46+
configureFramework()
47+
}
48+
}
49+
iosSimulatorArm64 {
50+
binaries {
51+
configureFramework()
52+
}
53+
}
54+
sourceSets {
55+
val commonMain by getting {
56+
dependencies {
57+
implementation(project(":compose:foundation:foundation"))
58+
implementation(project(":compose:foundation:foundation-layout"))
59+
implementation(project(":compose:material:material"))
60+
implementation(project(":compose:mpp"))
61+
implementation(project(":compose:mpp:demo"))
62+
implementation(project(":compose:runtime:runtime"))
63+
implementation(project(":compose:ui:ui"))
64+
implementation(project(":compose:ui:ui-graphics"))
65+
implementation(project(":compose:ui:ui-text"))
66+
implementation(libs.kotlinCoroutinesCore)
67+
}
68+
}
69+
val skikoMain by creating {
70+
dependsOn(commonMain)
71+
dependencies {
72+
implementation(libs.skiko)
73+
}
74+
}
75+
val nativeMain by creating { dependsOn(skikoMain) }
76+
val darwinMain by creating { dependsOn(nativeMain) }
77+
val iosMain by creating {
78+
dependsOn(darwinMain)
79+
}
80+
val iosArm64Main by getting { dependsOn(iosMain) }
81+
val iosSimulatorArm64Main by getting { dependsOn(iosMain) }
82+
}
83+
}

0 commit comments

Comments
 (0)