Slackbot
03/18/2022, 11:48 AMCristianGM
03/18/2022, 12:20 PMCristianGM
03/18/2022, 12:22 PMCristianGM
03/18/2022, 12:36 PMCristianGM
03/18/2022, 12:41 PMclass Test {
@get:Rule
val testProjectDir = TemporaryFolder()
@Test
fun test() {
val subDir = File(testProjectDir.root, "my/nested/child/project").also { it.mkdirs() }
val rootProject = ProjectBuilder.builder().withProjectDir(testProjectDir.root).build()
val my = ProjectBuilder.builder()
.withProjectDir(File(testProjectDir.root, "my"))
.withName("my")
.withParent(rootProject)
.build()
val child = ProjectBuilder.builder()
.withProjectDir(subDir)
.withName("example-project")
.withParent(my)
.build()
println(child.path)
}
}CristianGM
03/18/2022, 12:41 PMPaul Blundell
03/18/2022, 1:06 PMVampire
03/18/2022, 1:28 PMa:b:c, then you effectively create three projects that happen to also live in the respective directory structure by default. But you can also include foo and set its project directory to a/b/c.Paul Blundell
03/18/2022, 2:27 PMVampire
03/18/2022, 2:28 PMPaul Blundell
03/18/2022, 2:31 PMVampire
03/18/2022, 2:31 PMinclude("a:b:c") in the settings script it is the same as doing include("a"); include("a:b"); include("a:b:c").
You are registering three projects a, b, and c that happen to live in a/, a/b/, and a/b/c.
There is no project with name my:nested:child:project.
There is a project with name project that is the child of the project child which is the child of the project nested which is the child of the project my.
Imagine the task graph like a filesystem where : is the path separator.Paul Blundell
03/18/2022, 2:32 PMVampire
03/18/2022, 2:33 PMinclude("c") and then set the project directory of that project to be a/b/c.
The directories don't "have to be own projects", that just the conventional default.Vampire
03/18/2022, 2:34 PMOk, so in the original question I am trying to recreate the gradle project structure. Therefore making each of the path segments a project sounds right?Definitely, Cristian was totally right. Just wanted to clarify on "all directories need to be own projects"
Paul Blundell
03/18/2022, 2:34 PMVampire
03/18/2022, 2:34 PMPaul Blundell
03/18/2022, 2:35 PMVampire
03/18/2022, 2:36 PMsubprojects { ... } or allprojects { ... } blocks,
so in some projects the whole build logic was just in the root project, so no build scripts needed for the individual projects.Vampire
03/18/2022, 2:36 PM