67 lines
2.2 KiB
Groovy
67 lines
2.2 KiB
Groovy
plugins {
|
|
// alias(libs.plugins.android.application) apply false
|
|
// alias(libs.plugins.android.library) apply false
|
|
}
|
|
|
|
def launchTask = getGradle()
|
|
.getStartParameter()
|
|
.getTaskRequests()
|
|
.toString()
|
|
.toLowerCase()
|
|
def isReleaseBuild = launchTask.contains("bundleRelease") || launchTask.contains("assembleRelease")
|
|
ext.isDebugBuild = !isReleaseBuild
|
|
|
|
task clean(type: Delete) {
|
|
delete rootProject.buildDir
|
|
}
|
|
|
|
ext.applyCrashlyticsIfRelease = { project ->
|
|
println("is release $isReleaseBuild")
|
|
println("is foss ${isFoss()}")
|
|
if (isReleaseBuild && !isFoss()) {
|
|
println("run craslytics")
|
|
|
|
project.apply plugin: 'com.google.firebase.crashlytics'
|
|
project.afterEvaluate {
|
|
project.tasks.withType(com.google.firebase.crashlytics.buildtools.gradle.tasks.UploadMappingFileTask).configureEach {
|
|
it.googleServicesResourceRoot.set(project.file("src/release/res/"))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
ext.kotlinTest = { dependencies ->
|
|
dependencies.testImplementation libs.kluent
|
|
dependencies.testImplementation libs.kotlin.test
|
|
dependencies.testImplementation libs.mockk
|
|
dependencies.testImplementation libs.kotlin.coroutines.test
|
|
}
|
|
|
|
ext.kotlinFixtures = { dependencies ->
|
|
dependencies.testFixturesImplementation libs.mockk
|
|
dependencies.testFixturesImplementation libs.kluent
|
|
dependencies.testFixturesImplementation libs.kotlin.coroutines
|
|
}
|
|
|
|
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")
|
|
}
|
|
|
|
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"))
|
|
}
|
|
}
|
|
|
|
if (launchTask.contains("codeCoverageReport".toLowerCase())) {
|
|
apply from: 'tools/coverage.gradle'
|
|
}
|