scct
scct copied to clipboard
does not work with externalPom()
If dependencies managed using externalPom()
, the plugin does not work:
last common/scct:scalac-options
java.util.NoSuchElementException: next on empty iterator
at scala.collection.Iterator$$anon$3.next(Iterator.scala:27)
at scala.collection.Iterator$$anon$3.next(Iterator.scala:25)
at scala.collection.IndexedSeqLike$Elements.next(IndexedSeqLike.scala:63)
at scala.collection.IterableLike$class.head(IterableLike.scala:90)
at scala.collection.mutable.ArraySeq.scala$collection$IndexedSeqOptimized$$super$head(ArraySeq.scala:45)
at scala.collection.IndexedSeqOptimized$class.head(IndexedSeqOptimized.scala:121)
at scala.collection.mutable.ArraySeq.head(ArraySeq.scala:45)
at ScctPlugin$$anonfun$instrumentSettings$4.apply(ScctPlugin.scala:30)
at ScctPlugin$$anonfun$instrumentSettings$4.apply(ScctPlugin.scala:27)
at sbt.Scoped$$anonfun$hf3$1.apply(Structure.scala:579)
at sbt.Scoped$$anonfun$hf3$1.apply(Structure.scala:579)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$5.work(System.scala:71)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
I'm not entirely sure why this fails, looks like it's quite deep in sbt-territory.
As I'm a bit strapped for time, any help resolving this would be very much appreciated :)
The very same failure with another libraryDependencies definition (you can find a similar one in Spray - https://github.com/spray/spray):
libraryDependencies <<= scalaVersion { v =>
val akkaVersion = "2.0.4"
val sprayVersion = "1.0-M6"
Seq(
"com.typesafe.akka" % "akka-actor" % akkaVersion,
"io.spray" % "spray-routing" % sprayVersion,
"ch.qos.logback" % "logback-classic" % "1.0.7" % "runtime",
"com.typesafe.akka" % "akka-testkit" % akkaVersion % "test",
"io.spray" % "spray-testkit" % sprayVersion % "test",
"org.mockito" % "mockito-all" % "1.9.5" % "test"
)
}
Hi,
Preface: The sbt-scct plugin adds the the scct instrumentation+reporting library (scct.jar) as a dependency when the plugin is enabled.
For the libraryDependencies issue: "<<=" apparently replaces the libraryDependencies with the new value. Dependencies added by plugins are therefore wiped. To fix the problem, use "<++=" instead of "<<=". Also, you can manually add the scct-dependency with "reaktor" %% "scct" % "0.2-SNAPSHOT" % "scct"
(yeah, the scope is "scct")
For the externalPom issue: That's deeper. It looks like the pom overwrites so many settings that the sbt-scct plugin itself is not invoked and the classpaths are all wonky. Still looks very sbt-magical.