File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/main/kotlin/org/javacs/kt/classpath Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,9 @@ import java.io.File
9
9
import java.nio.file.FileSystems
10
10
import java.nio.file.Files
11
11
import java.nio.file.Path
12
- import org.gradle.tooling.GradleConnector
13
12
14
13
fun readBuildGradle (buildFile : Path ): Set <Path > {
15
14
val projectDirectory = buildFile.getParent()
16
- val connection = GradleConnector .newConnector()
17
- .forProjectDirectory(projectDirectory.toFile())
18
- .connect()
19
15
20
16
// The first successful dependency resolver is used
21
17
// (evaluating them from top to bottom)
@@ -27,13 +23,13 @@ fun readBuildGradle(buildFile: Path): Set<Path> {
27
23
LOG .warning(" Could not resolve Gradle dependencies using any resolution strategy!" )
28
24
}
29
25
30
- connection.close()
31
26
return dependencies
32
27
}
33
28
34
29
private fun createTemporaryGradleFile (): File {
35
30
val config = File .createTempFile(" classpath" , " .gradle" )
36
-
31
+ config.deleteOnExit()
32
+
37
33
LOG .info(" Creating temporary gradle file ${config.absolutePath} " )
38
34
39
35
config.bufferedWriter().use { configWriter ->
You can’t perform that action at this time.
0 commit comments