diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-13 15:06:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-13 15:06:22 -0500 |
commit | 54edd75f96fe6a7078e8bb559dcecbe31b50d225 (patch) | |
tree | 31891900cba54c30c254b8bece7524d795d8e622 /stage2 | |
parent | de12007cc8907d98f183e65f50f2f9b4700894c3 (diff) | |
parent | dc5ecb94d182774baa888264291eb3799448328c (diff) | |
download | cbt-54edd75f96fe6a7078e8bb559dcecbe31b50d225.tar.gz cbt-54edd75f96fe6a7078e8bb559dcecbe31b50d225.tar.bz2 cbt-54edd75f96fe6a7078e8bb559dcecbe31b50d225.zip |
Merge pull request #308 from cvogt/assert-right-build-class
Assert right build class. Fixes #174
Diffstat (limited to 'stage2')
-rw-r--r-- | stage2/BasicBuild.scala | 11 | ||||
-rw-r--r-- | stage2/BuildBuild.scala | 5 |
2 files changed, 15 insertions, 1 deletions
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index d8d1b8b..3ce9ed1 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -18,8 +18,17 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge def enableConcurrency = false final def projectDirectory: File = lib.realpath(context.projectDirectory) assert( projectDirectory.exists, "projectDirectory does not exist: " ++ projectDirectory.string ) + assert( + projectDirectory.getName =!= "build" || + { + def transitiveInterfaces(cls: Class[_]): Vector[Class[_]] = cls.getInterfaces.toVector.flatMap(i => i +: transitiveInterfaces(i)) + transitiveInterfaces(this.getClass).contains(classOf[BuildBuildWithoutEssentials]) + }, + "You need to extend BuildBuild in: " + projectDirectory + "/build" + ) + final def usage: String = lib.usage(this.getClass, show) - + final def taskNames: String = lib.taskNames(this.getClass).sorted.mkString("\n") // ========== meta data ========== diff --git a/stage2/BuildBuild.scala b/stage2/BuildBuild.scala index 5eb7622..0736e7e 100644 --- a/stage2/BuildBuild.scala +++ b/stage2/BuildBuild.scala @@ -6,6 +6,11 @@ trait BuildBuild extends BuildBuildWithoutEssentials{ super.dependencies :+ plugins.essentials } trait BuildBuildWithoutEssentials extends BaseBuild{ + assert( + projectDirectory.getName === "build", + "You can't extend BuildBuild in: " + projectDirectory + "/build" + ) + protected final val managedContext = context.copy( projectDirectory = managedBuildDirectory, parentBuild=Some(this) |