Build: Make toolsJarApi() helper for JPS build

This commit is contained in:
Vyacheslav Gerasimov
2020-02-24 01:03:54 +03:00
parent c75ad13b66
commit f735396ffb
9 changed files with 17 additions and 11 deletions
+6
View File
@@ -133,6 +133,12 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
logger.warn("Cannot find file by paths: ${paths.toList()} in $jdkHome")
}
fun Project.toolsJarApi(): Any =
if (kotlinBuildProperties.isInJpsBuildIdeaSync)
files(toolsJarFile() ?: error("tools.jar is not found!"))
else
dependencies.project(":dependencies:tools-jar-api")
fun Project.toolsJar(): FileCollection = files(toolsJarFile() ?: error("tools.jar is not found!"))
fun Project.toolsJarFile(jdkHome: File = File(this.property("JDK_18") as String)): File? =