diff --git a/paging/paging-testing/build.gradle b/paging/paging-testing/build.gradle index c01f6cc8b6ede..da411e65db7f5 100644 --- a/paging/paging-testing/build.gradle +++ b/paging/paging-testing/build.gradle @@ -15,24 +15,41 @@ */ import androidx.build.LibraryType +import androidx.build.PlatformIdentifier import androidx.build.Publish plugins { id("AndroidXPlugin") id("com.android.library") - id("org.jetbrains.kotlin.android") } -dependencies { - api(libs.kotlinStdlib) - implementation(project(":paging:paging-common")) +androidXMultiplatform { + jvm() + mac() + linux() + ios() + android() - testImplementation(libs.junit) - testImplementation(libs.kotlinCoroutinesTest) - testImplementation((libs.kotlinCoroutinesAndroid)) - testImplementation(project(":internal-testutils-paging")) - testImplementation(libs.kotlinTest) - testImplementation(libs.truth) + defaultPlatform(PlatformIdentifier.ANDROID) + + sourceSets { + jvmMain { + dependencies { + api(libs.kotlinStdlib) + implementation(project(":paging:paging-common")) + } + } + jvmTest { + dependencies { + implementation(libs.junit) + implementation(libs.kotlinCoroutinesTest) + implementation((libs.kotlinCoroutinesAndroid)) + implementation(project(":internal-testutils-paging")) + implementation(libs.kotlinTest) + implementation(libs.truth) + } + } + } } androidx { diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/LoadErrorHandler.kt b/paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/LoadErrorHandler.kt similarity index 100% rename from paging/paging-testing/src/main/java/androidx/paging/testing/LoadErrorHandler.kt rename to paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/LoadErrorHandler.kt diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/PagerFlowSnapshot.kt b/paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/PagerFlowSnapshot.kt similarity index 100% rename from paging/paging-testing/src/main/java/androidx/paging/testing/PagerFlowSnapshot.kt rename to paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/PagerFlowSnapshot.kt diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/SnapshotLoader.kt b/paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/SnapshotLoader.kt similarity index 100% rename from paging/paging-testing/src/main/java/androidx/paging/testing/SnapshotLoader.kt rename to paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/SnapshotLoader.kt diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSource.kt b/paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/StaticListPagingSource.kt similarity index 100% rename from paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSource.kt rename to paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/StaticListPagingSource.kt diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt b/paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/StaticListPagingSourceFactory.kt similarity index 100% rename from paging/paging-testing/src/main/java/androidx/paging/testing/StaticListPagingSourceFactory.kt rename to paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/StaticListPagingSourceFactory.kt diff --git a/paging/paging-testing/src/main/java/androidx/paging/testing/TestPager.kt b/paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/TestPager.kt similarity index 100% rename from paging/paging-testing/src/main/java/androidx/paging/testing/TestPager.kt rename to paging/paging-testing/src/jvmMain/kotlin/androidx/paging/testing/TestPager.kt diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt b/paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt similarity index 100% rename from paging/paging-testing/src/test/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt rename to paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/PagerFlowSnapshotTest.kt diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt b/paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt similarity index 100% rename from paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt rename to paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/StaticListPagingSourceFactoryTest.kt diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt b/paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt similarity index 100% rename from paging/paging-testing/src/test/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt rename to paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/StaticListPagingSourceTest.kt diff --git a/paging/paging-testing/src/test/kotlin/androidx/paging/testing/TestPagerTest.kt b/paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/TestPagerTest.kt similarity index 100% rename from paging/paging-testing/src/test/kotlin/androidx/paging/testing/TestPagerTest.kt rename to paging/paging-testing/src/jvmTest/kotlin/androidx/paging/testing/TestPagerTest.kt