-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
114 lines (100 loc) · 3.56 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
apply plugin: 'com.android.application'
def releaseTime() {
return new Date().format("yyyy-MM-dd")
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId rootProject.ext.applicationId
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
}
signingConfigs {
def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
signingConfigs {
release {
storeFile file(props['store_file'])
storePassword props['store_password']
keyAlias props['key_alias']
keyPassword props['key_password']
}
debug {
storeFile file(props['store_file'])
storePassword props['store_password']
keyAlias props['key_alias']
keyPassword props['key_password']
}
}
} else {
signingConfigs {
debug {
println 'signing.properties not found'
}
}
}
}
buildTypes {
release {
//proguard 使用
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//lint 配置
lintOptions {
abortOnError false
}
//配置java 版本
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
//输出文件配置
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
def intoFile = "D:\\immediateRelease"
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名
def fileName = "immediatel-${defaultConfig.versionCode}}.apk"
output.outputFile = new File(intoFile, fileName)
}
if (variant.getBuildType().isMinifyEnabled()) {
variant.assemble.doLast {
copy {
from variant.mappingFile
into intoFile
rename { String fileName ->
"mapping-${defaultConfig.versionCode}-${releaseTime()}.txt"
}
}
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile project(':tlibrary')
compile project(':okhttputils')
compile('com.squareup.okhttp3:mockwebserver:3.2.0') {
exclude(group: 'junit', module: 'junit')
}
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
compile 'com.facebook.fresco:fresco:1.0.0'
compile 'com.roughike:bottom-bar:1.4.0'
compile 'io.reactivex:rxjava:1.1.6'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.5'
}