File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
server/src/main/kotlin/org/javacs/kt
shared/src/main/kotlin/org/javacs/kt Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -127,13 +127,17 @@ class CompilerClassPath(private val config: CompilerConfiguration) : Closeable {
127
127
}
128
128
}
129
129
130
- // TODO: Cut off branches that are excluded in the walker directly
131
130
private fun findJavaSourceFiles (root : Path ): Set <Path > {
132
131
val sourceMatcher = FileSystems .getDefault().getPathMatcher(" glob:*.java" )
133
132
val exclusions = SourceExclusions (root)
134
- return Files .walk(root)
135
- .filter { exclusions.isPathIncluded(it) && sourceMatcher.matches(it.fileName) }
136
- .collect(Collectors .toSet())
133
+ return root.toFile().walk()
134
+ .onEnter { exclusions.isPathIncluded(it.toPath()) }
135
+ .map { it.toPath() }
136
+ .filter {
137
+ // LOG.info("At $it")
138
+ sourceMatcher.matches(it)
139
+ }
140
+ .toSet()
137
141
}
138
142
139
143
private fun logAdded (sources : Collection <Path >, name : String ) {
Original file line number Diff line number Diff line change 1
1
package org.javacs.kt
2
2
3
3
import org.javacs.kt.util.filePath
4
+ import java.io.File
4
5
import java.net.URI
5
6
import java.nio.file.Path
6
7
import java.nio.file.Paths
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ package org.javacs.kt.util
2
2
3
3
import org.javacs.kt.LOG
4
4
import java.io.PrintStream
5
+ import java.nio.file.Files
5
6
import java.nio.file.Path
6
7
import java.nio.file.Paths
7
8
import java.net.URI
8
9
import java.util.concurrent.CompletableFuture
10
+ import java.util.stream.Stream
9
11
10
12
fun execAndReadStdout (shellCommand : String , directory : Path ): String {
11
13
val process = Runtime .getRuntime().exec(shellCommand, null , directory.toFile())
You can’t perform that action at this time.
0 commit comments