-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsubModuleHeader.gradle
More file actions
executable file
·99 lines (92 loc) · 2.91 KB
/
subModuleHeader.gradle
File metadata and controls
executable file
·99 lines (92 loc) · 2.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
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
ext.moduleName = getName()
ext.isModuleIndependent = moduleName == singleModuleKey.toString()
def applyPlugin = {
if (isModuleIndependent) {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
}
def commonConfigure = {
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions.includeCompileClasspath = true
}
}
buildTypes {
release {
minifyEnabled false
consumerProguardFiles 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
}
def appConfigure = {
if (isModuleIndependent) {
android.with {
signingConfigs {
config {
keyAlias 'towards'
keyPassword 'towards123'
storeFile file('towards_store.jks')
storePassword 'towards123'
}
}
buildTypes {
release {
//签名配置
signingConfig = signingConfigs.config
//混淆打开
minifyEnabled false
//ZipAlign优化
zipAlignEnabled false
//移除无用的resource文件 资源压缩
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), project.file('proguard-rules.pro')
}
debug {
//签名配置
signingConfig = signingConfigs.config
applicationIdSuffix ".debug"
}
}
dexOptions {
javaMaxHeapSize "12g"
jumboMode true
preDexLibraries false
}
}
}
}
ext.globleConfigure = {
try {
applyPlugin()
commonConfigure()
appConfigure()
println "配置完成---------------${moduleName}-------------------"
} catch (Exception e) {
throw new Exception("android app configure 配置出错,详情e:" + e.getMessage())
}
}