-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle
More file actions
46 lines (41 loc) · 1.48 KB
/
Copy pathsettings.gradle
File metadata and controls
46 lines (41 loc) · 1.48 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
import java.nio.file.Paths
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.7.1/userguide/multi_project_builds.html
*/
// sample: https://github.com/spring-projects/spring-boot/blob/master/settings.gradle
// doc: https://docs.gradle.org/current/dsl/org.gradle.api.initialization.Settings.html
//pluginManagement {
// repositories {
// mavenLocal()
// jcenter()
// mavenCentral()
// gradlePluginPortal()
// }
//}
rootProject.name = 'root'
println "Here are gradle modules in this project:"
file("${rootDir}").eachDir {
it.eachDirMatch(~/.*/) {
if (it.list().contains("build.gradle")) {
def moduleName = "${it.parentFile.name}:${it.name}"
println " ${moduleName}"
include moduleName
// read
def project_dir = project(":${moduleName}").projectDir
def propFile = Paths.get("${project_dir}", "src", "main","resources","info.properties").toFile()
propFile.createNewFile()
Properties props = new Properties()
propFile.withInputStream {
props.load(it)
}
// write
props.setProperty("project.dir","$project_dir")
props.store propFile.newWriter(), null
}
}
}