forked from gzu-liyujiang/AndroidPicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·100 lines (85 loc) · 3 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
//参考:https://raw.github.com/dm77/barcodescanner/master/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
allprojects {
group = GROUP
version = VERSION_NAME
repositories {
jcenter() //bintray的maven库
mavenCentral() //sonatype的maven库
mavenLocal() //本地的maven库
maven {
url "https://www.jitpack.io" //jitpack的maven库
}
flatDir {
dirs 'libs' //本地aar文件
}
}
ext {
isLibrary = false
pomArtifactId = project.name
pomVersion = VERSION_NAME
pomDescription = 'This is library description'
}
}
subprojects {
afterEvaluate { Project project ->
ext.pluginContainer = project.getPlugins()
def hasAppPlugin = ext.pluginContainer.hasPlugin("com.android.application")
def hasLibPlugin = ext.pluginContainer.hasPlugin("com.android.library")
if (hasAppPlugin || hasLibPlugin) {
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOL_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode VERSION_CODE as int
versionName VERSION_NAME
}
buildTypes {
release {
debuggable false
minifyEnabled false //实时构建库项目时若启用混淆,APP模块引用会造成部分方法找不到
}
debug {
debuggable true
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/ASL2.0'
}
}
dependencies {
compile "com.android.support:support-v4:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:support-annotations:${ANDROID_SUPPORT_VERSION}"
}
}
if (project.isLibrary) {
configure(project) {
apply from: "${rootDir}/publish.gradle" //调用发布脚本
}
}
}
}