A relaxed chat room about sbt (the interactive build tool). Also good for sbt help: Stack Overflow, or Lightbend subscription. https://www.scala-sbt.org/support.html has advice on where to go.
eed3si9n on 0.13
Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 3 more (compare)
eed3si9n on fixbuild
eed3si9n on fixbuild
Fix typo (compare)
eed3si9n on fixbuild
Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 1 more (compare)
eed3si9n on scalaversionbump
eed3si9n on 0.13
Bumping up Scala version to 2.1… Try to keep bincompat Fixes #1666 and 1 more (compare)
eed3si9n on scalaversionbump
Fixes #1666 (compare)
.sbt
and project/build.scala
and expects no surprises from the sbt
unmanagedResources in Compile += Def.task {
val temp = IO.createTemporaryDirectory
"curl --silent https://example.com/main-module/-/main-module-0.0.2.tgz" #| s"tar -xf -C$temp" !
(unmanagedResourceDirectories in Compile) += temp
}.taskValue
val zeroCrossSettingsTemplate = Seq(
unmanagedSourceDirectories := unmanagedSourceDirectories.value.filter(f => ! f.getName.startsWith("scala-")),
managedSourceDirectories := Seq()
)
val zeroCrossSettings = inConfig(Compile)(zeroCrossSettingsTemplate) ++ inConfig(Test)(zeroCrossSettingsTemplate)
Command
s suck
How can I refer to a scoped key programmatically? I.e. what is the programmatic equivalent of e.g. scalafmt::test
?
Context: neo-sbt-scalafmt defines a TaskKey scalafmt
that formats your sources, but it also defines a scope called test
(https://github.com/lucidsoftware/neo-sbt-scalafmt/blob/master/sbt-scalafmt/src/main/scala/com/lucidchart/sbt/scalafmt/ScalafmtCorePlugin.scala#L143) that only checks if the sources are in line with the expected format. Depending on a SettingKey the TaskKey scalaFmt
is invoked before compile
. I want to introduce a new SettingKey that invokes scalafmt::test
instead. The below compiles, but always runs scalafmt
, not scalafmt::test
.
if (scalafmtOnCompile.value) scalafmt in resolvedScoped.value.scope
else if (scalafmtTestOnCompile.value) (test in scalafmt) in resolvedScoped.value.scope
scalafmt
task scope, that's the scope of test
that I want to use"
scalafmt
, not scalafmt::test
. Can you have a quick look at this line and tell me if my understanding is correct, that it's a scoped key? This is what I want to refer to:test in (resolvedScoped.value.scope in scalafmt.key)
does the job. thank you!