These are chat archives for sbt/sbt

11th
Aug 2016
Perry
@pfn
Aug 11 2016 03:15
it often means you have 2 conflicting versions of the same artifact
users who have both android-sdk-plugin and sbt-android run into this all the time, because of the rename
Simon Hafner
@reactormonk
Aug 11 2016 07:42
How would I create a new project for another language, e.g. without all the JVM stuff?
... something so I can build dependencies from sbt
Simon Hafner
@reactormonk
Aug 11 2016 07:57
How do I run a main class of a project from build.sbt as a Task.def ?
... as part of a Task.def
Simon Hafner
@reactormonk
Aug 11 2016 13:53
Is there a way I can lift a Task into an sbt.inc.Analysis?
I'm wondering if I can override the compile with something totally different.
Simon Hafner
@reactormonk
Aug 11 2016 14:08
How do I say sharedJVM/compile:fullClasspath in scala?
OlegYch
@OlegYch
Aug 11 2016 14:13
in Compile in sharedJVM, probably
Colt Frederickson
@coltfred
Aug 11 2016 15:01
For posterity, @OlegYch was right. You have to import the object which has the keys. for sbt-sublime that is import com.orrsella.sbtsublime.SublimePlugin.autoImport._. He was also right that the NCDFE is a a 'nuke all the things from orbit' scenario. Thanks to @agemooij for confirming in the ticket.
Age Mooij
@agemooij
Aug 11 2016 15:04
@coltfred as I just mentioned in the ticket, I'm not sure whether @eed3si9n and the other SBT committers are ever planning to expose the contents of plugin autoImport objects to global plugin configurations. It would be great of they did since it would save a lot of explicit (and fairly ugly) imports in my global SBT config.
Simon Hafner
@reactormonk
Aug 11 2016 15:26
@OlegYch looks good, thanks
Simon Hafner
@reactormonk
Aug 11 2016 15:31
How do I write clientJS/*:baseDirectory ? complains about undefined setting, but I got (baseDirectory in clientJS) := .. above.
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:25
Hi folks. Sorry to bother you all, and apologies if this is the wrong channel. I am facing a strange issue when running sbt with a multi-project configuration. I have implemented a custom command, added it to the .settings as follows for each project, includying the root one: commands ++= Seq(SemVer.setSemanticVersion). If I enter the sbt shell, go to the right project (e.g. project core) and then run the command (e.g. setSemanticVersion) it works. However, if I run directly from the command line sbt core/setSemanticVersion it fails miserably. Does anyone know why?
Alexey Alekhin
@laughedelic
Aug 11 2016 16:28
Probably because you cannot scope commands? So sbt setSemanticVersion should work
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:31
So, then how sbt core/compile works?
That doesn't make any sense.
Alexey Alekhin
@laughedelic
Aug 11 2016 16:31
compile is a task, not a command
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:31
(In my opinion, of course)
I can't use tasks for this scenario as I am trying to update the version value.
So that's where commands appeared, :(
Alexey Alekhin
@laughedelic
Aug 11 2016 16:32
I don't know. If you really need that project scoping, you probably can pass it as a command argument..
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:33
You mean like sbt -Dsemantic.version=0.1.0 etc.?
Alexey Alekhin
@laughedelic
Aug 11 2016 16:36
no, I mean sbt 'setSemanticVersion core', where the command parses project name and applies settings in the corresponding scope
are you sure you need that project scope at all? how do you set version in the command? can you show its code?
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:37
Absolutely. Just one sec.

``` def setSemanticVersion = Command.command("setSemanticVersion") { state: State =>
val extracted = Project extract state
import extracted._

val currentVersion = extracted.get(version)
println("> Current version: " + currentVersion)

val nextVersion = extracted.get(CustomSettings.nextSemanticVersion)
println("> Next candidate version: " + nextVersion)

println("> Setting version to: " + nextVersion)
append(Seq(version := nextVersion), state)

}```

Sorry for the format.
It's still work in progress as you can imagine. The idea I have in mind is to chain this with publishTo (into Artifactory) and/or docker:publish.
As it is a multi-project project, I don't need to publish all the artifacts. In this case, I just to publish a client sub-project.
Alexey Alekhin
@laughedelic
Aug 11 2016 16:40
I'm not sure, but I think that when you're doing extracted.append(..., state) you apply settings in the project corresponding to the state where you run it. So probably running first project foo and then your command (wihtout args) will work
sbt 'project foo' 'setSemanticVersion'
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:41
Let me try it.
Oh, wow. It worked!
I runned sbt 'project core' 'setSemanticVersion' 'publishLocal' as a simple test and it published the versioned artifact locally.
Alexey Alekhin
@laughedelic
Aug 11 2016 16:42
cool :+1:
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:42
You're the best, @laughedelic. Thanks so much.
Alexey Alekhin
@laughedelic
Aug 11 2016 16:43
haha :sweat_smile: you're welcome
by the way, if you're not going to do much else in that command, you could just call directly
sbt 'project core' 'set version := CustomSettings.nextSemanticVersion.value' 'publishLocal'
Luis Cappa
@luiscappabanda_twitter
Aug 11 2016 16:45
Yes, the idea is to keep that command very simple. It just get the necessary info to "build" the new version and that's all.
Colt Frederickson
@coltfred
Aug 11 2016 19:50
@agemooij Agreed, but for now I'll just update the doc to at least help noobs like me.
drocsid
@drocsid
Aug 11 2016 20:30
I was just using the console for sbt and all of a sudden: [1]+ Stopped sbt console
I don't think I hit control Z or sent it a signal, so is this expected?
The job doesn't appear in jobs...
Perry
@pfn
Aug 11 2016 21:59
something sent a sigtstp
drocsid
@drocsid
Aug 11 2016 22:05
:worried: wasn't me
Russell Spitzer
@RussellSpitzer
Aug 11 2016 22:57
Hey folks, I've been working to do something simple but I seem to have a great deal of difficulty doing this. I want to make the artifact of an assembly task become the main artifact of a project.
Quick background, I work on the Spark Cassandra Connector and recent changes in Spark have made it necessary for us to shade some key libraries (guava and netty). I've built a project that builds the shaded jar but I'd like this task's output to be the standard artifact which is published
Is there a way to accomplish this?
Russell Spitzer
@RussellSpitzer
Aug 11 2016 23:07
I've been experimenting with something like packageBin := (assembly in shadedConnector).value