-
Notifications
You must be signed in to change notification settings - Fork 12
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
De-duplicate Module.xml jar entries based on scope. #53
Merged
brianeray
merged 10 commits into
inductiveautomation:master
from
benmusson:fix/module-xml-jar-deduplication
Aug 26, 2024
Merged
De-duplicate Module.xml jar entries based on scope. #53
brianeray
merged 10 commits into
inductiveautomation:master
from
benmusson:fix/module-xml-jar-deduplication
Aug 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi @benmusson , thanks for the PR. Can you add a unit test in |
benmusson
force-pushed
the
fix/module-xml-jar-deduplication
branch
from
August 10, 2024 05:42
3010cfa
to
865d6f2
Compare
benmusson
commented
Aug 10, 2024
gradle-module-plugin/src/functionalTest/kotlin/io/ia/sdk/gradle/modl/task/WriteModuleXmlTest.kt
Show resolved
Hide resolved
add test for jar presence, duplication, and sort order linting
benmusson
force-pushed
the
fix/module-xml-jar-deduplication
branch
from
August 13, 2024 21:12
865d6f2
to
54b121e
Compare
@brianeray rebased/squashed |
@benmusson can you take a look at my stab in #56? I'll probably pull in a reviewer from our side too, someone who knows module dev, because I'm a build engineer. My focus is too narrow. I can do stuff in Gradle and JVM languages but not have the bigger picture in focus. |
paul-griffith
requested review from
paul-griffith
and removed request for
paul-griffith
August 16, 2024 22:28
Add `--foldJars` task option to preserve the old behavior by default, it's a breaking change and maybe the dups are useful to some. The option if passed does the scope folding and the sorting as before and another sort of folding for `CDG`-scoped jars, turning them into the `A`[ll]-scoped equivalent. Plus noticed that the tests fall into the `assertEquals` API trap where you think the argument order is `actual, expected` but it's really `expected, actual`. Completely nonintuitive and sort of asymmetric to other `assert*` APIs but when `assertEquals` fails having them in the wrong order makes things harder to troubleshoot.
brianeray
approved these changes
Aug 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The logic:
jarName
.jarName
, find all the scopes where it is applied and append them together in a list usingflatMap
.At this point the de-duplication is complete and the original issue is resolved. #52
I think it would also be a good idea to force a sort order for the jars, so I added it in.
scope
length (jars used in more places are listed first).scope
alphabeticallyjarName
alphabeticallyBefore:
After: