forked from IITC-CE/ingress-intel-total-conversion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
121 lines (108 loc) · 4.06 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
apply plugin: 'com.android.application'
final BUILD_DATE = new Date().format('yyyy.MM.dd-HH:mm')
def getVersionCodeTimeStamps = { ->
def git = 'git log -1 --pretty=format:%ct'
def proc = git.execute()
proc.waitFor()
def unixtime = "${proc.in.text}".trim()
if (unixtime.isEmpty()) {
println "Failed to get commit date"
return -1
}
return Integer.parseInt(unixtime)
}
def metaFDroid(outputFileName) {
new File(outputFileName, "version_fdroid.txt").text = [
["versionName", android.defaultConfig.versionName].join("="),
["versionCode", android.defaultConfig.versionCode].join("="),
].join("\n")
}
android {
compileSdkVersion 29
buildToolsVersion = '29.0.3'
defaultConfig {
applicationId "org.exarhteam.iitc_mobile"
minSdkVersion 17
targetSdkVersion 29
versionCode = getVersionCodeTimeStamps()
versionName "0.38.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
storeFile file("../keystore/debug.keystore")
}
release {
if (System.getenv("CI")) {
storeFile file("../keystore/android.jks")
storePassword System.getenv("KEYSTORE_PASS")
keyAlias System.getenv("ALIAS_NAME")
keyPassword System.getenv("ALIAS_PASS")
} else {
// We use keystore.properties file for signing data.
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-test-$BUILD_DATE"
minifyEnabled false
signingConfig signingConfigs.debug
buildConfigField "boolean", "ENABLE_CHECK_APP_UPDATES", "false"
}
beta {
applicationIdSuffix ".beta"
versionNameSuffix "-beta-$BUILD_DATE"
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildConfigField "boolean", "ENABLE_CHECK_APP_UPDATES", System.getenv("ENABLE_CHECK_APP_UPDATES") == "true" ? "true" : "false"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildConfigField "boolean", "ENABLE_CHECK_APP_UPDATES", System.getenv("ENABLE_CHECK_APP_UPDATES") == "true" ? "true" : "false"
}
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
applicationVariants.all { variant ->
variant.resValue "string", "application_id", variant.applicationId
variant.getAssembleProvider().configure() {
it.doLast {
metaFDroid(variant.getPackageApplicationProvider().get().outputDirectory)
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.github.AppIntro:AppIntro:6.0.0'
implementation 'com.akexorcist:localization:1.2.5'
implementation 'org.apache.commons:commons-text:1.8'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.melnykov:floatingactionbutton:1.3.0'
testImplementation 'junit:junit:4.12'
}
task copyUserscripts(type: Copy) {
description = 'Updating prebuilt plugins'
from '../assets'
into 'src/main/assets'
include('*')
include('**/*')
}
preBuild.dependsOn copyUserscripts