Apply used plugins in conventions

pull/38/head
sjcqs 2 years ago committed by sjcqs
parent bb672151fd
commit 8878265f96

@ -23,10 +23,9 @@ import org.gradle.kotlin.dsl.getByType
class AndroidApplicationComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.withPlugin("com.android.application") {
val extension = extensions.getByType<BaseAppModuleExtension>()
configureAndroidCompose(extension)
}
pluginManager.apply("com.android.application")
val extension = extensions.getByType<BaseAppModuleExtension>()
configureAndroidCompose(extension)
}
}

@ -23,11 +23,12 @@ import org.gradle.kotlin.dsl.getByType
class AndroidApplicationJacocoConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.withPlugin("com.android.application") {
pluginManager.apply("org.gradle.jacoco")
val extension = extensions.getByType<ApplicationAndroidComponentsExtension>()
configureJacoco(extension)
with(pluginManager) {
apply("org.gradle.jacoco")
apply("com.android.application")
}
val extension = extensions.getByType<ApplicationAndroidComponentsExtension>()
configureJacoco(extension)
}
}

@ -23,10 +23,9 @@ import org.gradle.kotlin.dsl.getByType
class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.withPlugin("com.android.library") {
val extension = extensions.getByType<LibraryExtension>()
configureAndroidCompose(extension)
}
pluginManager.apply("com.android.library")
val extension = extensions.getByType<LibraryExtension>()
configureAndroidCompose(extension)
}
}

@ -23,11 +23,12 @@ import org.gradle.kotlin.dsl.getByType
class AndroidLibraryJacocoConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.withPlugin("com.android.library") {
pluginManager.apply("org.gradle.jacoco")
val extension = extensions.getByType<LibraryAndroidComponentsExtension>()
configureJacoco(extension)
with(pluginManager) {
apply("org.gradle.jacoco")
apply("com.android.library")
}
val extension = extensions.getByType<LibraryAndroidComponentsExtension>()
configureJacoco(extension)
}
}

Loading…
Cancel
Save