Readrops/build.gradle

96 lines
2.8 KiB
Groovy
Raw Normal View History

2019-01-12 13:10:02 +01:00
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
2023-02-20 19:13:06 +01:00
ext.kotlin_version = '1.8.0'
2019-09-14 12:56:10 +02:00
2019-01-12 13:10:02 +01:00
repositories {
google()
2021-07-02 18:56:11 +02:00
mavenCentral()
2019-01-12 13:10:02 +01:00
}
dependencies {
2023-08-15 22:44:44 +02:00
classpath 'com.android.tools.build:gradle:8.1.0'
2019-09-14 12:56:10 +02:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2021-09-16 22:29:25 +02:00
classpath "org.jacoco:org.jacoco.core:0.8.7"
2019-01-12 13:10:02 +01:00
}
}
allprojects {
2021-09-16 22:29:25 +02:00
apply plugin: 'jacoco'
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
}
afterEvaluate {
tasks.withType(JavaCompile.class) {
options.compilerArgs << "-Xmaxerrs" << "1000"
}
}
2019-01-12 13:10:02 +01:00
}
ext {
2023-02-21 21:44:02 +01:00
compileSdkVersion = 33
minSdkVersion = 21
2023-02-21 21:44:02 +01:00
targetSdkVersion = 33
buildToolsVersion = "33.0.2"
2021-09-20 19:27:12 +02:00
koin_version = "3.3.3"
}
2023-08-15 22:44:44 +02:00
tasks.register('clean', Delete) {
2019-01-12 13:10:02 +01:00
delete rootProject.buildDir
2021-09-16 22:29:25 +02:00
}
jacoco {
toolVersion = "0.8.7"
}
2023-08-15 22:44:44 +02:00
tasks.register('jacocoFullReport', JacocoReport) {
2021-09-16 22:29:25 +02:00
group = 'Reporting'
description = "Generate Jacoco coverage reports for the debug build"
reports {
html {
enabled true
destination file('build/reports/jacoco/html')
}
xml {
enabled true
destination file('build/reports/jacoco/jacocoFullReport.xml')
}
}
dependsOn ":app:testDebugUnitTest"
dependsOn ":api:testDebugUnitTest"
dependsOn ":db:testDebugUnitTest"
dependsOn ":app:connectedAndroidTest"
dependsOn ":db:connectedAndroidTest"
2021-09-16 22:29:25 +02:00
final fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', 'android/**/*.*']
classDirectories.setFrom files([
fileTree(dir: "$project.rootDir/app/build/intermediates/javac/debug", excludes: fileFilter),
fileTree(dir: "$project.rootDir/app/build/tmp/kotlin-classes/debug", excludes: fileFilter),
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
])
}