In Android MPP target, add common module dependency to api configuration
Since Android considers the `compile` configuration as deprecated and reports a warning when a dependency is added to it, use the `api` configuration when dealing with an Android platform module. Issue #KT-23719 Fixed
This commit is contained in:
+14
-3
@@ -289,10 +289,21 @@ fun getSomething() = 10
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testMultiplatformAndroidCompile() {
|
||||
val project = Project("multiplatformAndroidProject", gradleVersion)
|
||||
fun testMultiplatformAndroidCompile() = with(Project("multiplatformAndroidProject", gradleVersion)) {
|
||||
setupWorkingDir()
|
||||
|
||||
project.build("build") {
|
||||
if (!isLegacyAndroidGradleVersion(androidGradlePluginVersion)) {
|
||||
// Check that the common module is not added to the deprecated configuration 'compile' (KT-23719):
|
||||
gradleBuildScript("libAndroid").appendText(
|
||||
"""${'\n'}
|
||||
configurations.compile.dependencies.all { aDependencyExists ->
|
||||
throw GradleException("Check failed")
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
build("build") {
|
||||
assertSuccessful()
|
||||
assertTasksExecuted(
|
||||
":lib:compileKotlinCommon",
|
||||
|
||||
Reference in New Issue
Block a user