Skip to content

Commit

Permalink
fix legacy Android setup in mpp projects (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielittner committed May 28, 2022
1 parent c8dd40c commit 399b0f9
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -54,7 +54,7 @@ internal fun Project.configureNotAndroidPlatform() {

internal fun Project.configureAndroidPlatform() {
if (hasWorkingNewAndroidPublishingApi()) {
// afterEvaluate is too late but we can't run this synchronously because we shouldn't call the APIs for
// afterEvaluate is too late, but we can't run this synchronously because we shouldn't call the APIs for
// multiplatform projects that use Android
androidComponents.finalizeDsl {
if (!plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
Expand All @@ -68,9 +68,11 @@ internal fun Project.configureAndroidPlatform() {
}
} else {
afterEvaluate {
// release was the old default value before it was changed to null for AGP 7.1+
val variant = legacyExtension.androidVariantToPublish ?: "release"
baseExtension.configure(AndroidLibrary(defaultJavaDocOption() ?: javadoc(), variant = variant))
if (!plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) {
// release was the old default value before it was changed to null for AGP 7.1+
val variant = legacyExtension.androidVariantToPublish ?: "release"
baseExtension.configure(AndroidLibrary(defaultJavaDocOption() ?: javadoc(), variant = variant))
}
}
}
}
Expand Down

0 comments on commit 399b0f9

Please sign in to comment.