Filter java.endorsed.dirs in compiler runner (#2155)
This commit is contained in:
+7
-3
@@ -51,6 +51,9 @@ internal abstract class KonanCliRunner(
|
|||||||
} ?: emptyList<String>()
|
} ?: emptyList<String>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected val blacklistProperties: Set<String> =
|
||||||
|
setOf("java.endorsed.dirs")
|
||||||
|
|
||||||
override val classpath: FileCollection =
|
override val classpath: FileCollection =
|
||||||
project.fileTree("${project.konanHome}/konan/lib/")
|
project.fileTree("${project.konanHome}/konan/lib/")
|
||||||
.apply { include("*.jar") }
|
.apply { include("*.jar") }
|
||||||
@@ -73,7 +76,7 @@ internal abstract class KonanCliRunner(
|
|||||||
|
|
||||||
private fun String.escapeQuotes() = replace("\"", "\\\"")
|
private fun String.escapeQuotes() = replace("\"", "\\\"")
|
||||||
|
|
||||||
private fun List<Pair<String, String>>.escapeQuotesForWindows() =
|
private fun Sequence<Pair<String, String>>.escapeQuotesForWindows() =
|
||||||
if (HostManager.hostIsMingw) {
|
if (HostManager.hostIsMingw) {
|
||||||
map { (key, value) -> key.escapeQuotes() to value.escapeQuotes() }
|
map { (key, value) -> key.escapeQuotes() to value.escapeQuotes() }
|
||||||
} else {
|
} else {
|
||||||
@@ -86,7 +89,7 @@ internal abstract class KonanCliRunner(
|
|||||||
project.logger.info("Run tool: $toolName with args: ${args.joinToString(separator = " ")}")
|
project.logger.info("Run tool: $toolName with args: ${args.joinToString(separator = " ")}")
|
||||||
if (classpath.isEmpty) {
|
if (classpath.isEmpty) {
|
||||||
throw IllegalStateException("Classpath of the tool is empty: $toolName\n" +
|
throw IllegalStateException("Classpath of the tool is empty: $toolName\n" +
|
||||||
"Probably the 'konan.home' project property contains an incorrect path.\n" +
|
"Probably the '${KonanPlugin.ProjectProperty.KONAN_HOME}' project property contains an incorrect path.\n" +
|
||||||
"Please change it to the compiler root directory and rerun the build.")
|
"Please change it to the compiler root directory and rerun the build.")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +98,9 @@ internal abstract class KonanCliRunner(
|
|||||||
spec.classpath = classpath
|
spec.classpath = classpath
|
||||||
spec.jvmArgs(jvmArgs)
|
spec.jvmArgs(jvmArgs)
|
||||||
spec.systemProperties(
|
spec.systemProperties(
|
||||||
System.getProperties()
|
System.getProperties().asSequence()
|
||||||
.map { (k, v) -> k.toString() to v.toString() }
|
.map { (k, v) -> k.toString() to v.toString() }
|
||||||
|
.filter { (k, _) -> k !in blacklistProperties }
|
||||||
.escapeQuotesForWindows()
|
.escapeQuotesForWindows()
|
||||||
.toMap()
|
.toMap()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user