-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
86 lines (74 loc) · 2.23 KB
/
settings.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
import java.nio.file.Files
rootProject.name = 'ShadowStudy'
copyLocalPropertiesForIncludeBuilds()
includeBuild 'sdk/coding'
includeBuild 'sdk/core'
includeBuild 'sdk/dynamic'
// 集成宿主
includeHost()
// 集成插件管理
includeManager()
// 集成插件
includePlugin1()
includePlugin2()
includePlugin3()
/**
* 集成宿主
* */
def includeHost() {
include 'sample-constant',
'sample-host',
'sample-host-lib',
'sample-loader',
'sample-runtime'
project(':sample-constant').projectDir = file('host/sample-constant')
project(':sample-host').projectDir = file('host/sample-host')
project(':sample-host-lib').projectDir = file('host/sample-host-lib')
project(':sample-loader').projectDir = file('host/sample-loader')
project(':sample-runtime').projectDir = file('host/sample-runtime')
}
/**
* 集成 管理模块Manager
* */
def includeManager() {
include 'sample-manager'
project(':sample-manager').projectDir = file('manager/sample-manager')
}
/**
* 集成插件1
* */
def includePlugin1() {
include 'sample-app1'
project(':sample-app1').projectDir = file('plugin/sample-app1')
}
/**
* 集成插件2
* */
def includePlugin2() {
include 'sample-app2'
project(':sample-app2').projectDir = file('plugin/sample-app2')
}
/**
* 集成插件3
* */
def includePlugin3() {
include 'sample-app3'
project(':sample-app3').projectDir = file('plugin/sample-app3')
}
/**
* Android Studio当前不会为IncludeBuild创建包含sdk.dir的local.properties
* 使得没有ANDROID_HOME或等效环境变量时仅依赖根目录的local.properties无法编译IncludeBuild。
* 为了使此含有IncludeBuild的项目和其他不含有IncludeBuild的普通Android工程一样可以在
* 只有根目录的local.properties情况下正常编译,用此任务复制local.properties。
*/
def copyLocalPropertiesForIncludeBuilds() {
def rootFile = file('local.properties')
if (rootFile.exists()) {
['coding', 'core', 'dynamic'].forEach {
def includeBuildFile = file("sdk/${it}/local.properties")
if (!includeBuildFile.exists()) {
Files.copy(rootFile.toPath(), includeBuildFile.toPath())
}
}
}
}