-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add shading support #162
Add shading support #162
Conversation
Awesome! Thanks for this contribution! |
@@ -0,0 +1,18 @@ | |||
package org.pantsbuild.jarjar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this into package sbtassembly
? If Pants is using that name, I don't want to collide with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid we can't, since process
method in JarProcessor
is package private.
I'm not sure why they use such a method signature.
Do you mind adding some documentation on README? |
(version.isEmpty || version.get == mod.revision) | ||
} | ||
|
||
case class ShadeRule(rule: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like ShadeRule
should a sealed trait, and Rename
, Remove
, KeepOnly
should each be a case class under object ShadeRule
. I can do that refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add more doc after all these refactoring :)
hi @eed3si9n, could you please help review the refactored code when you're convenient. thanks :) |
Refactoring looks good! |
hi @eed3si9n , scripted tests added. |
Thanks again. |
Add shading support, #156.
In this PR, a new assembly setting key is introduced, namely
assemblyShadingRules
e.g.
assemblyShadingRules
consists of a sequence of shading rules. And there're three types of shading rules in total, they're:Shader.rename
,Shader.remove
,Shader.keepOnly
. For each shading rule, it can be applied to a list of targets:applyToCompiling
means applying it to current module, andapplyTo
means applying it to some dependency artifact.These three types of shading rules originated from jarjar rules, for details please go to this link.