aboutsummaryrefslogtreecommitdiff
path: root/stage2/Lib.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-02-15 02:17:08 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2017-02-15 03:38:42 -0500
commit2c8257b0c119b38102aa0c3efecffc7fefc9d766 (patch)
treeed3534a588f4e6203331ad55c86d4ef987b2e481 /stage2/Lib.scala
parent2a1bf81eccf6b91e0dcdd2d7a05664da2049f3a1 (diff)
downloadcbt-2c8257b0c119b38102aa0c3efecffc7fefc9d766.tar.gz
cbt-2c8257b0c119b38102aa0c3efecffc7fefc9d766.tar.bz2
cbt-2c8257b0c119b38102aa0c3efecffc7fefc9d766.zip
add typed constants for build directory and file and use them everywhere
Diffstat (limited to 'stage2/Lib.scala')
-rw-r--r--stage2/Lib.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index 2642ec9..0d382f2 100644
--- a/stage2/Lib.scala
+++ b/stage2/Lib.scala
@@ -18,6 +18,8 @@ case class Developer(id: String, name: String, timezone: String, url: URL)
final class Lib(val logger: Logger) extends Stage1Lib(logger) with Scaffold{
lib =>
+ val buildFileName = "build.scala"
+ val buildDirectoryName = "build"
val buildClassName = "Build"
val buildBuildClassName = "BuildBuild"
@@ -37,7 +39,7 @@ final class Lib(val logger: Logger) extends Stage1Lib(logger) with Scaffold{
val start = findStartDir(directory)
- val useBasicBuild = directory == start && start.getName != "build"
+ val useBasicBuild = directory == start && start.getName != buildDirectoryName
try{
if(useBasicBuild) {
@@ -54,8 +56,8 @@ final class Lib(val logger: Logger) extends Stage1Lib(logger) with Scaffold{
else
new cbt.BasicBuild( context.copy( workingDirectory = start ) ) with BuildBuild
} catch {
- case e:ClassNotFoundException if e.getMessage == "Build" =>
- throw new Exception(s"no class Build found in " ++ start.string)
+ case e:ClassNotFoundException if e.getMessage == buildClassName =>
+ throw new Exception(s"no class ${buildClassName} found in " ++ start.string)
}
}