Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: neat trick using assemblyPackageDependency #25

Open
JoshRosen opened this issue Jan 30, 2016 · 2 comments
Open

Documentation: neat trick using assemblyPackageDependency #25

JoshRosen opened this issue Jan 30, 2016 · 2 comments

Comments

@JoshRosen
Copy link
Contributor

I learned about a neat trick in sbt-assembly which allows you to build separate JARs for your application's code and its dependencies: https://github.com/sbt/sbt-assembly#splitting-your-project-and-deps-jars

For example, if my build.sbt file contains

assemblyOption in assembly := 
  (assemblyOption in assembly).value.copy(includeScala = false, includeDependency = false)

dbcClasspath := Seq(assembly.value, assemblyPackageDependency.value)

then running dbcDeploy will upload two separate JARs (myproject-assembly-0.0.1-SNAPSHOT.jar and myproject-assembly-0.0.1-SNAPSHOT-deps.jar).

In principle, this might allow us to reduce the turnaround time when pushing a new version of a library from a slow connection (since we could skip re-upload of JARs whose SHAs are the same (not sure if we actually do this)). Even if we supported skipping re-upload of JARs that didn't change, that technique won't help users of the assembly unless they do the trick specified here, which is where I think this adds value.

Just wanted to write down this idea here so I don't forget about it.

@JoshRosen
Copy link
Contributor Author

Actually, one trick that might be helpful is to define separate SBT tasks for deploying the dependency and user code assemblies; although this would be somewhat more manual than figuring out what changed automatically, it should be easily doable and would greatly improve development turnaround times for me.

@ssemichev
Copy link

+1
It will be very useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants