/
build.gradle
60 lines (53 loc) · 1.81 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
apply plugin: 'com.android.library'
apply from: rootProject.file("maven.gradle")
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
compileOptions {
sourceCompatibility rootProject.javaVersion
targetCompatibility rootProject.javaVersion
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':reader')
testCompile 'junit:junit:4.12'
}
/**
* 在向jcenter等仓库发布类库时,不要使用api和implementation替代compile添加依赖。
*
* compile引用的类库,生成maven pom时会带类库依赖信息:
* <modelVersion>4.0.0</modelVersion>
* <groupId>com.leon.channel</groupId>
* <artifactId>helper</artifactId>
* <version>1.1.1</version>
* <packaging>aar</packaging>
* <dependencies>
* <dependency>
* <groupId>com.leon.channel</groupId>
* <artifactId>reader</artifactId>
* <version>1.1.1</version>
* <scope>compile</scope>
* </dependency>
* </dependencies>
*
* 而api和implementation引用的类库,生成的maven pom不会带类库依赖信息
*
* 如果没有helper类库的依赖信息,那么就会导致在使用helper类库时,只会把helper类库打包到APK,而helper依赖的类库不会打包到APK,导致运行时找不到类
*/