Apply rri/yole/modularize, create gradle run configuration for IDEA
This commit is contained in:
committed by
Ilya Chernikov
parent
7cb8a90513
commit
360a692af8
@@ -81,3 +81,11 @@ private fun String.toMaybeVersionedJarRegex(): Regex {
|
||||
return Regex(if (hasJarExtension) escaped else "$escaped(-\\d.*)?\\.jar") // TODO: consider more precise version part of the regex
|
||||
}
|
||||
|
||||
|
||||
private val jreHome = System.getProperty("java.home")
|
||||
|
||||
fun firstFromJavaHomeThatExists(vararg paths: String): File =
|
||||
paths.mapNotNull { File(jreHome, it).takeIf { it.exists() } }.firstOrNull()
|
||||
?: throw GradleException("Cannot find under '$jreHome' neither of: ${paths.joinToString()}")
|
||||
|
||||
fun toolsJar(): File = firstFromJavaHomeThatExists("../lib/tools.jar", "../Classes/tools.jar")
|
||||
|
||||
Reference in New Issue
Block a user