1111 */
1212
1313plugins {
14- id(" library" )
1514 alias(libs.plugins.compose.compiler)
15+ alias(libs.plugins.compose.multiplatform)
16+ id(libs.plugins.kotlin.multiplatform.get().pluginId)
17+ id(libs.plugins.android.kotlin.multiplatform.library.get().pluginId)
1618}
1719
18- android {
19- namespace = " com.orange.ouds.foundation "
20+ kotlin {
21+ jvmToolchain( 17 )
2022
21- buildFeatures {
22- compose = true
23+ // Target declarations - add or remove as needed below. These define
24+ // which platforms this KMP module supports.
25+ // See: https://kotlinlang.org/docs/multiplatform-discover-project.html#targets
26+ android {
27+ namespace = " com.orange.ouds.foundation"
28+ compileSdk = libs.versions.androidCompileSdk.get().toInt()
29+ minSdk = libs.versions.androidMinSdk.get().toInt()
30+
31+ withHostTestBuilder {
32+ }
33+
34+ withDeviceTestBuilder {
35+ sourceSetTreeName = " test"
36+ }.configure {
37+ instrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
38+ }
39+ }
40+
41+ // For iOS targets, this is also where you should
42+ // configure native binary output. For more information, see:
43+ // https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#build-xcframeworks
44+
45+ // A step-by-step guide on how to include this library in an XCode
46+ // project can be found here:
47+ // https://developer.android.com/kotlin/multiplatform/migrate
48+ val xcfName = " oudsFoundation"
49+
50+ iosX64 {
51+ binaries.framework {
52+ baseName = xcfName
53+ }
54+ }
55+
56+ iosArm64 {
57+ binaries.framework {
58+ baseName = xcfName
59+ }
2360 }
24- }
2561
26- dependencies {
27- implementation(platform(libs.androidx.compose.bom))
28- implementation(libs.androidx.compose.ui)
29- api(libs.androidx.compose.ui.tooling.preview)
30- }
62+ iosSimulatorArm64 {
63+ binaries.framework {
64+ baseName = xcfName
65+ }
66+ }
67+
68+ // Source set declarations.
69+ // Declaring a target automatically creates a source set with the same name. By default, the
70+ // Kotlin Gradle Plugin creates additional source sets that depend on each other, since it is
71+ // common to share sources between related targets.
72+ // See: https://kotlinlang.org/docs/multiplatform-hierarchy.html
73+ sourceSets {
74+ commonMain {
75+ dependencies {
76+ implementation(libs.kotlin.stdlib)
77+ // Add KMP dependencies here
78+ implementation(libs.compose.ui)
79+ }
80+ }
81+
82+ commonTest {
83+ dependencies {
84+ implementation(libs.kotlin.test)
85+ }
86+ }
87+
88+ androidMain {
89+ dependencies {
90+ // Add Android-specific dependencies here. Note that this source set depends on
91+ // commonMain by default and will correctly pull the Android artifacts of any KMP
92+ // dependencies declared in commonMain.
93+ api(libs.androidx.compose.ui.tooling.preview)
94+ }
95+ }
96+
97+ getByName(" androidDeviceTest" ) {
98+ dependencies {
99+ implementation(libs.androidx.junit)
100+ implementation(libs.androidx.runner)
101+ implementation(libs.core)
102+ }
103+ }
104+
105+ iosMain {
106+ dependencies {
107+ // Add iOS-specific dependencies here. This a source set created by Kotlin Gradle
108+ // Plugin (KGP) that each specific iOS target (e.g., iosX64) depends on as
109+ // part of KMP’s default source set hierarchy. Note that this source set depends
110+ // on common by default and will correctly pull the iOS artifacts of any
111+ // KMP dependencies declared in commonMain.
112+ }
113+ }
114+ }
115+ }
0 commit comments