Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix legacy Android setup in mpp projects #350

Merged
merged 1 commit into from May 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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