Skip to content

Instantly share code, notes, and snippets.

plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
google()
jcenter()
}
open class BluesquarePlugin : Plugin<Project> {
override fun apply(project: Project) {
}
}
implementation-class=com.quickbirdstudios.bluesqure.BluesquarePlugin
plugins {
// ...
id("com.android.library")
id("com.quickbirdstudios.bluesquare")
}
android {
compileSdkVersion(28)
// ...
}
// BluesquarePlugin.kt
open class BluesquarePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configureAndroid()
}
}
// Android.kt
internal fun Project.configureAndroid() = this.extensions.getByType<AndroidBaseExtension>().run {
plugins {
id("com.android.library")
id("com.quickbirdstudios.bluesquare")
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("junit:junit:4.12")
andriodTestImplementation("com.android.support.test:runner:1.0.2")
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
// BluesquarePlugin.kt
open class BluesquarePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configureAndroid()
project.configureDependencies()
}
}
// Dependencies.kt
const val jUnit = "junit:junit:4.12"
plugins {
id("com.android.library")
id("com.quickbirdstudios.bluesquare")
}
// BluesquarePlugin.kt
open class BluesquarePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configurePlugins()
project.configureAndroid()
project.configureDependencies()
}
}
//Plugins.kt