-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
68 lines (55 loc) · 1.96 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
import org.edx.builder.ConfigHelper
import java.util.regex.Matcher
import java.util.regex.Pattern
buildscript {
ext {
//Depends on versions in OEXFoundation
kotlin_version = '2.0.0'
room_version = '2.6.1'
}
}
plugins {
id 'com.android.application' version '8.5.2' apply false
id 'com.android.library' version '8.5.2' apply false
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
id 'com.google.gms.google-services' version '4.4.2' apply false
id "com.google.firebase.crashlytics" version "3.0.2" apply false
id "com.google.devtools.ksp" version "2.0.0-1.0.24" apply false
id "org.jetbrains.kotlin.plugin.compose" version "$kotlin_version" apply false
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}
ext {
media3_version = "1.4.1"
youtubeplayer_version = "11.1.0"
firebase_version = "33.0.0"
jsoup_version = '1.13.1'
in_app_review = '2.0.1'
extented_spans_version = "1.3.0"
configHelper = new ConfigHelper(projectDir, getCurrentFlavor())
zip_version = '2.6.3'
//testing
mockk_version = '1.13.12'
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 ""
}
}
tasks.register('generateMockedRawFile') {
doLast { configHelper.generateMicrosoftConfig() }
}