These are chat archives for sbt/sbt

5th
Dec 2016
Shane Delmore
@ShaneDelmore
Dec 05 2016 00:22
Hmm...inspecting those files gets me some progress further. I am setting up a local artifactory instance to cache requests and everything pulls from artifactory except plugins from repo.scala-sbt.org. I have a proxy for it setup, but it isn't getting called. I must not be removing the default repository built into sbt correctly.
Is there a way I can add this flag from the repositories document without modifying my launcher script? Some sort of global place to put sbt flags? -Dsbt.override.build.repos=true
OlegYch
@OlegYch
Dec 05 2016 00:34
i belive sbt docs have a whole page about setting up proxies
Shane Delmore
@ShaneDelmore
Dec 05 2016 00:38
That is what I am referring to, I have been working through that doc for two days embarassingly enough.
Got it all working finally, but what I would love is a way to have all plain old sbt commands on my computer use my local proxy only, without having to modify my launcher script with -Dsbt.override.build.repos=true
It seems there is a global.sbt, and a globally used plugins.sbt, but I haven't found the concept of a global flags.sbt. Would anyone be interested in me adding that if I could figure it out?
I want a way to say all sbt calls on this machine go through my proxy.
But worst case I guess I could add an alias to bash of sbt to set -Dsbt.override.build.repos=true
OlegYch
@OlegYch
Dec 05 2016 00:44
i vaguely remember smth like ~/.sbtopts
Shane Delmore
@ShaneDelmore
Dec 05 2016 00:45
that sounds perfect, I will search around for it.
Shane Delmore
@ShaneDelmore
Dec 05 2016 00:50
Oh weird, I would have never guessed /usr/local/etc/sbtopts instead of ~/.sbtopts.
OlegYch
@OlegYch
Dec 05 2016 00:58
how did you install sbt?
Shane Delmore
@ShaneDelmore
Dec 05 2016 00:59
Used PaulP's sbt-extras script.
Your tips got me unstuck @OlegYch Thank you so much. Everything works perfectly offline now even after blowing away my ivy cache except coursier, but that has nothing to do with SBT.
OlegYch
@OlegYch
Dec 05 2016 01:00
yw
unrelated but funny: i noticed recently that play sbt templates include gradle launcher
yet including sbt launcher in sbt projects is taboo
Shane Delmore
@ShaneDelmore
Dec 05 2016 01:01
Interesting.
SBT is so weird to me, from experience wise that is. It is my favorite built tool as a user, and my most hated as a dev.
At least I'm not ambivilent about it :D
Someday if I could ever by the person who thought it up a drink I would love to hear the design history that got it to hear. Super interesting to hear that what CBT is doing is basically what SBT was back at 0.7
drhumlen
@drhumlen
Dec 05 2016 16:51
(test in Test) := {
  flywayClean.value
  flywayMigrate.value
  (test in Test).value
}
When running my tests, i usually want the database to be cleaned & migrated first. However, when I use the code above, the order of the 3 tasks are "randomized" every time. How do I make the tasks above run in sequence?
( http://www.scala-sbt.org/0.13/docs/Howto-Sequential-Task.html didn't work for me, unfortunately. IntelliJ also red-underlines Def.sequential fsor )
Marcin Gałązka
@hipnoizz
Dec 05 2016 17:05
Is it possible to use different versions of a given plugin in the same, multi-module project? E.g. submodule foo uses PlayPlugin v2.4.x and submodule bar uses PlayPlugin v2.5.x?
Justin Kaeser
@jastice
Dec 05 2016 17:08
@drhumlen in what way does it not work? what is the code underlined by IntelliJ?
OlegYch
@OlegYch
Dec 05 2016 17:49
just don't ignore the returned values
eg val cleaned = clean.value; val migrate = migrate.value; etc
actually ignore that
probably best way is to make them depend on each other, like migrate <<= migrate.dependsOn(clean)
@hipnoizz not possible
Marcin Gałązka
@hipnoizz
Dec 05 2016 17:59
Hmm, that's unfortunate limitation.
Carlos Quiroz
@cquiroz
Dec 05 2016 19:41
Hi. I have a project reimplementing a java package (java.time) for scala.js. For practical reasons it is simpler to have the code in another package org.threeten.bp but I’d like to make releases renaming all the classes into the java.time package
I think I could either try transforming the already compiled files, or (probably simpler) edit the code in an sbt task renaming the packages and recompiling
I’m trying to find a way to hook a task before the compilation phase (only during packaging) to edit the files, and another task to revert the changes after the packaging/publishing is complete
Is something like this doable in sbt?