-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle
More file actions
57 lines (44 loc) · 1.92 KB
/
settings.gradle
File metadata and controls
57 lines (44 loc) · 1.92 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
/*
* This settings file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* In a single project build this file can be empty or even removed.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.0-20170506235917+0000/userguide/multi_project_builds.html
*/
rootProject.name = 'GradleJDK9modular'
include 'ModuleA'
include 'ModuleB'
println()
println("${rootProject.name}'s sub-projects (modules):")
rootProject.children.each {project ->
// e.g. 'modules/com.company.ModuleA',
// 'modules/ModuleA'
project.projectDir = new File("modules/$project.name")
println(":subproject ${project.name}: ${project.projectDir}")
// e.g. 'com.company.ModuleA' --> 'ModuleA.build.gradle',
// 'ModuleA' --> 'ModuleA.build.gradle'
String fileName = project.name
fileName = fileName.substring(fileName.lastIndexOf(".") + 1).trim()
project.buildFileName = "${fileName}.build.gradle"
assert project.projectDir.isDirectory()
assert project.buildFile.isFile()
}
/*
// More straightforward ways:
// 1. Module names comply with the reverse Internet domain-name convention
include 'com.company.ModuleA'
include 'com.company.ModuleB'
project(":com.company.ModuleA").projectDir = file("modules/com.company.ModuleA")
project(":com.company.ModuleB").projectDir = file("modules/com.company.ModuleB")
project(":com.company.ModuleA").buildFileName = file("ModuleA.build.gradle")
project(":com.company.ModuleB").buildFileName = file("ModuleB.build.gradle")
// 2. Simple module names
include 'ModuleA'
include 'ModuleB'
project(":ModuleA").projectDir = file("modules/ModuleA")
project(":ModuleB").projectDir = file("modules/ModuleB")
project(":ModuleA").buildFileName = file("ModuleA.build.gradle")
project(":ModuleB").buildFileName = file("ModuleB.build.gradle")
*/