These are chat archives for sbt/sbt

2nd
Sep 2015
Matthew de Detrich
@mdedetrich
Sep 02 2015 02:43
When using <+=, how are you able to refer to another settingKey (i.e. using someKey.value on the rhs of a <+=)
Matthew de Detrich
@mdedetrich
Sep 02 2015 04:09

Like I am getting issues in getting something like

resourceGenerators in Compile <+= {
        AssetsCompiler(
        "sass",
        { file => (file ** "*.sass") +++ (file ** "*.scss") },
        sassEntryPoints,
        { (name, min) =>
          name
            .replace(".sass", if (min) ".min.css" else ".css")
            .replace(".scss", if (min) ".min.css" else ".css")
        },
        { (file, options) => SassCompiler.compile(file, options,libSass.value) },
        sassOptions
        )
      },

To work

AssetsCompiler is a function that returns a Def.Initialize[Task[Seq[File]]]
I can’t seem to be able to actually compose the value inside libSass (which is a Setting[Key]) so it can be used within SassCompiler.compile (which can only use lifted values, i.e. no Setting or Task)
and no combination of libSass.map/libSass.flatMap/libSass.toTask.map/libSass.toTask.flatMap appears to work
I will put this on stack as well
Dale Wijnand
@dwijnand
Sep 02 2015 07:09
@mdedetrich Try += instead, the <+= etc arrows are pre .value macro, and made redudant with it.
Torbjørn Vatn
@torbjornvatn
Sep 02 2015 08:42
Is there any way I could override webappPostProcess in the example below without using import com.earldouglas.xwp.WebappPlugin.autoImport._ ?

import com.earldouglas.xwp.WebappPlugin.autoImport._

lazy val myProject: Project = Project(
    id = "web",
    base = file("web"),
    settings = Seq(webappPostProcess := { /* do stuff */ }) enablePlugins WebappPlugin
matanster
@matanster
Sep 02 2015 09:11
@fommil, brilliant! I missed something you haven't in studying scoverage (https://github.com/scoverage/sbt-scoverage/blob/master/src/main/scala/scoverage/ScoverageSbtPlugin.scala#L55)
@fommil which IDE do you use for this? could you get much sense connecting the sbt sources to your project?
Sam Halliday
@fommil
Sep 02 2015 09:12
ENSIME
matanster
@matanster
Sep 02 2015 09:12
I guess I should try that one time :-) do I really need to run a server component for that?
Sam Halliday
@fommil
Sep 02 2015 09:13
it is a server
matanster
@matanster
Sep 02 2015 09:13
which one can typically run on their dev machine right?
Sam Halliday
@fommil
Sep 02 2015 09:13
yes
IntelliJ and Scala IDE are also servers, right?
it's a scala process that runs in the background
matanster
@matanster
Sep 02 2015 09:14
Given that one installs them to use them, it should be considered the same indeed. They just don't use that word
I'll give it a try at last, especially if it's good on navigating callers, callees, object definitions...
Sam Halliday
@fommil
Sep 02 2015 09:56
is there any way to automatically run a command or task after the user runs anything?
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 09:56
don’t think so
Sam Halliday
@fommil
Sep 02 2015 09:56
I have a command, debugging, which mutates the javaOptions. I only want it to live for the next command that the user runs before the inverse operation is called (debugging-off)
I don't want everybody to have to manually call debugging-off
the idea is that in order to run a test with debugging, you type debugging ; test-only *MyTest
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 09:57
what about another command (another layer of indirection)
to wrap what you want to do and the in/out commands?
Sam Halliday
@fommil
Sep 02 2015 09:57
for all run/test variants? no thanks
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 09:58
it’s similar to switching log levels
you do it for a session
and then you have to revert it back, i.e. run another session with the settings set
it might be quite useful to have, anyway
some kind of a global listener/watcher
suggest asking the question on SO for others to chime in
Matthew de Detrich
@mdedetrich
Sep 02 2015 10:21

@dwijnand I already tried that,

resourceGenerators in Compile += {
        AssetsCompiler(
        "sass",
        { file => (file ** "*.sass") +++ (file ** "*.scss") },
        sassEntryPoints,
        { (name, min) =>
          name
            .replace(".sass", if (min) ".min.css" else ".css")
            .replace(".scss", if (min) ".min.css" else ".css")
        },
        { (file, options) => SassCompiler.compile(file, options,libSass.value) },
        sassOptions
        )
      },

Doesn’t compile either, error is

[info] Compiling 2 Scala sources to /Users/matthewdedetrich/github/play-sass/target/scala-2.10/sbt-0.13/classes...
[error] /Users/matthewdedetrich/github/play-sass/src/main/scala/net/litola/SassPlugin.scala:20: No implicit for Append.Value[Seq[sbt.Task[Seq[java.io.File]]], sbt.Def.Initialize[sbt.Task[Seq[java.io.File]]]] found,
[error]   so sbt.Def.Initialize[sbt.Task[Seq[java.io.File]]] cannot be appended to Seq[sbt.Task[Seq[java.io.File]]]
[error]       resourceGenerators in Compile += {
[error]                                     ^
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 5 s, completed 02/09/2015 8:24:11 PM
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:30
doh, compilation failed :(
sbt.ResolveException: unresolved dependency: org.scala-sbt.ivy#ivy;2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2: not found
the latest sources
hope it’s me
@mdedetrich try <+= (not +=)
that’s one of the dark sides of sbt to me :)
or .taskValue at the end of the block
jaceklaskowski @jaceklaskowski gonna master generators in sbt soon(ish)
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:36
@dwijnand looks like your commit broke sbt for me :(
sbt/sbt@8e6e32d
Bartosz Bąbol
@BBartosz
Sep 02 2015 10:36
Hello everybody, I've got following question: http://stackoverflow.com/questions/32349673/scala-macro-paradise-using-jar-instead-multiproject-build-in-play-framework could somebody give me some hint about this problem? Is it possible to treat jar as dependency project in sbt?
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:38
@BBartosz can you not use aggregate(MyLib)
and start over?
when you execute sbt assembly you’re executing it for all (aggregate) projects
Bartosz Bąbol
@BBartosz
Sep 02 2015 10:39
ok, I will try it
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:39
create a sample project to reproduce and push it to github
it’s gonna be easier (for me)
Matthew de Detrich
@mdedetrich
Sep 02 2015 10:43
@jaceklaskowski Doesn’t work either
Also <+=is what I used originally
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:44
tried .taskValue
Matthew de Detrich
@mdedetrich
Sep 02 2015 10:48
@jaceklaskowski Already wen’t through that, its not actually compiling
Like I have tried every variation under the sun (this cost me 3 hours today)
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:48
push a sample to github to let me give it a try
want to be on the same page
as you
Matthew de Detrich
@mdedetrich
Sep 02 2015 10:50
Matthew de Detrich
@mdedetrich
Sep 02 2015 10:55
@jaceklaskowski Like I am not sure if I am doing something incredibly stupid, but this is frustrating me to an incredible degree
But if you manage to solve it, I will send you a cookie over the internet
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 10:57
:clap:
play-sass git:(master) xsbt
JAVA_HOME=/Library/Java/JavaVirtualMachines/java8/Contents/Home
SBT_OPTS= -Xms512M -Xmx3g -Xss1M -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF-8 -XX:+UseCompressedOops -XX:NewRatio=9 -XX:ReservedCodeCacheSize=100m
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Updating {file:/Users/jacek/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/dev/sandbox/play-sass/project
[info] Updating {file:/Users/jacek/dev/sandbox/play-sass/project/}play-sass-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to /Users/jacek/dev/sandbox/play-sass/project/target/scala-2.10/sbt-0.13/classes...
[info] Set current project to play-sass (in build file:/Users/jacek/dev/sandbox/play-sass/)
[play-sass]> compile
[info] Updating {file:/Users/jacek/dev/sandbox/play-sass/}play-sass...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/2.3.1/jars/sbt-plugin.jar ...
[info]     [SUCCESSFUL ] com.typesafe.play#sbt-plugin;2.3.1!sbt-plugin.jar (8116ms)
[info] downloading http://repo.typesafe.com/typesafe/releases/com/typesafe/play/build-link/2.3.1/build-link-2.3.1.jar ...
[info]     [SUCCESSFUL ] com.typesafe.play#build-link;2.3.1!build-link.jar (2055ms)
[info] downloading http://repo.typesafe.com/typesafe/releases/com/typesafe/play/play-exceptions/2.3.1/play-exceptions-2.3.1.jar ...
[info]     [SUCCESSFUL ] com.typesafe.play#play-exceptions;2.3.1!play-exceptions.jar (2036ms)
[info] downloading http://repo.typesafe.com/typesafe/releases/com/typesafe/play/routes-compiler_2.10/2.3.1/routes-compiler_2.10-2.3.1.jar ...
[info]     [SUCCESSFUL ] com.typesafe.play#routes-compiler_2.10;2.3.1!routes-compiler_2.10.jar (3765ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.10/sbt_0.13/2.4.0/jars/sbteclipse-plugin.jar ...
[info]     [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-plugin;2.4.0!sbteclipse-plugin.jar (2615ms)
[info] downloading http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.10/sbt_0.13/0.7.1/jars/sbt-native-packager.jar ...
[info]     [SUCCESSFUL ] com.typesafe.sbt#sbt-native-packager;0.7.1!sbt-native-packager.jar (10967ms)
[info] downloading http://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbteclipse/sbteclipse-core/scala_2.10/sbt_0.13/2.4.0/jars/sbteclipse-core.jar ...
[info]     [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-core;2.4.0!sbteclipse-core.jar (2644ms)
[info] downloading http://repo1.maven.org/maven2/org/scalatest/scalatest_2.10/1.9.2/scalatest_2.10-1.9.2.jar ...
[info]     [SUCCESSFUL ] org.scalatest#scalatest_2.10;1.9.2!scalatest_2.10.jar (2732ms)
[info] Done updating.
[info] Compiling 2 Scala sources to /Users/jacek/dev/sandbox/play-sass/target/scala-2.10/sbt-0.13/classes...
[success] Total time: 68 s, completed Sep 2, 2015 1:00:22 PM
[play-sass]> about
[info] This is sbt 0.13.5
[info] The current project is {file:/Users/jacek/dev/sandbox/play-sass/}play-sass 0.4.0
[info] The current project is built against Scala 2.10.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbtmeow.SbtMeowPlugin, com.timushev.sbt.updates.UpdatesPlugin, gilt.DependencyGraph, net.virtualvoid.sbt.graph.Plugin, com.typesafe.sbt.SbtGit, com.github.tototoshi.sbt.musical.Plugin, com.typesafe.sbt.SbtPgp
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.4
all seem fine?!
jaceklaskowski @jaceklaskowski confused
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 11:01
can you use the very latest sbt?
0.13.9
I’m on 0.13.10-SNAPSHOT
Matthew de Detrich
@mdedetrich
Sep 02 2015 11:02
Hmm, let me try
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 11:02
trying out 0.13.9
➜  play-sass git:(master) ls -l /usr/local/bin/sbt
lrwxr-xr-x  1 jacek  admin  28 12 sie 22:52 /usr/local/bin/sbt -> ../Cellar/sbt/0.13.9/bin/sbt
➜  play-sass git:(master) sbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/dev/sandbox/play-sass/project
[info] Set current project to play-sass (in build file:/Users/jacek/dev/sandbox/play-sass/)
[play-sass]> clean
[success] Total time: 0 s, completed Sep 2, 2015 1:02:36 PM
[play-sass]> compile
[info] Updating {file:/Users/jacek/dev/sandbox/play-sass/}play-sass...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 2 Scala sources to /Users/jacek/dev/sandbox/play-sass/target/scala-2.10/sbt-0.13/classes...
[success] Total time: 6 s, completed Sep 2, 2015 1:02:43 PM
[play-sass]> compile
[success] Total time: 0 s, completed Sep 2, 2015 1:02:52 PM
works fine, too
cookies liz :P
Matthew de Detrich
@mdedetrich
Sep 02 2015 11:06
@jaceklaskowski Did you try running compile?
I have fixed the version to 0.13.9 and I am getting the same error
Also did you change any source code?
Sam Halliday
@fommil
Sep 02 2015 11:08
how can I get hold of the compiler flags that sbt uses to compile the files under project?
Matthew de Detrich
@mdedetrich
Sep 02 2015 11:08
@jaceklaskowski Obviously sbt will load fine, but since its an sbt-plugin you need to run compile to see if the plugin is actually valid
Dale Wijnand
@dwijnand
Sep 02 2015 12:08
@jaceklaskowski it shortld be in Bintray
Sam Halliday
@fommil
Sep 02 2015 12:31
another one for stack overflow https://stackoverflow.com/questions/32353251
Sam Halliday
@fommil
Sep 02 2015 12:41
I'm completely lost on this, I don't think IntelliJ even does this
Sam Halliday
@fommil
Sep 02 2015 13:10
is scalacOptions in ThisBuild the only way to add flags to the compile of the sbt buld definition? Or do people use another way?
how does that even work? If its defined in the file that you want to enable deprecation warnings in
Dale Wijnand
@dwijnand
Sep 02 2015 13:13
scalacOptions in ThisBuild won't give you the scalacOptions for the meta-build
$ more project/plugins.sbt
scalacOptions += "-Xfuture"
> show {.}/scalacOptions
[info] List()
Sam Halliday
@fommil
Sep 02 2015 13:17
@dwijnand yeah, I just worked that out. How do I get them?
i.e. where is the meta build?
Dale Wijnand
@dwijnand
Sep 02 2015 13:18
No idea, sorry
Sam Halliday
@fommil
Sep 02 2015 13:18
btw, you're doing that in plugins.sbt, but shouldn't that be in project/build.sbt?
or is it equivalent
Dale Wijnand
@dwijnand
Sep 02 2015 13:19
it's equivalent, but I've transitioned to call it plugins.sbt to differentiate
it's faster then root/build.sbt vs root/project/build.sbt (or "build.sbt at the root of your project not in the project directory")
Sam Halliday
@fommil
Sep 02 2015 13:23
I don't really need to share code, just the value of a built in setting. Bit of a bummer
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 18:20
@fommil trying to figure that out myself
you know about reload plugins?
help reload
then you’re in the meta-project build
and can query for scalacOptions w/ show scalacOptions
dunno how to do it from a plugin
autoplugin doesn’t seem to give me the value
even when the meta-project is referenced using RootProject :(
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 19:08
@dwijnand why is the repo not in resolvers?
I can’t seem to convince sbt to pull the jar :(
Dale Wijnand
@dwijnand
Sep 02 2015 19:18
I'll try and find time later to have a go. You building sbt or using sbt 0.13.9-SNAPSHOT on a project?
Dale Wijnand
@dwijnand
Sep 02 2015 19:25
10 rather
@jaceklaskowski
Guillaume Massé
@MasseGuillaume
Sep 02 2015 19:27
Hey I'm investigating a but in the incremental compilation of a project
and I get something like this of the apiDebug:
External API changes: API Changes: Set(NamesChange(slamdata.engine.physical.mongodb.BsonField$,ModifiedNames(regularNames = , implicitNames = )), NamesChange(slamdata.engine.physical.mongodb.expression.$lte$,ModifiedNames(regularNames = , implicitNames = )), NamesChange(slamdata.engine.sql.BinaryOperator,ModifiedNames(regularNames = , implicitNames = )), NamesChange(slamdata.engine.PhaseResult,ModifiedNames(regularNames = , implicitNames = )), NamesChange(slamdata.engine.fs.DirNode$,ModifiedNames(regularNames = , implicitNames = )),
ModifiedNames(regularNames = , implicitNames = ) <= is this expected ?
Adelbert Chang
@adelbertc
Sep 02 2015 20:03
on SBT 0.13.5, been doing compile/package/assembly/publish fine, but on a release I get an issue with my (indirect) use of macroparadise in a Scala 2.10 project
[error]      while compiling: <redated>
[error]         during phase: macroparadise
[error]      library version: version 2.10.4
[error]     compiler version: version 2.10.4
not too sure why its only happening during release
any ideas?
Guillaume Massé
@MasseGuillaume
Sep 02 2015 20:03
scaladoc ?
try doc
Adelbert Chang
@adelbertc
Sep 02 2015 20:08
trying
doc appears to work
Martin Duhem
@Duhemm
Sep 02 2015 20:09
@MasseGuillaume it doesn't look strange to me... Most likely those classes have been recompiled but their APIs have been unchanged.
Would you have expected an empty set for the
External API changes (sorry I'm on my phone)
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 20:21
@dwijnand using sbt 0.13.9 to build 0.13.10-SNAPSHOT
worked fine so far until the change :(
Dale Wijnand
@dwijnand
Sep 02 2015 20:34
@jaceklaskowski deleted anything I had about ivy d592b1b0f77cf706e882b1b8e0162dee28165fb2 and it worked
also just ran updateClassifiers to get the srcs and docs, and that worked too:
[info] downloading https://jcenter.bintray.com/org/scala-sbt/ivy/ivy/2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2/ivy-2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2-javadoc.jar ...
[info]     [SUCCESSFUL ] org.scala-sbt.ivy#ivy;2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2!ivy.jar(doc) (3915ms)
[info] downloading https://jcenter.bintray.com/org/scala-sbt/ivy/ivy/2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2/ivy-2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2-sources.jar ...
[info]     [SUCCESSFUL ] org.scala-sbt.ivy#ivy;2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2!ivy.jar(src) (3070ms)
which mirrors where it had downloaded the binary jar before:
[info] downloading https://jcenter.bintray.com/org/scala-sbt/ivy/ivy/2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2/ivy-2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2.jar ...
[info]     [SUCCESSFUL ] org.scala-sbt.ivy#ivy;2.3.0-sbt-d592b1b0f77cf706e882b1b8e0162dee28165fb2!ivy.jar (3857ms)
[info] Done updating.
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 20:36
let me check
Dale Wijnand
@dwijnand
Sep 02 2015 20:36
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 20:39
doh! that makes my life even more miserable :(
resolved!
had to remove few files and dirs under ~/.sbt and update succeeded!
whoohoo
jaceklaskowski @jaceklaskowski going to bed
Jacek Laskowski
@jaceklaskowski
Sep 02 2015 20:44
thanks @dwijnand !
Dale Wijnand
@dwijnand
Sep 02 2015 21:39
np