1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 08:38:13 -07:00

* fix debug of Build.kt (do not rename original source file but use temporary folder instead)

This commit is contained in:
Dmitry Zhuravlev 2017-02-17 15:45:33 +03:00
parent 14ad4ce733
commit 1455a9a1a2
3 changed files with 14 additions and 2 deletions

View file

@ -101,7 +101,7 @@ class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val buildFil
// 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", deleteOnExit = true)
val modifiedBuildFile = KFiles.createTempBuildFileInTempDirectory(deleteOnExit = true)
KFiles.saveFile(modifiedBuildFile, parsedBuildFile.buildScriptCode)
val taskResult = maybeCompileBuildFile(context, BuildFile(Paths.get(modifiedBuildFile.path),
"Modified ${Constants.BUILD_FILE_NAME}", buildFile.realPath),

View file

@ -126,7 +126,7 @@ class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val
// Compile and run preBuildScriptCode, which contains all the plugins() calls extracted. This
// will add all the dynamic plugins found in this code to Plugins.dynamicPlugins
//
val pluginSourceFile = KFiles.createTempFile(".kt", deleteOnExit = true)
val pluginSourceFile = KFiles.createTempBuildFileInTempDirectory(deleteOnExit = true)
pluginSourceFile.writeText(preBuildScriptCode, Charset.defaultCharset())
kobaltLog(2, "Saved ${pluginSourceFile.absolutePath}")