These are chat archives for sbt/sbt

14th
Sep 2017
LoranceChen
@LoranceChen
Sep 14 02:52
Hi, why the first compile in compile:compile as configuration axis but Compile?
jtcwang
@jtcwang
Sep 14 03:48

I'm attempting to fetch an artifact using ModuleID in SBT 1.0:

currentArtifact := organization.value %% name.value % version.value,

    currentVersionExists := Def.taskDyn {
      Def.task {
        val dep = IvyDependencyResolution(ivySbt.value.configuration)
        val currentModule = currentArtifact.value
        val moduleDescriptor = dep.wrapDependencyInModule(currentModule)
        val result = dep.update(moduleDescriptor, UpdateConfiguration().withLogging(UpdateLogging.DownloadOnly), UnresolvedWarningConfiguration(), streams.value.log)
        result.isRight
      }
    }.value

However it seems like it's trying to fetch the module without the scala version appended (e.g. mylibrary instead of mylibrary_2.12). Does anyone know what I'm missing?

Here's the error:

[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: com.company#mylibrary;0.6.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::

ah I think I found the issue:

Here's what sbt-MiMa plugin does:

        CrossVersion(m, scalaModuleInfoV) match {
          case Some(f) => m withName f(m.name)
          case None => m
        }

(it manually updates the name based on cross version setting)

Dale Wijnand
@dwijnand
Sep 14 07:26
Yep, well found.
Sam Halliday
@fommil
Sep 14 10:57
I have scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "unused")), but I'm still seeing the parameters I want to exclude in show console:scalacOptions... have I done it wrong?
also, the rare occassion where Dale needs to ask for sbt advice :-D https://stackoverflow.com/questions/26940253
(4 years ago)
OlegYch
@OlegYch
Sep 14 11:01
tpolecat should be an expert on this by now, but try console::compile:scalacOptions
Sam Halliday
@fommil
Sep 14 11:01
I'm definitely still seeing it when I start the console
though, I am using consoleQuick
OlegYch
@OlegYch
Sep 14 11:02
what does console::compile:scalacOptions say
Sam Halliday
@fommil
Sep 14 11:03
you got your colons mixed up, but it shows the thing I don't want
OlegYch
@OlegYch
Sep 14 11:05
pretty sure the colons are the way they should be
Sam Halliday
@fommil
Sep 14 11:06
> show console::compile:scalacOptions
[error] Expected key
[error] Expected end of input.
[error] Expected whitespace character
[error] No such setting/task
[error] show console::compile:scalacOptions
[error]                      ^
should be console:compile::scalacOptions
OlegYch
@OlegYch
Sep 14 11:06
nah
try compile:console::scalacOptions
Sam Halliday
@fommil
Sep 14 11:07
ok, that looks like what I set
but when I do consoleQuick the flags are definitely still there
OlegYch
@OlegYch
Sep 14 11:07
{<build-uri>}<project-id>/config:intask::key
Sam Halliday
@fommil
Sep 14 11:07
oh, maybe not
this is the crazy new unused-import logic in scala 2.12 and I wonder if it's been re-enabled the other way
sweet, that was it
I need this too: scalacOptions in (Compile, console) -= "-Xlint",
thanks!
OlegYch
@OlegYch
Sep 14 11:14
np
see sbt-slash btw
Dale Wijnand
@dwijnand
Sep 14 11:52
yeah Xlint is what's enabling unused in 2.12
I've configured this in the past:
inConsoles(scalacOptions += "-Xlint:-unused")

def inBoth(ss: Setting[_]*) = List(Compile, Test) flatMap (inConfig(_)(ss))
def inConsoles(ss: Setting[_]*) = inBoth((inTask(console)(ss) ++ inTask(consoleQuick)(ss)): _*)
megri
@megri
Sep 14 11:57
What's up with the activity sidebar? It shows Jun 22 2015 as the latest comment
Dale Wijnand
@dwijnand
Sep 14 11:58
We moved it to sbt/sbt-contrib, and now it's disconnected there too.
megri
@megri
Sep 14 12:03
:worried:
Michael Stringer
@stringbean
Sep 14 14:28
I’m not sure if anyone has mentioned this but the 1.0.1 Scaladocs aren’t up on scala-sbt.org which breaks the 1.0 API link
Michael Stringer
@stringbean
Sep 14 14:44
@dwijnand sbt/website#482 needs to be applied to the 0.13.x docs as well - do you want me to open another PR for that?
Dale Wijnand
@dwijnand
Sep 14 14:44
yes please
and there's a ticket about the docs
Michael Stringer
@stringbean
Sep 14 14:44
ah cool, it’d been broken for a while so I was wondering
Connor Lanigan
@connorlanigan
Sep 14 18:55

Hi! I have a Scala/ScalaJS crossproject where I need to include the compiled Javascript client code into the server resources. The following code does achieve that:

lazy val server = app.jvm.settings(
    (unmanagedResources in Compile) ++= (webpack in (client, Compile, fastOptJS)).value
)

However, I now need to place the client code in a subdirectory called "public". How do I achieve this?
I already tried to simply include the parent folder (which is already called "public") using (webpack in (client, Compile, fastOptJS)).value.map(_.getParentFile), but then SBT only includes that folder without its contents.

Daniel Hinojosa
@dhinojosa
Sep 14 20:23
In SBT 1.0 console, the tab completion no longer works, nor does CTRL+L to clear the screen.
Daniel Hinojosa
@dhinojosa
Sep 14 20:36
Anything I can help with in getting it back, let me know.
Eric K Richardson
@ekrich
Sep 14 20:50
How do you publishLocal just the ScalaNative part of a cross project?
Daniel Hinojosa
@dhinojosa
Sep 14 20:58
Nevermind, fixed in 1.0.1
eugene yokota
@eed3si9n
Sep 14 21:47
@stringbean I managed to cobble together http://www.scala-sbt.org/1.0.1/api/sbt/Keys%24.html but not yet a permanent fix
Michael Stringer
@stringbean
Sep 14 21:58
it stops a 404 for now so :+1:
Jacob Janco
@jacobjanco
Sep 14 22:06
quick question -> how does one configure an rpm pre-install macro? e.g. "%global _binaries_in_noarch_packages_terminate_build 0"
Jacob Janco
@jacobjanco
Sep 14 22:11
tried sbt/sbt-native-packager#375 but this is deprecated..
Brian P. Holt
@bpholt
Sep 14 22:26
@jacobjanco there is an sbt-native-packager room; you might try asking there?
Jacob Janco
@jacobjanco
Sep 14 22:50
@bpholt moving over there, apologies
Brian P. Holt
@bpholt
Sep 14 23:03
No worries, just thought they might be more helpful 🙂