-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
86 lines (67 loc) · 2.24 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
import org.edx.builder.ConfigHelper
import java.util.regex.Matcher
import java.util.regex.Pattern
buildscript {
ext {
kotlin_version = '1.9.22'
coroutines_version = '1.7.1'
compose_version = '1.6.2'
compose_compiler_version = '1.5.10'
}
}
plugins {
id 'com.android.application' version '8.4.0' apply false
id 'com.android.library' version '8.4.0' apply false
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
id 'com.google.gms.google-services' version '4.3.15' apply false
id "com.google.firebase.crashlytics" version "2.9.6" apply false
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}
ext {
core_version = "1.10.1"
appcompat_version = "1.6.1"
material_version = "1.11.0"
lifecycle_version = "2.7.0"
fragment_version = "1.6.2"
constraintlayout_version = "2.1.4"
viewpager2_version = "1.0.0"
media3_version = "1.1.1"
youtubeplayer_version = "11.1.0"
firebase_version = "32.1.0"
retrofit_version = '2.9.0'
logginginterceptor_version = '4.9.1'
koin_version = '3.2.0'
coil_version = '2.3.0'
jsoup_version = '1.13.1'
room_version = '2.6.1'
work_version = '2.9.0'
window_version = '1.2.0'
in_app_review = '2.0.1'
extented_spans_version = "1.3.0"
configHelper = new ConfigHelper(projectDir, getCurrentFlavor())
//testing
mockk_version = '1.13.3'
android_arch_version = '2.2.0'
junit_version = '4.13.2'
}
def getCurrentFlavor() {
String tskReqStr = getGradle().getStartParameter().getTaskRequests().toString()
Pattern pattern
if (tskReqStr.contains("assemble")) // to run ./gradlew assembleRelease to build APK
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
else if (tskReqStr.contains("bundle")) // to run ./gradlew bundleRelease to build .aab
pattern = Pattern.compile("bundle(\\w+)(Release|Debug)")
else
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")
Matcher matcher = pattern.matcher(tskReqStr)
if (matcher.find()) {
return matcher.group(1).toLowerCase()
} else {
return ""
}
}
task generateMockedRawFile() {
doLast { configHelper.generateMicrosoftConfig() }
}