1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 08:38:13 -07:00
This commit is contained in:
Cedric Beust 2015-11-26 21:03:08 -08:00
parent 0118e71b4f
commit 61ce1b537c

View file

@ -65,6 +65,9 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
return allProjects return allProjects
} }
/**
* Make sure all the projects have a unique name.
*/
private fun validateProjects(projects: List<Project>) { private fun validateProjects(projects: List<Project>) {
val seen = hashSetOf<String>() val seen = hashSetOf<String>()
projects.forEach { projects.forEach {
@ -93,7 +96,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 and run it // compile it, jar it in buildScript.jar and run it
val modifiedBuildFile = KFiles.createTempFile(".kt") val modifiedBuildFile = KFiles.createTempFile(".kt")
KFiles.saveFile(modifiedBuildFile, pair.first.buildScriptCode) KFiles.saveFile(modifiedBuildFile, pair.first.buildScriptCode)
maybeCompileBuildFile(context, BuildFile(Paths.get(modifiedBuildFile.path), "Modified Build.kt"), maybeCompileBuildFile(context, BuildFile(Paths.get(modifiedBuildFile.path), "Modified Build.kt"),