Readrops/build.gradle.kts

141 lines
3.9 KiB
Plaintext
Raw Normal View History

2024-08-05 23:28:04 +02:00
2024-07-04 17:37:03 +02:00
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.LibraryPlugin
2024-08-05 23:28:04 +02:00
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
2019-01-12 13:10:02 +01:00
buildscript {
repositories {
2024-07-07 12:48:20 +02:00
gradlePluginPortal()
2019-01-12 13:10:02 +01:00
google()
2021-07-02 18:56:11 +02:00
mavenCentral()
2019-01-12 13:10:02 +01:00
}
2024-07-04 17:37:03 +02:00
2019-01-12 13:10:02 +01:00
dependencies {
classpath(libs.android.agp)
classpath(libs.kotlin.kgp)
classpath(libs.jacoco)
2024-07-07 12:48:20 +02:00
classpath(libs.aboutlibraries)
2019-01-12 13:10:02 +01:00
}
}
2024-07-06 14:01:58 +02:00
plugins {
alias(libs.plugins.ksp) apply false
2024-08-05 23:28:04 +02:00
alias(libs.plugins.compose.compiler) apply false
2024-07-06 14:01:58 +02:00
}
2019-01-12 13:10:02 +01:00
allprojects {
//apply("jacoco")
2021-09-16 22:29:25 +02:00
2019-01-12 13:10:02 +01:00
repositories {
google()
2019-09-14 12:56:10 +02:00
mavenCentral()
maven(url = "https://jitpack.io")
2019-01-12 13:10:02 +01:00
}
}
2024-07-04 17:37:03 +02:00
subprojects {
afterEvaluate {
2024-08-05 23:28:04 +02:00
with(extensions.getByType<KotlinAndroidProjectExtension>()) {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
2024-07-04 17:37:03 +02:00
}
}
plugins.withType<AppPlugin> {
configure<BaseExtension> {
configure(this)
}
}
plugins.withType<LibraryPlugin> {
configure<LibraryExtension> {
configure(this)
}
}
}
}
fun configure(extension: BaseExtension) = with(extension) {
compileSdkVersion(34)
defaultConfig {
minSdk = 21
targetSdk = 34
buildToolsVersion = "34.0.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
lintOptions.isAbortOnError = false
/*dependencies {
add("coreLibraryDesugaring", libs.jdk.desugar)
}*/
}
tasks.register<Delete>("clean") {
2024-08-05 23:28:04 +02:00
delete(rootProject.layout.buildDirectory)
2021-09-16 22:29:25 +02:00
}
/*jacoco {
2021-09-16 22:29:25 +02:00
toolVersion = "0.8.7"
}
tasks.register("jacocoFullReport", JacocoReport) {
group = "Reporting"
2021-09-16 22:29:25 +02:00
description = "Generate Jacoco coverage reports for the debug build"
reports {
html {
enabled true
destination file("build/reports/jacoco/html")
2021-09-16 22:29:25 +02:00
}
xml {
enabled true
destination file("build/reports/jacoco/jacocoFullReport.xml")
2021-09-16 22:29:25 +02:00
}
}
2024-07-02 18:43:14 +02:00
//dependsOn ":app:testDebugUnitTest"
2021-09-16 22:29:25 +02:00
dependsOn ":api:testDebugUnitTest"
dependsOn ":db:testDebugUnitTest"
2024-07-02 18:43:14 +02:00
//dependsOn ":app:connectedAndroidTest"
dependsOn ":db:connectedAndroidTest"*/
2021-09-16 22:29:25 +02:00
2024-07-04 17:37:03 +02:00
//final fileFilter = ["**/R.class", "**/R\$*.class", "**/BuildConfig.*", "**/Manifest*.*", "android/**/*.*"]
2021-09-16 22:29:25 +02:00
/* classDirectories.setFrom files([
2024-07-02 18:43:14 +02:00
//fileTree(dir: "$project.rootDir/app/build/intermediates/javac/debug", excludes: fileFilter),
//fileTree(dir: "$project.rootDir/app/build/tmp/kotlin-classes/debug", excludes: fileFilter),
2021-09-16 22:29:25 +02:00
fileTree(dir: "$project.rootDir/api/build/intermediates/javac/debug", excludes: fileFilter),
fileTree(dir: "$project.rootDir/api/build/tmp/kotlin-classes/debug", excludes: fileFilter),
fileTree(dir: "$project.rootDir/db/build/tmp/kotlin-classes/debug", excludes: fileFilter),
])
def coverageSourceDirs = [
"$project.rootDir/app/src/main/java",
"$project.rootDir/api/src/main/java",
"$project.rootDir/db/src/main/java",
]
additionalSourceDirs.setFrom files(coverageSourceDirs)
sourceDirectories.setFrom files(coverageSourceDirs)
executionData.setFrom fileTree(dir: project.rootDir, includes: [
"app/jacoco.exec",
"db/jacoco.exec",
"api/jacoco.exec",
"app/build/outputs/code_coverage/debugAndroidTest/connected/*-coverage.ec",
"db/build/outputs/code_coverage/debugAndroidTest/connected/*-coverage.ec"
2021-09-16 22:29:25 +02:00
])
}*/