Skip to content

Commit 1e6a91c

Browse files
authored
Merge pull request #73 from alps2006/main
feat(submodule): support project that has multiple submodules.
2 parents 30fb24f + 7dd432b commit 1e6a91c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

adapter/src/main/kotlin/org/javacs/ktda/jdi/launch/JDILauncher.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@ class JDILauncher(
7575
.let { it.find { it.javaClass.name == "com.sun.tools.jdi.SunCommandLineLauncher" } ?: it.firstOrNull() }
7676
?: throw KotlinDAException("Could not find a launching connector (for a new debuggee VM)")
7777

78-
private fun sourcesRootsOf(projectRoot: Path): Set<Path> = projectRoot.resolve("src")
79-
.let(Files::list) // main, test
80-
.filter { Files.isDirectory(it) }
81-
.flatMap(Files::list) // kotlin, java
82-
.filter { Files.isDirectory(it) }
83-
.collect(Collectors.toSet())
78+
private fun sourcesRootsOf(projectRoot: Path): Set<Path> =
79+
Files.walk(projectRoot, 2) // root project and submodule
80+
.filter { Files.isDirectory(it) }
81+
.map { it.resolve("src") }
82+
.filter { Files.isDirectory(it) }
83+
.flatMap(Files::list) // main, test
84+
.filter { Files.isDirectory(it) }
85+
.flatMap(Files::list) // kotlin, java
86+
.filter { Files.isDirectory(it) }
87+
.collect(Collectors.toSet())
8488

8589
private fun formatOptions(config: LaunchConfiguration): String {
8690
var options = config.vmArguments

0 commit comments

Comments
 (0)