Make the output of PropertiesFileTransformer reproducible#1861
Make the output of PropertiesFileTransformer reproducible#1861Goooler merged 3 commits intoGradleUp:mainfrom
PropertiesFileTransformer reproducible#1861Conversation
|
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.
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.
There was a problem hiding this comment.
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.
|
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.