2022-12-12 20:20:22 +01:00
|
|
|
plugins {
|
|
|
|
id "st-base-conventions" apply false
|
|
|
|
}
|
|
|
|
|
2022-02-24 22:55:56 +01:00
|
|
|
def launchTask = getGradle()
|
|
|
|
.getStartParameter()
|
|
|
|
.getTaskRequests()
|
|
|
|
.toString()
|
|
|
|
.toLowerCase()
|
2022-12-11 14:10:00 +01:00
|
|
|
ext.isReleaseBuild = launchTask.contains("bundlerelease") || launchTask.contains("assemblerelease")
|
2022-06-11 15:29:33 +02:00
|
|
|
ext.isDebugBuild = !isReleaseBuild
|
2022-02-24 22:55:56 +01:00
|
|
|
|
2022-12-11 16:06:05 +01:00
|
|
|
subprojects {
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
freeCompilerArgs = [
|
|
|
|
'-opt-in=kotlin.contracts.ExperimentalContracts',
|
|
|
|
'-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-24 22:55:56 +01:00
|
|
|
task clean(type: Delete) {
|
|
|
|
delete rootProject.buildDir
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.kotlinTest = { dependencies ->
|
2022-12-11 13:49:48 +01:00
|
|
|
dependencies.testImplementation libs.kluent
|
|
|
|
dependencies.testImplementation libs.kotlin.test
|
|
|
|
dependencies.testImplementation libs.mockk
|
|
|
|
dependencies.testImplementation libs.kotlin.coroutines.test
|
2022-02-24 22:55:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ext.kotlinFixtures = { dependencies ->
|
2022-12-11 13:49:48 +01:00
|
|
|
dependencies.testFixturesImplementation libs.mockk
|
|
|
|
dependencies.testFixturesImplementation libs.kluent
|
|
|
|
dependencies.testFixturesImplementation libs.kotlin.coroutines
|
2022-02-24 22:55:56 +01:00
|
|
|
}
|
|
|
|
|
2022-03-05 19:53:59 +01:00
|
|
|
ext.androidImportFixturesWorkaround = { project, fixtures ->
|
|
|
|
project.dependencies.testImplementation(project.dependencies.testFixtures(fixtures))
|
|
|
|
project.dependencies.testImplementation fixtures.files("build/libs/${fixtures.name}-test-fixtures.jar")
|
|
|
|
project.dependencies.testImplementation fixtures.files("build/libs/${fixtures.name}.jar")
|
|
|
|
}
|
|
|
|
|
2022-08-31 18:44:17 +02:00
|
|
|
ext.isFoss = {
|
|
|
|
return rootProject.hasProperty("foss")
|
|
|
|
}
|
|
|
|
|
|
|
|
ext.firebase = { dependencies, name ->
|
|
|
|
if (isFoss()) {
|
|
|
|
dependencies.implementation(project(":domains:firebase:$name-noop"))
|
|
|
|
} else {
|
|
|
|
dependencies.implementation(project(":domains:firebase:$name"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-24 22:55:56 +01:00
|
|
|
if (launchTask.contains("codeCoverageReport".toLowerCase())) {
|
|
|
|
apply from: 'tools/coverage.gradle'
|
2022-08-31 18:44:17 +02:00
|
|
|
}
|