-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
100 lines (84 loc) · 2.51 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
apply plugin: 'apk-conventions'
def isPro = new File(projectDir, "build-pro.gradle").isFile()
if (isPro) {
apply from: "build-pro.gradle"
}
android {
namespace "com.mirfatif.mylocation"
defaultConfig {
applicationId namespace
versionCode 106
versionName "v1.06"
}
flavorDimensions.addAll('type', 'version')
productFlavors {
self {
dimension 'type'
}
ps {
dimension 'type'
applicationIdSuffix '.ps'
versionNameSuffix '-ps'
}
fdroid {
dimension 'type'
versionNameSuffix '-fd'
}
foss {
dimension 'version'
}
pro {
dimension 'version'
applicationIdSuffix '.pro'
versionNameSuffix '-pro'
}
}
variantFilter { variant ->
List names = variant.flavors*.name
if (!isPro) {
if (!names.contains('fdroid') || !names.contains('foss')) {
variant.setIgnore(true)
}
} else if (names.contains('ps') && names.contains('foss')) {
variant.setIgnore(true)
} else if (names.contains('fdroid') && names.contains('pro')) {
variant.setIgnore(true)
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
}
}
applicationVariants.configureEach { variant ->
def mf = variant.mergedFlavor
if (variant.flavorName == 'psPro' && variant.buildType.name == 'release') {
// No .pro suffix for Play Store Pro release
mf.setApplicationId(variant.applicationId.replace('.pro', ''))
}
String lfp = variant.applicationId + '.LogFileProvider'
mf.addManifestPlaceholders(LOG_FILE_PROVIDER: lfp)
variant.buildConfigField 'String', 'LOG_FILE_PROVIDER', '"' + lfp + '"'
}
buildFeatures {
aidl true
}
}
dependencies {
implementation libs.androidx.appcompat
implementation libs.androidx.recyclerview
implementation libs.androidx.browser
implementation libs.androidx.security.crypto
implementation libs.androidx.coordinator.layout
// For BottomSheetDialogFragment
implementation libs.material
// To handle hyperlink onClick in TextView
implementation libs.better.link.movement.method
debugImplementation libs.leakcanary.android
}
lsparanoid {
variantFilter {
!it.name.contains('Foss') && it.buildType != 'debug'
}
}