-
-
Notifications
You must be signed in to change notification settings - Fork 424
Make the output of PropertiesFileTransformer reproducible
#1861
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
Conversation
|
Depends on #1856 |
751dddc to
64714f4
Compare
64714f4 to
1bcd72c
Compare
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ReproducibleProperties.kt
Outdated
Show resolved
Hide resolved
`PropertiesFileTransformer` leverages `java.util.Properties`, which relies on `java.util.Hashtable`. The serialized properties are not guaranteed to be reproducible. This change changes the transformer to use a sorted map to generate reproducible output. The existing class `CleanProperties` is replaced with `ReproducibleProperties`. Functionality around charset handling is retained, and extended with a functionality to generate unicode escapes (ASCII output).
30d2084 to
f7c0b62
Compare
|
Okay, GH is broken :( |
|
Let's wait to tomorrow 😁 |
f7c0b62 to
2a77ea6
Compare
|
Oh, it's the "zulu" installer that barks. |
b700d69 to
2a77ea6
Compare
f53e3ed to
8871cd9
Compare
PropertiesFileTransformer - make merged properties reproduciblePropertiesFileTransformer reproducible
8871cd9 to
87e0a2c
Compare
| }.toString().reader().buffered() | ||
|
|
||
| private val String?.couldBeCommentWithTimestamp: Boolean get() { | ||
| return this != null && startsWith("#") && length == lengthOfExpectedTimestamp |
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.
The old logic is useful for removing date comments only. All comments are removed in this PR. See Goooler#102 (comment).
I'm considering whether we should introduce a new property to opt for the feature in. The new flag will control:
- Remove all comments or not.
- Sort all properties or not.
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.
The comment was always empty
You are right!
add a new comment...
Let's keep the current behavior; otherwise, we need to add comments for the property-related transformers.
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.
Updated a test for comments, see #1868.
|
I reverted the name change of |
|
Addressing the renaming to #1869. |
PropertiesFileTransformerleveragesjava.util.Properties, which relies onjava.util.Hashtable. The serialized properties are not guaranteed to be reproducible.This change changes the transformer to use a sorted map to generate reproducible output. The existing class
CleanPropertiesis replaced withReproducibleProperties.Functionality around charset handling is retained, and extended with a functionality to generate unicode escapes (ASCII output).
Refs #1848.