-
Notifications
You must be signed in to change notification settings - Fork 30
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
Include non-relocated modules when running shadedTest
.
#181
Conversation
Motivation: When a non-relocated module (Module A) is used by a relocated module (Module B), running `:B:shadedTest` results in a `NoClassDefError` because Module A is not included in Module B's `shadedJarTestImplementation` configuration. Modifications: - Included non-relocated modules (e.g., Module A) in the `shadedJarTestImplementation` configuration of relocated modules (e.g., Module B). - Raised an exception if a non-relocated module needs to be relocated. Result: - Running `shadedTest` for relocated modules now includes necessary non-relocated modules.
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.
Left a minor question 🙇
shadedJarTestImplementation.dependencies.add( | ||
project.dependencies.project(path: dep.dependencyProject.path)) |
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.
Question) I haven't been able to look into this in detail. If the project.dependencies
contains a dependency that should've been shaded, will this case be covered correctly?
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 believe so. An exception will be raised from here:
https://github.com/line/gradle-scripts/pull/181/files#diff-5c14d66c4edef5e74eac3b83b26ba720aafc5b5b008248dea72d951aa64170deR357-R360
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.
Checked that transient dependencies aren't taken care of for some reason previously as well which made me confused.
I guess functionally there is no difference then.
Approved by mistake 😅 |
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.
Looks good to me. Thanks, @minwoox!
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.
👍 👍 👍
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.
Thanks, @minwoox!
Motivation:
When a non-relocated module (Module A) is used by a relocated module (Module B), running
:B:shadedTest
results in aNoClassDefError
because Module A is not included in Module B'sshadedJarTestImplementation
configuration.Modifications:
shadedJarTestImplementation
configuration of relocated modules (e.g., Module B).Result:
shadedTest
for relocated modules now includes necessary non-relocated modules.