These are chat archives for sbt/sbt

24th
Sep 2017
Suhas Gaddam
@suhasgaddam
Sep 24 04:26
sbt-release has this in their releaseProcess to cross compile/publish the plugin
https://github.com/sbt/sbt-release/blob/master/build.sbt#L70
Vladimir Polushin
@vovapolu
Sep 24 11:12
Hi everyone! Is there any method to run different scripted tests lines for different sbt versions?
it's related to cross-building between sbt 0.13 and sbt 1.0
Jeffrey Olchovy
@jeffreyolchovy
Sep 24 12:21

@vovapolu you can configure that via:

sbtTestDirectory := {
  val currentSbtVersion = (sbtVersion in pluginCrossBuild).value
  CrossVersion.partialVersion(currentSbtVersion) match {
    case Some((0, 13)) => sourceDirectory.value / "sbt-test-0.13"
    case Some((1, _))  => sourceDirectory.value / "sbt-test-1.0"
    case _             => sys.error(s"Unsupported sbt version: $currentSbtVersion")
  }
}

place your 0.13 scripted projets in src/sbt-test-0.13 and your 1.0 scripted tests in sbt-test-1.0

Vladimir Polushin
@vovapolu
Sep 24 13:04
@jeffreyolchovy hmm, I also have tests for both versions and I'd like to not copy them into 2 folders. Is it possible with sbtTestDirectory?
Sam Halliday
@fommil
Sep 24 14:25
upgrading our plugin to sbt 1.0, I've noticed that every scripted test is triggering recompile of the compiler bridge... is this no longer cached?
Guillaume Martres
@smarter
Sep 24 14:55
@fommil sbt/sbt#3469
Sam Halliday
@fommil
Sep 24 15:55
thanks
we're getting this error in the 0.13 tests
[info] [info] Compiling 1 Scala source to /tmp/sbt_ea2897e1/inter-tests/project/target/scala-2.10/sbt-0.13/classes...
[info] java.lang.NullPointerException
[info]     at sbt.Init$$anon$12.apply(Settings.scala:523)
[info]     at sbt.Init$$anon$12.apply(Settings.scala:523)
[info]     at sbt.AList$$anon$4.transform(AList.scala:61)
[info]     at sbt.Init$Apply.mapInputs(Settings.scala:628)
[info]     at sbt.Init$Apply.mapReferenced(Settings.scala:625)
[info]     at sbt.Init$$anon$12.apply(Settings.scala:523)
[info]     at sbt.Init$$anon$12.apply(Settings.scala:523)
[info]     at sbt.KCons.transform(KList.scala:28)
anyone seen anything like this?
tests are passing for 1.0
and were passing for 0.13 before adding cross building
Sam Halliday
@fommil
Sep 24 16:03
I can reproduce manually, i.e. without using scripted
any ideas on how I can work out setting is causing the exception?
Sam Halliday
@fommil
Sep 24 16:12
found the problem