From 69b3380ad301b50e540ef784c5ada1f3560dffab Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Tue, 14 Feb 2017 00:21:35 -0500 Subject: a (probably insufficient) attempt at detecting task cache conflicts --- stage2/BasicBuild.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'stage2/BasicBuild.scala') diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala index 5212270..e5b3507 100644 --- a/stage2/BasicBuild.scala +++ b/stage2/BasicBuild.scala @@ -258,6 +258,24 @@ trait BaseBuild extends BuildInterface with DependencyImplementation with Trigge // a method that can be called only to trigger any side-effects final def `void` = () + final override def transitiveDependencies: Seq[Dependency] = + taskCache[BaseBuild]( "transitiveDependencies" ).memoize{ + val res = super.transitiveDependencies + val duplicateBuilds = res.collect{ + case b: BaseBuild => b + }.groupBy( + b => ( b.projectDirectory, b.moduleKey ) + ).filter( _._2.size > 1 ).mapValues(_.map(_.getClass)) + duplicateBuilds.foreach{ case ((projectDirectory, moduleKey), classes) => + assert( + classes.distinct.size == 1, + "multiple builds found for\nprojectDirectory: $projectDirectory\nmoduleKey: $moduleKey\nbut different classes: " + classes.mkString(", ") + ) + } + res + } + + @deprecated("use the MultipleScalaVersions plugin instead","") final def crossScalaVersionsArray = Array(scalaVersion) } -- cgit v1.2.3