-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoduleBuild.gradle
More file actions
66 lines (61 loc) · 2.52 KB
/
moduleBuild.gradle
File metadata and controls
66 lines (61 loc) · 2.52 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
ext { // 构建相关
def buildToolsVer = "29.0.3"
def androidMinSdkVer = 21
def androidTargetSdkVer = 29
def androidCompileSdkVer = 29
domesticDebugApkFile = ""
domesticReleaseApkFile = ""
overseasDebugApkFile = ""
overseasReleaseApkFile = ""
// 基础层构建配置
gradle_base_lib = {
projectImp, kotlin = false, version_code = 1, version_name = "1.0", androidPlugin = 'com.android.library' ->
gradle_build_base(projectImp, kotlin, version_code, version_name, androidPlugin)
projectImp.dependencies {
// 全局依赖处理
projectImp.android.buildTypes.each {
buildType ->
"${buildType.name}Implementation" fileTree(dir: "${rootProject.projectDir.path}/libs/${buildType.name}", include: ['*.jar', '*.aar'])
}
}
}
// 基础的构建配置
gradle_build_base = {
projectImp, kotlin = false, version_code = 1, version_name = "1.0", androidPlugin = 'com.android.library' ->
println("=============>project:${projectImp.name} start<================")
projectImp.apply {
plugin androidPlugin
if (kotlin) {
plugin 'kotlin-android'
}
}
projectImp.android {
buildToolsVersion buildToolsVer
compileSdkVersion androidCompileSdkVer
defaultConfig {
minSdkVersion androidMinSdkVer
targetSdkVersion androidTargetSdkVer
versionCode version_code
versionName version_name
multiDexEnabled true
sourceSets {
main {
jniLibs.srcDirs = [projectImp.getProjectDir().toString() + '/libs']
}
}
consumerProguardFiles projectImp.getProjectDir().toString() + '/proguard-rules.pro'
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
projectImp.dependencies {
api fileTree(dir: projectImp.getProjectDir().toString() + '/libs', include: ['*.jar', '*.aar'])
// 可配置是否支持kotlin
if (kotlin) {
implementation sdk_kotlin
}
}
}
}