generated from LinXueyuanStdio/TimeCatModuleTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
context.gradle
38 lines (32 loc) · 1.21 KB
/
context.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
def loadProperties(filename) {
Properties properties = new Properties()
def file = new File(settingsDir, filename)
if (file.exists()) {
properties.load(file.newDataInputStream())
} else {
logger.warn("Properties file ${file} does not exist")
}
return properties
}
gradle.ext.appProperties = loadProperties('app.properties')
gradle.ext.moduleConfig = loadProperties('moduleConfig.properties')
gradle.ext.localMavenDir = file(gradle.ext.moduleConfig.localMavenPath)
gradle.ext.localGradleDir = file(gradle.ext.moduleConfig.localGradlePath)
// 引入composing的设置
apply from: "gradle/composingConfig.gradle"
// 遍历composing_dependencies中的所有配置
ext.getProperty("composing_dependencies").each { projectConfig ->
def isLocal = projectConfig["isLocal"]
def projectPath = projectConfig["projectPath"]
def projectMaven = projectConfig["projectMaven"]
def projectName = projectConfig["projectName"]
// 如果是本地依赖
if (isLocal) {
// 使用本地依赖进行替换
includeBuild(projectPath) {
dependencySubstitution {
substitute module(projectMaven) with project(projectName)
}
}
}
}