[GRADLE-2698] Gradle copy task does not preserve file modification times Created: 06/Mar/13 Updated: 25/Jan/17 Resolved: 25/Jan/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.4 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Daniel Beck | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 13 |
Description |
The Gradle copy task does not preserve file modification times even when not changing the file contents. There should at least be an option to preserve these times. |
Comments |
Comment by Jochen Kemnade [ 04/Dec/14 ] |
This still affects 2.2. |
Comment by Ronald Brindl [ 03/Jun/15 ] |
Based on Jochen's comment I did the following workaround. task extractSomeStuff(type: Copy) { from zipTree(tasks.createSomeStuff.archivePath) destinationDir temporaryDir def copyDetails = [] eachFile { copyDetails << it } doLast { copyDetails.each { FileCopyDetails details -> def target = new File(destinationDir, details.path) if(target.exists()) { target.setLastModified(details.lastModified) } } } } |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Jochen Kemnade [ 16/Nov/16 ] |
This issue affects Gradle 3.2. I can create a sample Gradle build if you like, but I think the issue should be clear without it. |
Comment by Benjamin Muschko [ 24/Jan/17 ] |
@Jochen Could you please provide an reproducible example and add it to a new issue on GitHub? |
Comment by Jochen Kemnade [ 25/Jan/17 ] |
Comment by Benjamin Muschko [ 25/Jan/17 ] |
Thanks, @Jochen. |