-
-
Notifications
You must be signed in to change notification settings - Fork 325
/
build.gradle
143 lines (117 loc) · 4.37 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
apply plugin: 'com.android.application'
// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("keystore.properties")
// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()
// Load your keystore.properties file into the keystoreProperties object.
if (keystorePropertiesFile.canRead()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
/* gets the version name from the latest Git tag, stripping the leading v off */
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always'
standardOutput = stdout
}
return stdout.toString().trim()
}
android {
signingConfigs {
release {
if (keystorePropertiesFile.canRead()) {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
compileSdkVersion 29
buildToolsVersion '29.0.0'
defaultConfig {
applicationId "org.torproject.android"
versionName getVersionName()
minSdkVersion 16
targetSdkVersion 29
}
aaptOptions {
cruncherEnabled = false
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
aaptOptions {
cruncherEnabled = false
}
flavorDimensions "free"
productFlavors {
fullperm {
dimension "free"
minSdkVersion 16
applicationId 'org.torproject.android'
targetSdkVersion 28
versionCode 16123000
versionName getVersionName()
archivesBaseName = "Orbot-$versionName"
}
appmax {
dimension "free"
minSdkVersion 16
applicationId 'org.torproject.android.max'
targetSdkVersion 28
versionCode 16123000
versionName '16.1.2-RC-2-tor-0.4.1.5-rc'
archivesBaseName = "orbotMAX-$versionName"
}
}
splits {
// Configures multiple APKs based on ABI. This helps keep the size down, since PT binaries can be large.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86 and x86_64.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "armeabi-v7a", "x86_64", "arm64-v8a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
}
dependencies {
implementation project(':orbotservice')
implementation 'com.android.support:design:28.0.0'
implementation 'pl.bclogic:pulsator4droid:1.0.3'
implementation 'com.github.apl-devs:appintro:v4.2.2'
implementation 'com.github.javiersantos:AppUpdater:2.6.4'
androidTestImplementation "tools.fastlane:screengrab:1.2.0"
}
// Map for the version code that gives each ABI a value.
ext.abiCodes = ['armeabi-v7a':'1', 'arm64-v8a':'2', 'mips':'3', 'x86':'4', 'x86_64':'5']
import com.android.build.OutputFile
// For each APK output variant, override version code of outputs based on ABI codes
// ex) 'mips' -> 3xxx
// ex) 'x86' -> 4xxx
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def baseVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
if (baseVersionCode != null) {
output.versionCodeOverride = Integer.valueOf(baseVersionCode + variant.versionCode)
}
}
}