-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
81 lines (73 loc) · 2.91 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
minSdkVersion = 26
targetSdkVersion = 34
compileSdkVersion = 34
def runTasks = gradle.startParameter.taskNames
def releaseTaskNames = ["aR", "assembleRelease", "bundleRelease"]
if (releaseTaskNames.any { name -> name in runTasks }) {
println "Skipping preview SDK (if any) for production build"
} else {
def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
def targetSdkVersionDevPreview = localProperties['target.sdk.version.dev.preview']
def compileSdkVersionDevPreview = localProperties['compile.sdk.version.dev.preview']
if (targetSdkVersionDevPreview == null || compileSdkVersionDevPreview == null) {
println "Preview SDK not defined, using SDK version $targetSdkVersion"
}
if (targetSdkVersionDevPreview?.trim() && compileSdkVersionDevPreview?.trim()) {
println "Using preview SDK: $targetSdkVersionDevPreview"
targetSdkVersion = targetSdkVersionDevPreview
compileSdkVersion = compileSdkVersionDevPreview
}
}
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.versiondependency)
alias(libs.plugins.graphviz)
}
subprojects {
apply plugin: "io.gitlab.arturbosch.detekt"
detekt {
buildUponDefaultConfig = true
config = files("${project.rootDir}/config/detekt/detekt.yml")
parallel = true
}
dependencies {
detektPlugins(libs.detekt.plugin.formatting)
}
if (name == "app") {
apply plugin: "com.android.application"
} else {
apply plugin: "com.android.library"
}
android {
lint {
lintConfig file("${project.rootDir}/config/lint/lint.xml")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
// -Xjvm-default=all required by coil https://coil-kt.github.io/coil/getting_started/#java-8
freeCompilerArgs = [
'-Xjvm-default=all',
"-Xjavac-arguments='-Xlint:unchecked -Xlint:deprecation'"
]
jvmTarget = JvmTarget.JVM_1_8
}
}
}
}