-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
72 lines (58 loc) · 1.91 KB
/
build.gradle
File metadata and controls
72 lines (58 loc) · 1.91 KB
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.20'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// classpath 'com.google.gms:google-services:4.4.2'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// 每个编译版本所对应的组合。
def configList = [
['sdkversion': 25, 'buildToolsVersion': '26.0.2', 'supportVersion': '25.4.0'],
['sdkversion': 26, 'buildToolsVersion': '27.0.3', 'supportVersion': '26.0.2'],
['sdkversion': 27, 'buildToolsVersion': '', 'supportVersion': ''],
['sdkversion': 33, 'buildToolsVersion': '', 'supportVersion': ''],
]
def index = 3
// 设置external额外属性。
ext {
// 最小支持版本。
libMinSdkVersion = 15
appMinSdkVersion = 18
// 目标版本。
targetSdkVersion = configList[index].sdkversion
compileSdkVersion = configList[index].sdkversion
// 工具版本。
buildToolsVersion = configList[index].buildToolsVersion
supportVersion = configList[index].supportVersion
// 版本号。这里属性的版本号是主版本号,库可不引用此主版本号。
versionCode = 1
versionName = 1.0
// 是否混淆
minifyEnabled = true
shrinkResources = true
zipAlignEnabled = true
// app签名
storeFile = new File(project.projectDir, 'simplekey.jks')
storePassword = '12345678'
keyAlias = 'hy'
keyPassword = '12345678'
v1SigningEnabled = true
v2SigningEnabled = true
}