Skip to content

Use constant timestamps for shadowed sources JAR entries - #2346

Open
Goooler wants to merge 1 commit into
g/20261025/parallel-shadowed-sourcesfrom
g/20261025/sources-jar-constant-timestamps
Open

Goooler wants to merge 1 commit into
g/20261025/parallel-shadowed-sourcesfrom
g/20261025/sources-jar-constant-timestamps

Conversation

@Goooler

@Goooler Goooler commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Nobody consumes the timestamps of the shadowed sources JAR, so its entries now always use CONSTANT_TIME_FOR_ZIP_ENTRIES, regardless of isPreserveFileTimestamps. Since Gradle 9, archive tasks default to preserveFileTimestamps = false, so this only changes the output when it is explicitly enabled.

This lets the shadowed sources JAR share the parent directory entry writing with ShadowCopyAction. That logic moves from ShadowCopyAction.addDirs to ZipOutputStream.writeParentDirectoryEntries. As a result, directory entries in the sources JAR are now ordered deepest first (e.g. z/sub/, z/), matching the shadowed JAR. Entry order doesn't affect consumers, since ZIP readers look entries up through the central directory.

Follow up #2265.

Nobody consumes the timestamps of the shadowed sources JAR, so always use
CONSTANT_TIME_FOR_ZIP_ENTRIES. This lets it share the parent directory
entry writing with ShadowCopyAction.
@Goooler
Goooler added this pull request to stack #2347 October 25, 2026 12:09

This branch has not been deployed

No deployments
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.

1 participant