aboutsummaryrefslogtreecommitdiff
path: root/stage2/BuildBuild.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/BuildBuild.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/BuildBuild.scala')
-rw-r--r--stage2/BuildBuild.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/stage2/BuildBuild.scala b/stage2/BuildBuild.scala
index 474599a..798bd7d 100644
--- a/stage2/BuildBuild.scala
+++ b/stage2/BuildBuild.scala
@@ -7,8 +7,8 @@ trait BuildBuild extends BuildBuildWithoutEssentials{
}
trait BuildBuildWithoutEssentials extends BaseBuild{
assert(
- projectDirectory.getName === "build",
- "You can't extend BuildBuild in: " + projectDirectory + "/build"
+ projectDirectory.getName === lib.buildDirectoryName,
+ "You can't extend ${lib.buildBuildClassName} in: " + projectDirectory + "/" + lib.buildDirectoryName
)
protected final val managedContext = context.copy(
@@ -33,12 +33,12 @@ trait BuildBuildWithoutEssentials extends BaseBuild{
super.dependencies :+ context.cbtDependency
def managedBuildDirectory: java.io.File = lib.realpath( projectDirectory.parent )
def managedBuild = taskCache[BuildBuildWithoutEssentials]("managedBuild").memoize{
- val managedBuildFile = projectDirectory++"/build.scala"
+ val managedBuildFile = projectDirectory++("/"++lib.buildFileName)
logger.composition("Loading build at " ++ managedBuildDirectory.toString)
val build = (
if( !managedBuildFile.exists ){
throw new Exception(
- "No file build.scala (lower case) found in " ++ projectDirectory.getPath
+ s"No file ${lib.buildFileName} (lower case) found in " ++ projectDirectory.getPath
)
} else {
val contents = new String(Files.readAllBytes(managedBuildFile.toPath))
@@ -78,8 +78,8 @@ trait BuildBuildWithoutEssentials extends BaseBuild{
try{
build.asInstanceOf[BuildInterface]
} catch {
- case e: ClassCastException if e.getMessage.contains("Build cannot be cast to cbt.BuildInterface") =>
- throw new Exception("Your Build class needs to extend BaseBuild in: "+projectDirectory, e)
+ case e: ClassCastException if e.getMessage.contains(s"${lib.buildClassName} cannot be cast to cbt.BuildInterface") =>
+ throw new Exception(s"Your ${lib.buildClassName} class needs to extend BaseBuild in: "+projectDirectory, e)
}
}
override def triggerLoopFiles = super.triggerLoopFiles ++ managedBuild.triggerLoopFiles