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

Deprecate Build.kt in the root dir.

This commit is contained in:
Cedric Beust 2015-12-13 08:21:37 +04:00
parent d71cdf7010
commit 4fb726be91
4 changed files with 22 additions and 13 deletions

View file

@ -251,17 +251,16 @@ private class Main @Inject constructor(
return result
}
private fun findBuildFile(): File {
val files = arrayListOf("Build.kt", "build.kobalt", KFiles.src("build.kobalt"),
KFiles.src("Build.kt"))
try {
return files.map {
File(SystemProperties.currentDir, it)
}.first {
it.exists()
private fun findBuildFile() : File {
val deprecatedLocation = File(Constants.BUILD_FILE_NAME)
val result: File =
if (deprecatedLocation.exists()) {
warn(Constants.BUILD_FILE_NAME + " is in a deprecated location, please move it to "
+ Constants.BUILD_FILE_DIRECTORY)
deprecatedLocation
} else {
File(KFiles.joinDir(Constants.BUILD_FILE_DIRECTORY, Constants.BUILD_FILE_NAME))
}
} catch(ex: NoSuchElementException) {
return File(KFiles.joinFileAndMakeDir("kobalt", "src", "Build.kt"))
}
return result
}
}