Switch to File instead of String for classpaths in script dependencies
This commit is contained in:
committed by
Pavel V. Talanov
parent
5e3ba36cc1
commit
64bb47ed37
+4
-4
@@ -69,11 +69,11 @@ class KotlinScriptConfigurationManager(
|
||||
return allScriptsClasspathCache!!
|
||||
}
|
||||
|
||||
private fun String.classpathEntryToVfs(): VirtualFile =
|
||||
if (File(this).isDirectory)
|
||||
StandardFileSystems.local()?.findFileByPath(this) ?: throw FileNotFoundException("Classpath entry points to a non-existent location: ${this}")
|
||||
private fun File.classpathEntryToVfs(): VirtualFile =
|
||||
if (isDirectory)
|
||||
StandardFileSystems.local()?.findFileByPath(this.canonicalPath) ?: throw FileNotFoundException("Classpath entry points to a non-existent location: ${this}")
|
||||
else
|
||||
StandardFileSystems.jar()?.findFileByPath(this + URLUtil.JAR_SEPARATOR) ?: throw FileNotFoundException("Classpath entry points to a file that is not a JAR archive: ${this}")
|
||||
StandardFileSystems.jar()?.findFileByPath(this.canonicalPath + URLUtil.JAR_SEPARATOR) ?: throw FileNotFoundException("Classpath entry points to a file that is not a JAR archive: ${this}")
|
||||
|
||||
fun getAllScriptsClasspathScope(): GlobalSearchScope? {
|
||||
return getAllScriptsClasspath().let { cp ->
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class GradleScriptTemplateProvider(project: Project, gim: GradleInstallationMana
|
||||
override val templateClass: String = "org.gradle.script.lang.kotlin.KotlinBuildScript"
|
||||
override val dependenciesClasspath: Iterable<String> =
|
||||
gradleLibsPath?.listFiles { file -> file.extension == "jar" && depLibsPrefixes.any { file.name.startsWith(it) } }
|
||||
?.map { it.absolutePath }
|
||||
?.map { it.canonicalPath }
|
||||
?: emptyList()
|
||||
override val context: Any? = gradleHome
|
||||
|
||||
|
||||
Reference in New Issue
Block a user