Add library convention plugin
This commit is contained in:
@@ -15,5 +15,9 @@ gradlePlugin {
|
|||||||
id = "gq.kirmanak.mealient.application"
|
id = "gq.kirmanak.mealient.application"
|
||||||
implementationClass = "AndroidApplicationConventionPlugin"
|
implementationClass = "AndroidApplicationConventionPlugin"
|
||||||
}
|
}
|
||||||
|
register("androidLibrary") {
|
||||||
|
id = "gq.kirmanak.mealient.library"
|
||||||
|
implementationClass = "AndroidLibraryConventionPlugin"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import com.android.build.gradle.LibraryExtension
|
||||||
|
import gq.kirmanak.mealient.Versions
|
||||||
|
import gq.kirmanak.mealient.configureKotlinAndroid
|
||||||
|
import org.gradle.api.Plugin
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.kotlin.dsl.configure
|
||||||
|
|
||||||
|
class AndroidLibraryConventionPlugin : Plugin<Project> {
|
||||||
|
override fun apply(target: Project) {
|
||||||
|
with(target) {
|
||||||
|
with(pluginManager) {
|
||||||
|
apply("com.android.library")
|
||||||
|
apply("org.jetbrains.kotlin.android")
|
||||||
|
}
|
||||||
|
|
||||||
|
extensions.configure<LibraryExtension> {
|
||||||
|
configureKotlinAndroid(this)
|
||||||
|
defaultConfig.targetSdk = Versions.TARGET_SDK_VERSION
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user