Skip to content

Commit 71e2840

Browse files
committed
Merge branch 'jb-main' into cedrickc/web-compose-window-disposal
# Conflicts: # compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/OnCanvasTests.kt # compose/ui/ui/src/webTest/kotlin/androidx/compose/ui/window/ComposeWindowLifecycleTest.kt
2 parents b9495b8 + c63a7a9 commit 71e2840

File tree

3,995 files changed

+149222
-55538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,995 files changed

+149222
-55538
lines changed

.run/mpp/demo/js-Demo.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</option>
1111
<option name="taskNames">
1212
<list>
13-
<option value="jsRun" />
13+
<option value="jsBrowserDevelopmentRun" />
1414
</list>
1515
</option>
1616
<option name="vmOptions" />

.run/mpp/demo/wasm-Demo.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</option>
1111
<option name="taskNames">
1212
<list>
13-
<option value="wasmJsBrowserRun" />
13+
<option value="wasmJsBrowserDevelopmentRun" />
1414
</list>
1515
</option>
1616
<option name="vmOptions" />

annotation/annotation-compatibility-stub/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ androidXComposeMultiplatform {
3535
js()
3636
wasm()
3737
darwin()
38-
39-
linuxX64()
40-
linuxArm64()
38+
linux()
4139
}
4240

4341
kotlin {

annotation/annotation/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ androidXComposeMultiplatform {
1919
js()
2020
wasm()
2121
darwin()
22-
23-
linuxX64()
24-
linuxArm64()
22+
linux()
2523
}
2624

2725
kotlin {
@@ -57,12 +55,6 @@ kotlin {
5755
}
5856
}
5957
}
60-
61-
// Workaround for https://youtrack.jetbrains.com/issue/KT-51763
62-
// Make sure commonization runs before any compilation task.
63-
tasks.withType(KotlinNativeCompile).configureEach {
64-
it.dependsOn(tasks.named("commonize"))
65-
}
6658
}
6759
}
6860

buildSrc/private/src/main/kotlin/androidx/build/AndroidXComposeMultiplatformExtensionImpl.kt

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
206206
iosArm64("uikitArm64")
207207
iosSimulatorArm64("uikitSimArm64")
208208

209-
val commonMain = sourceSets.getByName("commonMain")
210-
val nativeMain = sourceSets.create("nativeMain")
209+
val nativeMain = getOrCreateNativeMain()
211210
val darwinMain = sourceSets.create("darwinMain")
212211
val macosMain = sourceSets.create("macosMain")
213212
val macosX64Main = sourceSets.getByName("macosX64Main")
@@ -216,7 +215,6 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
216215
val uikitX64Main = sourceSets.getByName("uikitX64Main")
217216
val uikitArm64Main = sourceSets.getByName("uikitArm64Main")
218217
val uikitSimArm64Main = sourceSets.getByName("uikitSimArm64Main")
219-
nativeMain.dependsOn(commonMain)
220218
darwinMain.dependsOn(nativeMain)
221219
macosMain.dependsOn(darwinMain)
222220
macosX64Main.dependsOn(macosMain)
@@ -226,8 +224,7 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
226224
uikitArm64Main.dependsOn(uikitMain)
227225
uikitSimArm64Main.dependsOn(uikitMain)
228226

229-
val commonTest = sourceSets.getByName("commonTest")
230-
val nativeTest = sourceSets.create("nativeTest")
227+
val nativeTest = getOrCreateNativeTest()
231228
val darwinTest = sourceSets.create("darwinTest")
232229
val macosTest = sourceSets.create("macosTest")
233230
val macosX64Test = sourceSets.getByName("macosX64Test")
@@ -236,7 +233,6 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
236233
val uikitX64Test = sourceSets.getByName("uikitX64Test")
237234
val uikitArm64Test = sourceSets.getByName("uikitArm64Test")
238235
val uikitSimArm64Test = sourceSets.getByName("uikitSimArm64Test")
239-
nativeTest.dependsOn(commonTest)
240236
darwinTest.dependsOn(nativeTest)
241237
macosTest.dependsOn(darwinTest)
242238
macosX64Test.dependsOn(macosTest)
@@ -247,12 +243,25 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
247243
uikitSimArm64Test.dependsOn(uikitTest)
248244
}
249245

