Skip to content

Commit 2eef43c

Browse files
committed
Merge branch 'ios'
Support iOS targets and reorganize the hierarchy.
2 parents a7d3245 + 0300b9b commit 2eef43c

File tree

21 files changed

+609
-9
lines changed

21 files changed

+609
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ build
33
local.properties
44

55
.idea
6+
7+
xcuserdata/

buildSrc/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ plugins {
55
repositories {
66
//mavenLocal()
77
gradlePluginPortal()
8-
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
98
google()
9+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
10+
mavenCentral()
1011
}
1112

1213
dependencies {

buildSrc/src/main/kotlin/VersionsAndDependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ object DependencyVersions {
55

66
object Androidx {
77
val activityCompose = "1.8.2"
8-
val compose = "1.6.3"
8+
val compose = "1.6.4"
99
}
1010
}

buildSrc/src/main/kotlin/common-conventions.gradle.kts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,33 @@ plugins {
55
id("org.jetbrains.compose")
66
}
77

8-
group = "com.huanshankeji"
9-
version = "0.1.3-SNAPSHOT"
10-
118
repositories {
129
mavenLocal()
1310
mavenCentral()
14-
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
1511
google()
12+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
1613
}
1714

15+
group = "com.huanshankeji"
16+
version = "0.1.3-SNAPSHOT"
17+
1818
kotlin {
19+
// for `androidx.compose`
20+
1921
jvm() // TODO: `jvm("desktop")`?
2022
jvmToolchain(8)
23+
2124
//androidTarget()
25+
26+
iosX64()
27+
iosArm64()
28+
iosSimulatorArm64()
29+
2230
@OptIn(ExperimentalWasmDsl::class)
2331
wasmJs()
2432

33+
34+
// for JS and HTML wrappers
35+
2536
js()
2637
}

buildSrc/src/main/kotlin/lib-conventions.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2+
13
plugins {
24
id("common-conventions")
35
// TODO: `id("com.android.library") version "7.2.2"`?
@@ -8,9 +10,24 @@ plugins {
810

911
kotlin {
1012
// move to `common-conventions` if necessary
13+
14+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
15+
applyDefaultHierarchyTemplate {
16+
common {
17+
group("androidxCommon") {
18+
withJvm()
19+
group("ios")
20+
withWasm()
21+
}
22+
}
23+
}
24+
25+
/*
1126
sourceSets {
1227
val androidxCommonMain by creating { dependsOn(commonMain.get()) }
1328
jvmMain { dependsOn(androidxCommonMain) }
29+
iosMain { dependsOn(androidxCommonMain) }
1430
named("wasmJsMain") { dependsOn(androidxCommonMain) }
1531
}
32+
*/
1633
}

demo/build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ plugins {
88
kotlin {
99
androidTarget()
1010

11+
listOf(
12+
iosX64(),
13+
iosArm64(),
14+
iosSimulatorArm64()
15+
).forEach { iosTarget ->
16+
iosTarget.binaries.framework {
17+
baseName = "ComposeApp"
18+
isStatic = true
19+
}
20+
}
21+
1122
val outputFileName = "app.js"
1223

1324
@OptIn(ExperimentalWasmDsl::class)
@@ -45,12 +56,18 @@ kotlin {
4556
}
4657
androidMain {
4758
dependencies {
59+
// TODO consider putting this in `androidxCommonMain`
4860
implementation(compose.ui)
4961

5062
implementation("androidx.activity:activity-compose:${DependencyVersions.Androidx.activityCompose}")
5163
implementation("androidx.compose.ui:ui-tooling-preview:${DependencyVersions.Androidx.compose}")
5264
}
5365
}
66+
iosMain {
67+
dependencies {
68+
implementation(compose.ui)
69+
}
70+
}
5471
wasmJsMain {
5572
dependencies {
5673
implementation(compose.ui)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TEAM_ID=
2+
BUNDLE_ID=com.huanshankeji.compose.material.demo
3+
APP_NAME=compose-multiplatform-material-demo

0 commit comments

Comments
 (0)