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

Include non-relocated modules when running shadedTest. #181

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented Jun 21, 2024

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.

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.
Copy link
Contributor

@jrhee17 jrhee17 left a 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 🙇

Comment on lines +379 to +380
shadedJarTestImplementation.dependencies.add(
project.dependencies.project(path: dep.dependencyProject.path))
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

@jrhee17 jrhee17 self-requested a review June 24, 2024 03:16
@jrhee17
Copy link
Contributor

jrhee17 commented Jun 24, 2024

Approved by mistake 😅

Copy link
Member

@trustin trustin left a 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!

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @minwoox!

@minwoox minwoox merged commit 04ce7b0 into line:main Nov 6, 2024
1 check passed
@minwoox minwoox deleted the non_relocated_module branch November 6, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants