Greetings, I have spent a decent amount of time reading around the Scala world about using SBT with multi-module builds and I have to confess total confusion. There are many articles on how to do it. All which seem to be using deprecated versions of the SBT tool with features and procedures completely out of date. The SBT documentation itself seems to assume that you already know SBT really well to teach you how to do things in SBT which is ... odd ... to say the least. I found the docs to be cryptic and rely on a lot of assumptions that are simply not true for the beginner with SBT. As a result I keep hearing SBT is the best tool to build scala but I am having a heck of a time setting up what would be trivial with maven or gradle. Simply this.I have a project A which has two Subprojects B and C. Project C depends upon the code of project B. I want to be able to build A, B or C independently. So if I build A, it should build B and C, if I build B or C individually, they should only be built without requiring to build dependent projects. So I could farm out B to a team and C to a team and they would choose when to integrate new features in B. In maven this is exceedingly simple. In SBT, I have read so many contradictory things that to this date I have no clue how to accomplish it.
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Josh, we do eagerly await more progress on your Manning publication. Hope there will be no halt...
--
I have a project A which has two Subprojects B and C. Project C depends upon the code of project B. I want to be able to build A, B or C independently. So if I build A, it should build B and C...
So everyone using sbt keeps all their code in one great big hair ball? That is not a valid work flow in my opinion. Or do they do something else to achieve separation of projects?
On 18 February 2014 00:00, kraythe . <kra...@gmail.com> wrote:
So everyone using sbt keeps all their code in one great big hair ball? That is not a valid work flow in my opinion. Or do they do something else to achieve separation of projects?I've found that the opposite is generally true.If you need to work on stuff in separate teams, then you manage the code as entirely independent projects with dependencies handled at a binary level via maven/ivy resolution.It's attempting to shoehorn things into a single project/codebase that causes hairballs.
I don't have a problem having them be completely separate projects. What I haven't seen is a way to glue them together. So In maven I would have project B have a pom file and push its deployable library to a repository and then have project C depend on that deployable via artifactID, groupID and version. Yet in SBT i don't see how I would push anything to a local repository or otherwise put it where it could be found. I suppose I could have a pom and use maven to do that, or ivy and ant, but then what would be the point of SBT if I have to use Maven anyway. The documentation around this is very sketchy. SBT doesn't have its own repository I gather? How do I do the equivalent of mvn install for local binary installation or mvn deploy for remote upload to something like artifactory.Try goggling "sbt multi module build" and see the massive amount of contradictory information. And if you stick with the SBT site there is not enough official documentation.Very frustrating. I want to spend time working on my app, not fighting a build system. Tempted to go back to gradle or maven.
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Josh,Is there an expected release date for v.1.0 ? Or is everything still work in progress?
I don't have a problem having them be completely separate projects. What I haven't seen is a way to glue them together. So In maven I would have project B have a pom file and push its deployable library to a repository and then have project C depend on that deployable via artifactID, groupID and version. Yet in SBT i don't see how I would push anything to a local repository or otherwise put it where it could be found. I suppose I could have a pom and use maven to do that, or ivy and ant, but then what would be the point of SBT if I have to use Maven anyway. The documentation around this is very sketchy. SBT doesn't have its own repository I gather? How do I do the equivalent of mvn install for local binary installation or mvn deploy for remote upload to something like artifactory.Try goggling "sbt multi module build" and see the massive amount of contradictory information. And if you stick with the SBT site there is not enough official documentation.Very frustrating. I want to spend time working on my app, not fighting a build system. Tempted to go back to gradle or maven.
--
Well there is some very good information on this thread and I hope it helps others in the future. I think the maven -> sbt guide would be a fantastic thing. It would have helped me tremendously.
Honestly my adventure with SBT has had a number of pitfalls. I definitely have had problem with multi-module builds but also build files that are sensitive to whitespace (the double spaced lines) are very 80's sort of feel to me. Not since then have I worked with a computing tech that cared about whitespace, much less blank lines. I think one feedback I would have to the SBT team is to find some way of getting rid of that issue. I am not enough of a scala expert to even make a suggestion here. I would rather write a build.scala file then do a double spaced thing. In fact Gradle builds are essentially groovy scripts, why can't SBT do the same with scala scripts?
In fact Gradle builds are essentially groovy scripts, why can't SBT do the same with scala scripts?
If you need to work on stuff in separate teams, then you manage the code as entirely independent projects with dependencies handled at a binary level via maven/ivy resolution.
It's attempting to shoehorn things into a single project/codebase that causes hairballs.
Can anyone tell us how I could get rid of the build.sbt file and write that in Scala?
Great to hear! I would be curious what the problems were with them being scala scripts. I have to say that is one of the things that attracted me to gradle for Java builds, is the ability, the flexibility to do things in the build file that maven doesn't allow without a plugin. Plugins are well and good but extremely heavyweight for one-offs or little tasks of only a few lines of code. I hope that in the future the SBT team maintains the ability to use .scala build files.
One other thing I think you will have to get away from ivy for dependencies for all the reason that gradle got away from it. Snapshots being a problem among other things. Another thing I would like to see (which maybe is there, I don't know) is a good intraprocess communication API so editors like Emacs could be wired up to be integrated without having to go to java based libs or fancy tricks.
At any rate thanks for the info and If I knew as much about scala as I do about java Id jump in and help. :) It seems to have great promise.-- Robert
On Wednesday, February 19, 2014 9:00:09 AM UTC-6, Josh Suereth wrote:
On Tue, Feb 18, 2014 at 11:26 PM, kraythe <kra...@gmail.com> wrote:
Well there is some very good information on this thread and I hope it helps others in the future. I think the maven -> sbt guide would be a fantastic thing. It would have helped me tremendously.
Honestly my adventure with SBT has had a number of pitfalls. I definitely have had problem with multi-module builds but also build files that are sensitive to whitespace (the double spaced lines) are very 80's sort of feel to me. Not since then have I worked with a computing tech that cared about whitespace, much less blank lines. I think one feedback I would have to the SBT team is to find some way of getting rid of that issue. I am not enough of a scala expert to even make a suggestion here. I would rather write a build.scala file then do a double spaced thing. In fact Gradle builds are essentially groovy scripts, why can't SBT do the same with scala scripts?In terms of having build scripts be "scala scripts", we're working back towards that. Having builds be raw Scala files has its own set of problems that we decided to migrate away into a 'scala-like' DSL. However, you *can* still use .scala for your build if desired, as I do for a good number of my builds, like: https://github.com/sbt/sbt-remote-control/blob/master/project/build.scala
Agreed, we have hundreds of independent SBT projects in their own repositories. Some are "simple" SBT projects, some are multi-projects (for things like server and client libraries which we want to release together).We have a "meta"-plugin which all these projects use which aggregates a number of other plugins, does a lot of default configuration, and implements some of our custom functionality (like additional release steps).
I suspect your question may have been misunderstood. Please clarify:
Do you simply want to set up an sbt project with multiple subprojects that have various dependencies between each other?
Or do you specifically need that the projects can be used *both* as subprojects within one build, *and* as standalone projects whose interdependencies are only declared via libraryDependencies?
I believe your question sounded like you wanted the latter, but I suspect you really just want the former.
While we are at it, I would love to have an annoying maven issue fixed n SBT. Lets say I have a two projects where project A depends on project B version 1.0.0. Id like to be able to declare that project A depends on project B version 2.0.0 and have the tool fetch either the release (if available) or the snapshot if there is no release available. Having to go back and retroactively change all dependencies in release is a bloody pain.
--
--
You received this message because you are subscribed to a topic in the Google Groups "scala-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-user/a8CJUG3BmuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-user+...@googlegroups.com.