forked from HabitRPG/habitica-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
125 lines (112 loc) · 4.5 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
min_sdk = 21
target_sdk = 33
app_version_name = ''
app_version_code = 0
accompanist_version = '0.28.0'
amplitude_version = '1.6.1'
appcompat_version = '1.6.1'
coil_version = '2.2.2'
compose_version = '1.4.3'
core_ktx_version = '1.10.0'
coroutines_version = '1.6.4'
daggerhilt_version = '2.44.2'
firebase_bom = '31.3.0'
kotest_version = '5.5.5'
kotlin_version = '1.8.20'
ktlint_version = '0.48.2'
lifecycle_version = '2.6.1'
markwon_version = '4.6.2'
mockk_version = '1.13.4'
moshi_version = '1.14.0'
navigation_version = '2.5.3'
okhttp_version = '4.10.0'
play_wearables_version = '18.0.0'
play_auth_version = '20.5.0'
preferences_version = '1.2.0'
realm_version = '1.0.2'
retrofit_version = '2.9.0'
recyclerview_version = '1.3.0'
}
repositories {
google()
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
classpath "io.realm:realm-gradle-plugin:10.13.2-transformer-api"
classpath("io.realm.kotlin:gradle-plugin:$realm_version")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
classpath 'com.google.firebase:perf-plugin:1.4.2'
classpath "com.google.dagger:hilt-android-gradle-plugin:$daggerhilt_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.1"
}
}
apply plugin: 'io.gitlab.arturbosch.detekt'
allprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
repositories {
google()
mavenCentral()
}
tasks.withType(Test).configureEach {
testLogging {
events "passed", "skipped", "failed", "standardError"
outputs.upToDateWhen {false}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
}
Properties props = new Properties()
def propFile = new File('version.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('NAME') && props.containsKey('CODE') ) {
ext.app_version_name = props['NAME']
ext.app_version_code = props['CODE'] as Integer
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
detekt {
source = files("Habitica/src/main/java")
config = files("detekt.yml")
baseline = file("${rootProject.projectDir}/detekt_baseline.xml")
}
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(true)
sarif.outputLocation.set(file("build/reports/detekt.sarif"))
}
}
task allUnitTests(type: GradleBuild) {
tasks = [':Habitica:testProdDebugUnitTest', ':wearos:testProdDebugUnitTest', ':common:testProdDebugUnitTest', ':shared:testDebugUnitTest']
}
subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "11"
}
}