[#6] Refactor kotlinOptions to build-conventions
This commit is contained in:
parent
665042e6d9
commit
4f960d5bf8
|
@ -93,12 +93,6 @@ android {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
resources.excludes.addAll(
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import com.android.build.api.dsl.CommonExtension
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
|
||||
|
||||
// Note: due to a few limitations with build-conventions, there is some common Android Gradle Plugin
|
||||
// configuration happening in the root build.gradle.kts with a subprojects block.
|
||||
|
||||
|
@ -105,4 +108,16 @@ fun com.android.build.gradle.BaseExtension.configureBaseExtension() {
|
|||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (this is CommonExtension<*, *, *, *>) {
|
||||
kotlinOptions {
|
||||
jvmTarget = project.property("ANDROID_JVM_TARGET").toString()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
|
||||
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
|
||||
}
|
|
@ -10,14 +10,6 @@ plugins {
|
|||
val isOrchestratorEnabled = true
|
||||
|
||||
android {
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
|
||||
|
||||
if (isOrchestratorEnabled) {
|
||||
defaultConfig {
|
||||
testInstrumentationRunnerArguments["clearPackageData"] = "true"
|
||||
|
|
|
@ -5,12 +5,6 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs.plus("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -5,13 +5,6 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs.plus("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
resourcePrefix = "co_electriccoin_zcash_"
|
||||
}
|
||||
|
||||
|
|
|
@ -6,13 +6,6 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
|
||||
// Force orchestrator to be used for this module, because we need the preference files
|
||||
// to be purged between tests
|
||||
defaultConfig {
|
||||
|
|
|
@ -5,13 +5,6 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs.plus("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
resourcePrefix = "co_electriccoin_zcash_"
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ plugins {
|
|||
|
||||
android {
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
compose = true
|
||||
}
|
||||
|
||||
|
@ -15,13 +14,6 @@ android {
|
|||
kotlinCompilerExtensionVersion = libs.androidx.compose.compiler.get().versionConstraint.displayName
|
||||
}
|
||||
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs.plus("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("main").apply {
|
||||
res.setSrcDirs(
|
||||
|
|
|
@ -15,7 +15,6 @@ android {
|
|||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
compose = true
|
||||
}
|
||||
|
||||
|
@ -23,13 +22,6 @@ android {
|
|||
kotlinCompilerExtensionVersion = libs.androidx.compose.compiler.get().versionConstraint.displayName
|
||||
}
|
||||
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
kotlinOptions {
|
||||
jvmTarget = libs.versions.java.get()
|
||||
allWarningsAsErrors = project.property("ZCASH_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
|
||||
freeCompilerArgs = freeCompilerArgs.plus("-opt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("main").apply {
|
||||
res.setSrcDirs(
|
||||
|
|
Loading…
Reference in New Issue