forked from NielsMasdorp/Nederadio-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
153 lines (132 loc) · 4.63 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
//google
ext.material_version = '1.12.0'
ext.app_distribution_plugin_version = '4.0.0'
//kotlin
ext.kotlin_version = '1.9.10'
ext.kotlinx_coroutines_android_version = '1.8.0'
ext.kotlinx_coroutines_core_version = '1.6.4'
ext.kotlinx_serialization_version = '1.3.2'
ext.kotlinx_guava_version = '1.6.4'
//androidx
ext.androidx_media3_version = '1.3.1'
ext.androidx_compose_version = '1.5.4'
ext.androidx_compose_material3_version = '1.2.1'
//koin
ext.koin_version = '3.5.3'
//ktor
ext.ktor_version = '2.3.9'
//accompanist
ext.accompanist_version = '0.32.0'
//misc
ext.landscapist_glide_version = '2.2.2'
ext.lottie_version = '6.4.0'
ext.vico_version = '1.6.5'
ext.easy_launcher_version = '6.2.0'
//test
ext.junit_version = "4.13.2"
ext.mockk_version = "1.13.10"
ext.coroutines_test_version = "1.3.7"
ext.coroutines_test_jvm_version = "1.6.0-RC2"
ext.androidx_espresso_version = "3.4.0"
ext.androidx_lifecycle_testing_version = "2.2.0"
ext.androidx_test_ext_junit_version = "1.1.3"
// Detekt
ext.detekt_version = "1.21.0"
ext.detekt_compose_version = "0.0.9"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.google.firebase:firebase-appdistribution-gradle:$app_distribution_plugin_version"
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "$detekt_version"
}
detekt {
input = files(collectSourceDirs())
parallel = true
autoCorrect = true
config = files("${rootProject.projectDir}/config/detekt/detekt.yml")
buildUponDefaultConfig = true
}
ext.getVersionCode = { ->
try {
def runNumber = System.getenv('GITHUB_RUN_NUMBER')
if (runNumber) {
return Integer.parseInt(runNumber)
}
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--first-parent', '--count', 'origin/main'
standardOutput = stdout
}
return Integer.parseInt(stdout.toString().trim())
}
catch (ignored) {
return 1
}
}
/**
* @return List of source directories from all subprojects.
*/
def collectSourceDirs() {
def sourceDirs = []
subprojects.each {
sourceDirs << file("${it.projectDir}/src/main/java")
sourceDirs << file("${it.projectDir}/src/main/kotlin")
sourceDirs << file("${it.projectDir}/src/test/java")
sourceDirs << file("${it.projectDir}/src/test/kotlin")
sourceDirs << file("${it.projectDir}/src/androidTest/java")
sourceDirs << file("${it.projectDir}/src/debug/java")
sourceDirs << file("${it.projectDir}/src/acceptance/java")
sourceDirs << file("${it.projectDir}/src/release/java")
}
return sourceDirs.findAll { it.exists() }
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detekt_version"
detektPlugins "com.twitter.compose.rules:detekt:$detekt_compose_version"
}
tasks.named("detekt").configure {
reports {
xml.required.set(false)
html.required.set(true)
html.outputLocation.set(file("build/reports/detekt.html"))
txt.required.set(false)
sarif.required.set(false)
md.required.set(false)
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += [
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
"-opt-in=androidx.compose.runtime.ExperimentalComposeApi",
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi"
]
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}