blob: 859203a9483492402f11cc437b6b19d9e111bfeb (
plain)
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
|
/*
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
import flavors.FlavorDimensions
import flavors.ProductFlavors
import signing.configureBuildSigning
plugins {
id("com.android.application")
id("com.github.android-password-store.android-common")
}
fun Project.isSnapshot(): Boolean {
with(project.providers) {
val workflow = environmentVariable("GITHUB_WORKFLOW")
val snapshot = environmentVariable("SNAPSHOT")
return workflow.isPresent || snapshot.isPresent
}
}
android {
val minifySwitch = project.providers.environmentVariable("DISABLE_MINIFY")
adbOptions.installOptions("--user 0")
dependenciesInfo {
includeInBundle = false
includeInApk = false
}
buildFeatures {
viewBinding = true
buildConfig = true
}
buildTypes {
named("release") {
isMinifyEnabled = !minifySwitch.isPresent
setProguardFiles(
listOf(
"proguard-android-optimize.txt",
"proguard-rules.pro",
"proguard-rules-missing-classes.pro",
)
)
buildConfigField("boolean", "ENABLE_DEBUG_FEATURES", "${project.isSnapshot()}")
}
named("debug") {
applicationIdSuffix = ".debug"
versionNameSuffix = "-debug"
isMinifyEnabled = false
buildConfigField("boolean", "ENABLE_DEBUG_FEATURES", "true")
}
}
flavorDimensions.add(FlavorDimensions.FREE)
productFlavors {
register(ProductFlavors.FREE) {}
register(ProductFlavors.NON_FREE) {}
}
project.configureBuildSigning()
}
|