-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
60 lines (53 loc) · 1.83 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
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
google()
mavenCentral()
maven { url "https://maven.aliyun.com/repository/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Properties properties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
def stream = project.rootProject.file('local.properties').newDataInputStream()
properties.load(stream)
stream.close()
}
ext.getPropertyByName = { key, defValue ->
def value = properties.getProperty(key)
if (value == null) value = System.getenv(key)
return value != null ? value : defValue
}
ext {
int major = 2, minor = 1, revision = 0
configs = [
compileSdkVersion: 31,
minSdkVersion : 16,
targetSdkVersion : 29,
versionCode : major * 10000 + minor * 100 + revision,
versionName : major + "." + minor + "." + revision,
currentDate : new Date().format('yyMMdd-HH'),
test : getPropertyByName("APP_TEST_ENABLE", "false"),
redirect : getPropertyByName("REDIRECT_URL", ""),
redirectKey : getPropertyByName("REDIRECT_KEY", ""),
]
signInfo = [
storeFile : getPropertyByName("STORE_FILE", null),
storePassword: getPropertyByName("STORE_PASSWORD", null),
keyAlias : getPropertyByName("KEY_ALIAS", null),
keyPassword : getPropertyByName("KEY_PASSWORD", null),
]
signInfo.isSign = signInfo.storeFile != null && signInfo.keyAlias != null
}