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

Merge pull request #255 from DevCharly/delete-temp-files

delete temporary "kobalt123.kt" files (in temp folder)
This commit is contained in:
Cedric Beust 2016-07-04 08:04:07 -07:00 committed by GitHub
commit 40d251e08d
2 changed files with 2 additions and 2 deletions

View file

@ -90,7 +90,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, // 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 // compile it, jar it in buildScript.jar and run it
val modifiedBuildFile = KFiles.createTempFile(".kt") val modifiedBuildFile = KFiles.createTempFile(".kt", deleteOnExit = true)
KFiles.saveFile(modifiedBuildFile, parsedBuildFile.buildScriptCode) KFiles.saveFile(modifiedBuildFile, parsedBuildFile.buildScriptCode)
val taskResult = maybeCompileBuildFile(context, BuildFile(Paths.get(modifiedBuildFile.path), val taskResult = maybeCompileBuildFile(context, BuildFile(Paths.get(modifiedBuildFile.path),
"Modified ${Constants.BUILD_FILE_NAME}", buildFile.realPath), "Modified ${Constants.BUILD_FILE_NAME}", buildFile.realPath),

View file

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