Created
September 9, 2019 08:33
-
-
Save LizzieStudeneer/f61e2867a9f5b962df473c622429c675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 { | |
compileSdkVersion(28) | |
defaultConfig { | |
minSdkVersion(21) | |
targetSdkVersion(28) | |
versionCode = 2 | |
versionName = "1.0.1" | |
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" | |
} | |
buildTypes { | |
getByName("release") { | |
isMinifyEnabled = false | |
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") | |
} | |
getByName("debug") { | |
isTestCoverageEnabled = true | |
} | |
} | |
packagingOptions { | |
exclude("META-INF/NOTICE.txt") | |
// ... | |
} | |
compileOptions { | |
sourceCompatibility = JavaVersion.VERSION_1_8 | |
targetCompatibility = JavaVersion.VERSION_1_8 | |
} | |
} |
How can I add kotlinOptions{ }
in the scope of this.extensions.getByType<AndroidBaseExtension>().run { }
?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add