-
Notifications
You must be signed in to change notification settings - Fork 403
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
Create separate shadowJars for code and dependencies #443
Comments
That's a really interesting way to do this. Do the relocations apply correctly to the source files? |
@johnrengelman doing a quick inspection of the strings in the class file, it looks like the relocation is applied in the source files. So it seems to do the right thing. I wanted to make this reusable across many projects so package it as a gradle plugin for easy usage. Ideally I would like :
I was hoping I could achieve this by extending what I have started with and some way copying the settings from |
I think I've got a solution -- at least, it's a solution that works for me. I've adapted jayadev's example to fit my needs:
I'm not a gradle pro, so there's a darn good chance I'm not covering all scenarios I should. |
I run into the same problem. Thanks for your work - it helped me solving it. The importat line is this: Would love to see this supported out of the box in shadowJars |
@jschneider add into main / module's build.gradle
|
I think I found an easier way to do this, at least in the case where you can filter by the ResolvedDependancy. In my case I dont want two shadowed jars, just one for "my" app projects; the rest are fine as individual jars like usual without shadow. Example to only include dependencies that are from
|
Using the awesome shadow plugin version 4.0.2 and gradle 4.10, I wanted to create two separate shadowJars, one for my source code and another for my dependencies (since dependencies are large and rarely changes I don’t want to repackage them every time I change my source code). What I have in mind is to have a gradle plugin that add two separate tasks and which takes the same configurations supplied by user for shadowJar and overrides the configurations/sources used to create the shadowJar.
Below is what I have got so far, still trying to figure out a clean way to pass the shadow configs only once and whether there are other gotchas I need to worry about (ex: having two mergeServiceFiles will break etc)
from
orconfigurations
part alone for my purposeAnybody has attempted something similar ?
The text was updated successfully, but these errors were encountered: