These are chat archives for sbt/sbt

29th
Mar 2017
eugene yokota
@eed3si9n
Mar 29 02:20
@adelbertc for the most part changing build.properties alone should let you upgrade sbt for the build, but there are certain feature that requires installation on the system. iirc preference of default resolvers HTTPS, Maven Central vs JCenter might require launcher update. JDK 9 support in 0.13.14 also requires update because some hacks are in the bash script.
Dale Wijnand
@dwijnand
Mar 29 02:52
my suspision is its currently just refusing to go up, but i dont have any evidence backing it atm besides the error messages im seeing
what error messages are you seeing?
ykycxzsv
@ykycxzsv
Mar 29 09:30

i have the following files:
build.sbt

lazy val proj1 = project in file("proj1") settings (name := "test")
lazy val proj2 = project in file("proj1/proj2")

proj1/build.sbt

version := "1"

proj1/proj2/build.sbt

lazy val proj1 = project in file("..")
version := (version in proj1).value

the goal is for proj2 to inherit a value from proj1 (e.g. version), and it almost works, the problem is that when i inspect proj1/name, i get "proj1" instead of "test". it seems that proj1 is initialised by proj2 due to the ".." reference, and then further settings in the root build.sbt are ignored. is there a better way to achieve inherited values without having additional settings ignored?

Yohei Onishi
@yohei1126
Mar 29 09:43
Does sbt support proxy authentication? It does not work in my office. I am reading sbt launcher code. lt seems it just set http.proxyUser and http.proxyPassword to system property but I think Java ignores those property. https://github.com/sbt/launcher/blob/1.0/launcher-implementation/src/main/scala/xsbt/boot/CheckProxy.scala
Dale Wijnand
@dwijnand
Mar 29 10:03
@ykycxzsv that use case isn't well supported. Most sbt builds follow the convention of one single build.sbt file, and push utilities to project/*.scala files and/or sbt plugins.
ykycxzsv
@ykycxzsv
Mar 29 10:35
@dwijnand hmm, so for multi-project sbt builds, if i want two subprojects to share the version number, it either has to be done by remembering to update both by hand, or through a script or similar hack?
Dale Wijnand
@dwijnand
Mar 29 10:36
no, the best way is to define version in ThisBuild
then the version is set once for all subprojects
ykycxzsv
@ykycxzsv
Mar 29 10:37
i'm trying to share version number between specific subprojects, not all of them
is it possible to define a scope similar to ThisBuild, and specify which projects are part of it?
Dale Wijnand
@dwijnand
Mar 29 10:40
the best way then is to define it in an object in project/Foo.scala
but do know that sbt is kind of biased towards its sub-projects being modules of the same whole, with the same version.
So you might find some friction.
Just so you're aware. It might actually be fine.
ykycxzsv
@ykycxzsv
Mar 29 10:45
having to update .scala files rather than a plain "version.sbt" in the release script complicates things. i guess i'll try to figure out a hack to work around it for now
maybe i can manually parse ../version.sbt instead of using "version in (project in file(".."))"
Dale Wijnand
@dwijnand
Mar 29 12:06
you could do this: version := (version in LocalProject("proj1")).value
ykycxzsv
@ykycxzsv
Mar 29 12:20
that's a lot more elegant than parsing, thanks!
Dale Wijnand
@dwijnand
Mar 29 12:22
no worries
Kason Chan
@kasonchan
Mar 29 14:39
How can i include all files in a directory foo/ (on same level as the src/ or app/ and build.sbt) to final package? i.e. play application. same specified directory at the end final package. Thank you
OlegYch
@OlegYch
Mar 29 14:45
take a look at unmanagedResourceDirectories
Dale Wijnand
@dwijnand
Mar 29 14:54
@kasonchan have a look at mappings
Ben Fradet
@BenFradet
Mar 29 17:11
does anyone know how to make ghpagesPushSite work with 2FA? can't remember for the life of me
Dale Wijnand
@dwijnand
Mar 29 17:14
Using an ssh URL instead of https, maybe?
Ben Fradet
@BenFradet
Mar 29 17:21
yup, it worked thanks a lot @dwijnand , I don't how I managed to do it last time since I still had a git@-like remote repo but w/e :+1:
I did the other way around though, supplied an https gitRemoteRepo instead of git@-like and it prompted me for my token
Dale Wijnand
@dwijnand
Mar 29 17:25
Ok cool :)
Rob Norris
@tpolecat
Mar 29 17:25
Is it possible to re-evaluate a setting within a task? I'm using sbt-git to set the project version and I want to repaint the prompt in red if the version.value isn't the same as what it would be if it were re-computed right now.
Part 1 is, did I express that question clearly.
Dale Wijnand
@dwijnand
Mar 29 17:53
Yep, it's clear to me.
I too would like to know how to do that.
I have a ticket with a or some references in my alternative to sbt-git, sbt-dynver.
Sorry I can't link, I'm on mobile.
dwijnand/sbt-dynver#2
Adelbert Chang
@adelbertc
Mar 29 18:49

what error messages are you seeing?

@dwijnand
So the SBT version on the server is 0.13.5 (or it should be anyways..), the build.properties for one SBT project is 0.13.5 and another is 0.13.13, but i'm seeing in the logs [2K[info] Resolving org.scala-sbt#sbt;0.13.8 ... (a couple lines similar to that)

the errors im seeing is that we sign JARs internally and 0.13.8 isnt signed yet, so our build system freaks out
i'm just wondering why 0.13.8 is being downloaded at all
Dale Wijnand
@dwijnand
Mar 29 18:54
That's bizarre. I have no idea.
The version of the sbt module is defined in terms kd build.properties.
So something amiss somewhere.
Adelbert Chang
@adelbertc
Mar 29 18:55
ill dig deeper
im using coursier
i assume that shoiuldnt matter
coursier, doge, and revolver
Dale Wijnand
@dwijnand
Mar 29 18:56
Just as a resolver? Or it's new launcher thing too?
Adelbert Chang
@adelbertc
Mar 29 18:56
just in plugins.sbt
$ cat project/plugins.sbt 
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15")
addSbtPlugin("com.eed3si9n"    % "sbt-doge"     % "0.1.5")
addSbtPlugin("io.spray"        % "sbt-revolver" % "0.8.0")
Rob Norris
@tpolecat
Mar 29 19:38
So if your shellPrompt has a newline in it, sbt escapes everything (including ansi codes) to make it a single line again.
I do not think this is a feature.
Rob Norris
@tpolecat
Mar 29 19:52
Well. Fixed sometime after 0.13.11
nevermind. confidence high
Adelbert Chang
@adelbertc
Mar 29 21:01
@dwijnand hm OK so i got access to the server and it looks like the SBT installed there is 0.13.8. It's been running in an SBT project w/ build.properties=0.13.5 just fine for a while. recently i started building it against the 0.13.13 project and only then does it start download SBT 0.13.8... is that expected?
Dale Wijnand
@dwijnand
Mar 29 21:06
No. My understand is the 0.13.8 launcher should download the 0.13.13 artefacts of sbt.
If you can find a way to share a reproduction I might be able to provide better insight.
Adelbert Chang
@adelbertc
Mar 29 21:09
is there a flag i can pass to sbt to make it print the default version/
?
Dale Wijnand
@dwijnand
Mar 29 21:15
not easily. you can run sbt about in an empty directory, or you can peek into the launcher jar
Adelbert Chang
@adelbertc
Mar 29 21:19
would Process(List("sbt", "compile"), "some/directory/here") cause it not to pick up the SBT build.properties for the project defined in some/directory/here ?
Dale Wijnand
@dwijnand
Mar 29 21:24
yes it should
your "not" is throwing me
I expect that to read the sbt.version in some/directory/here/project/build.properties
Adelbert Chang
@adelbertc
Mar 29 21:26
hmmmmmmm
the plot thickens
Chandra Sekhar Kode
@chandu0101
Mar 29 23:13
how to open new bash terminal from sbt task
 dev in config := { 
  // open a new terminal and run `npm start`
 ...
}