250-
override fun linuxX64(): Unit = multiplatformExtension.run {
246+
override fun linux(): Unit = multiplatformExtension.run {
251247
linuxX64()
252-
}
253-
254-
override fun linuxArm64(): Unit = multiplatformExtension.run {
255248
linuxArm64()
249+
250+
val nativeMain = getOrCreateNativeMain()
251+
val linuxMain = sourceSets.create("linuxMain")
252+
val linuxX64Main = sourceSets.getByName("linuxX64Main")
253+
val linuxArm64Main = sourceSets.getByName("linuxArm64Main")
254+
linuxMain.dependsOn(nativeMain)
255+
linuxX64Main.dependsOn(linuxMain)
256+
linuxArm64Main.dependsOn(linuxMain)
257+
258+
val nativeTest = getOrCreateNativeTest()
259+
val linuxTest = sourceSets.create("linuxTest")
260+
val linuxX64Test = sourceSets.getByName("linuxX64Test")
261+
val linuxArm64Test = sourceSets.getByName("linuxArm64Test")
262+
linuxTest.dependsOn(nativeTest)
263+
linuxX64Test.dependsOn(linuxTest)
264+
linuxArm64Test.dependsOn(linuxTest)
256265
}
257266

258267
private fun getOrCreateJvmMain(): KotlinSourceSet =
@@ -261,6 +270,12 @@ open class AndroidXComposeMultiplatformExtensionImpl @Inject constructor(
261270
private fun getOrCreateJvmTest(): KotlinSourceSet =
262271
getOrCreateSourceSet("jvmTest", "commonTest")
263272

273+
private fun getOrCreateNativeMain(): KotlinSourceSet =
274+
getOrCreateSourceSet("nativeMain", "commonMain")
275+
276+
private fun getOrCreateNativeTest(): KotlinSourceSet =
277+
getOrCreateSourceSet("nativeTest", "commonTest")
278+
264279
private fun getOrCreateSourceSet(
265280
name: String,
266281
dependsOnSourceSetName: String

buildSrc/private/src/main/kotlin/androidx/build/jetbrains/JetBrainsAndroidXImplPlugin.kt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,42 @@ private fun enableBinaryCompatibilityValidator(project: Project) {
184184
project.apply(plugin = "org.jetbrains.kotlinx.binary-compatibility-validator")
185185
project.extensions.getByType(ApiValidationExtension::class.java).apply {
186186
klib.enabled = true
187+
nonPublicMarkers += NON_PUBLIC_MARKERS
187188
}
188189
}
189190
}
190191
}
192+
193+
// Not ideal to have a list instead of a pattern to match but this is all the API supports right now
194+
// https://github.com/Kotlin/binary-compatibility-validator/issues/280
195+
private val NON_PUBLIC_MARKERS =
196+
setOf(
197+
"androidx.annotation.Experimental",
198+
"androidx.compose.animation.ExperimentalAnimationApi",
199+
"androidx.compose.animation.ExperimentalSharedTransitionApi",
200+
"androidx.compose.animation.core.ExperimentalAnimatableApi",
201+
"androidx.compose.animation.core.ExperimentalAnimationSpecApi",
202+
"androidx.compose.animation.core.ExperimentalTransitionApi",
203+
"androidx.compose.animation.core.InternalAnimationApi",
204+
"androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
205+
"androidx.compose.foundation.gestures.ExperimentalTapGestureDetectorBehaviorApi",
206+
"androidx.compose.foundation.ExperimentalFoundationApi",
207+
"androidx.compose.foundation.InternalFoundationApi",
208+
"androidx.compose.foundation.layout.ExperimentalLayoutApi",
209+
"androidx.compose.material.ExperimentalMaterialApi",
210+
"androidx.compose.runtime.ExperimentalComposeApi",
211+
"androidx.compose.runtime.ExperimentalComposeRuntimeApi",
212+
"androidx.compose.runtime.InternalComposeApi",
213+
"androidx.compose.runtime.InternalComposeTracingApi",
214+
"androidx.compose.ui.ExperimentalComposeUiApi",
215+
"androidx.compose.ui.InternalComposeUiApi",
216+
"androidx.compose.ui.input.pointer.util.ExperimentalVelocityTrackerApi",
217+
"androidx.compose.ui.node.InternalCoreApi",
218+
"androidx.compose.ui.test.ExperimentalTestApi",
219+
"androidx.compose.ui.test.InternalTestApi",
220+
"androidx.compose.ui.text.ExperimentalTextApi",
221+
"androidx.compose.ui.text.InternalTextApi",
222+
"androidx.compose.ui.unit.ExperimentalUnitApi",
223+
"androidx.lifecycle.viewmodel.compose.SavedStateHandleSaveableApi",
224+
"androidx.window.core.ExperimentalWindowApi",
225+
)

buildSrc/public/src/main/kotlin/androidx/build/AndroidXComposeMultiplatformExtension.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,9 @@ abstract class AndroidXComposeMultiplatformExtension {
5656

5757
/**
5858
* Provides the default target configuration and source set dependencies
59-
* for all linuxX64 native targets.
59+
* for all linux native targets.
6060
*/
61-
abstract fun linuxX64(): Unit
62-
63-
/**
64-
* Provides the default target configuration and source set dependencies
65-
* for all linuxArm64 native targets.
66-
*/
67-
abstract fun linuxArm64(): Unit
61+
abstract fun linux(): Unit
6862

6963
/**
7064
* Configures native compilation tasks with flags to link required frameworks

collection/collection-benchmark/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ androidXMultiplatform {
9696
}
9797
}
9898
}
99-
100-
// Workaround for https://youtrack.jetbrains.com/issue/KT-51763
101-
// Make sure commonization runs before any compilation task.
102-
tasks.withType(KotlinNativeCompile).configureEach {
103-
it.dependsOn(tasks.named("commonize"))
104-
}
10599
}
106100
}
107101

collection/collection-compatibility-stub/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ androidXComposeMultiplatform {
3535
js()
3636
wasm()
3737
darwin()
38-
39-
linuxX64()
40-
linuxArm64()
38+
linux()
4139
}
4240

4341
kotlin {

collection/collection/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ androidXComposeMultiplatform {
3535
js()
3636
wasm()
3737
darwin()
38-
39-
linuxX64()
40-
linuxArm64()
38+
linux()
4139
}
4240

4341
kotlin {

0 commit comments

Comments
 (0)