Skip to content

Commit 399b0f9

Browse files
fix legacy Android setup in mpp projects (#350)
1 parent c8dd40c commit 399b0f9

File tree

1 file changed

+6
-4
lines changed
  • plugin/src/main/kotlin/com/vanniktech/maven/publish/legacy

1 file changed

+6
-4
lines changed

plugin/src/main/kotlin/com/vanniktech/maven/publish/legacy/Platform.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal fun Project.configureNotAndroidPlatform() {
5454

5555
internal fun Project.configureAndroidPlatform() {
5656
if (hasWorkingNewAndroidPublishingApi()) {
57-
// afterEvaluate is too late but we can't run this synchronously because we shouldn't call the APIs for
57+
// afterEvaluate is too late, but we can't run this synchronously because we shouldn't call the APIs for
5858
// multiplatform projects that use Android
5959
androidComponents.finalizeDsl {
6060
if (!plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
@@ -68,9 +68,11 @@ internal fun Project.configureAndroidPlatform() {
6868
}
6969
} else {
7070
afterEvaluate {
71-
// release was the old default value before it was changed to null for AGP 7.1+
72-
val variant = legacyExtension.androidVariantToPublish ?: "release"
73-
baseExtension.configure(AndroidLibrary(defaultJavaDocOption() ?: javadoc(), variant = variant))
71+
if (!plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
72+
// release was the old default value before it was changed to null for AGP 7.1+
73+
val variant = legacyExtension.androidVariantToPublish ?: "release"
74+
baseExtension.configure(AndroidLibrary(defaultJavaDocOption() ?: javadoc(), variant = variant))
75+
}
7476
}
7577
}
7678
}

0 commit comments

Comments
 (0)