4 ms·
I wish that sbt had the ability to work with exploded scala source dependencies, instead of insisting everything work in the JAR world. I am used to working wit
by sandGorgon 13y ago
I wish that sbt had the ability to work with exploded scala source dependencies, instead of insisting everything work in the JAR world. I am used to working with rubygems/pip and love the ability to go and screw around in the libraries. When I'm ready to package, I can run "sbt assembly" instead and it can take a little longer to build a packaged JAR.
Clojure/leiningen has the same issue (although there are ways to get the source itself as well [1], but nowhere as clean as rubygems).
[1] http://stackoverflow.com/questions/14395413/how-do-i-make-leiningen-download-the-source-of-a-required-library http://stackoverflow.com/questions/14395413/how-do-i-make-le...
- eeperson 13y agoWhy do you want this?
- ssmoot 13y agoCould you elaborate what you mean by "insisting everything work in the JAR world"? SBT works with git submodules, git sources, other URI or File sources for dependencies. So you must mean something else, but I'm having trouble parsing.
- sandGorgon 13y agoRubygems and Python packages are source packages. When you used the package management tools in those languages, these packages are downloaded to somewhere in your path and used within the code you are writing. In fact in Rubygems, you can point to a Ruby git repository (like github) and have dependency management happen from there - no necessity for a centralized repository (like maven.org). This is how you share a ruby gem - http://guides.rubygems.org/publishing/#sharing_source_code http://guides.rubygems.org/publishing/#sharing_source_code . I can now specify in my Gemfile to pull a particular branch/tag/version of the gem directly from revision control. The same thing happens with SBT or leiningen, except that they are JARs. I believe this comes from using maven as the backend. Therefore, either you need to setup a local repository or publish to Sonatype or some other place. This is how you share your scala code - http://www.scala-sbt.org/0.13.1-SNAPSHOT/docs/Detailed-Topics/Publishing.html http://www.scala-sbt.org/0.13.1-SNAPSHOT/docs/Detailed-Topic... . Remember, publishing means packaging into a JAR. If you were too lazy to package your code into a jar and publish it ... well, then it's cumbersome to work directly from the repo. I really, really wish scala/clojure would enable the ability to work directly with source as packages - the big, big reason why it's not is the maven backend.
- edwinnathaniel 13y agoSeems easy to attach source and javadoc in Maven pom.xml: http://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html http://maven.apache.org/plugin-developers/cookbook/attach-so... Can't you use maven with your scala project? Most open source Java lib/framework that publish their JARs to the central Maven repository also publish their Source code and JavaDoc JARs as well. This is where I applaud the Java OSS community.
- eeperson 13y agoI'm not sure I understand why this is a problem. SBT, leiningen, maven and pretty much every other build tool on the JVM supports publishing source jars. I think SBT even does it by default. Nearly all of the open source projects I have worked with on the JVM publish their source jars (Grails used to not but even they do now). Are you running in to a lot of projects that don't publish their sources? Also, SBT can use use other SBT projects in github repos as depedencies: http://alvinalexander.com/scala/using-github-projects-scala-library-dependencies-sbt-sbteclipse http://alvinalexander.com/scala/using-github-projects-scala-...
- ssmoot 13y ago> In fact in Rubygems, you can point to a Ruby git repository (like github) and have dependency management happen from there - no necessity for a centralized repository (like maven.org). That's a feature of Bundler, not Rubygems. > The same thing happens with SBT or leiningen, except that they are JARs. I believe this comes from using maven as the backend. Therefore, either you need to setup a local repository or publish to Sonatype or some other place. I don't follow. I mean, you don't need to setup a local repository anymore than you need to setup a local Rubygems repository. Checkout this anonymized and trimmed up `build.sbt` for the project I'm currently working on: https://gist.github.com/sam/7162604 https://gist.github.com/sam/7162604 It's got a number of JAR dependencies, followed by project references to projects on the local filesystem as well as Github, neither of which are JARs. In fact, because I don't have much clue how to distribute my own libs on maven.org, I don't bother. If you want to use it, just drop the URI into your build.sbt and away you go. Is this not what you're looking for? If you want to create a JAR (say for deployment), and you're not working with a Play application, and you don't want to publish the JAR to a repository, that's cool too. Just run `package`, or use the sbt-assembly plugin. Just takes a couple seconds. SBT is basically Rake + Bundler + RVM + Guard + RDoc all in one. I'm not aware of anything that those do that SBT can't. It's pretty easy to pick up as well. People complain about it, but I've personally invested a lot less time learning SBT than I have in those tools and feel like I'm probably as proficient at this point.
- th0br0 13y agoCan't you just declare those exploded source deps as submodules?