1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00
This commit is contained in:
Cedric Beust 2015-12-13 04:32:30 +04:00
parent 90455bcfbe
commit 443e9d0bde

View file

@ -58,8 +58,8 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
private fun findProjects(context: KobaltContext): List<Project> {
val result = arrayListOf<Project>()
buildFiles.forEach { buildFile ->
val processBuildFile = parseBuildFile(context, buildFile)
val pluginUrls = processBuildFile.pluginUrls
val parsedBuildFile = parseBuildFile(context, buildFile)
val pluginUrls = parsedBuildFile.pluginUrls
val buildScriptJarFile = File(KFiles.findBuildScriptLocation(buildFile, SCRIPT_JAR))
// If the script jar files were generated by a different version, wipe them in case the API
@ -74,7 +74,7 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
// Write the modified Build.kt (e.g. maybe profiles were applied) to a temporary file,
// compile it, jar it in buildScript.jar and run it
val modifiedBuildFile = KFiles.createTempFile(".kt")
KFiles.saveFile(modifiedBuildFile, processBuildFile.buildScriptCode)
KFiles.saveFile(modifiedBuildFile, parsedBuildFile.buildScriptCode)
maybeCompileBuildFile(context, BuildFile(Paths.get(modifiedBuildFile.path), "Modified Build.kt"),
buildScriptJarFile, pluginUrls)
val projects = buildScriptUtil.runBuildScriptJarFile(buildScriptJarFile, pluginUrls, context)