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

Added kobaltOptions().

This commit is contained in:
Cedric Beust 2017-03-21 13:14:25 -07:00
parent c43967bec9
commit a4282b299a
4 changed files with 28 additions and 3 deletions

View file

@ -161,6 +161,7 @@ private class Main @Inject constructor(
} else {
val allProjects = projectFinder.initForBuildFile(buildFile, args)
addOptionsFromBuild(args, Kobalt.optionsFromBuild)
if (args.listTemplates) {
// --listTemplates
Templates().displayTemplates(pluginInfo)
@ -213,6 +214,15 @@ private class Main @Inject constructor(
return result
}
private fun addOptionsFromBuild(args: Args, optionsFromBuild: ArrayList<String>) {
optionsFromBuild.forEach {
when(it) {
Args.SEQUENTIAL -> args.sequential = true
else -> throw IllegalArgumentException("Unsupported option found in kobaltOptions(): " + it)
}
}
}
private fun findBuildFile(): File {
val deprecatedLocation = File(Constants.BUILD_FILE_NAME)
val result: File =