You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Executing gradle spotlessApply changes permission on the changed files from 644 to 755 #654
I guess maven users probably have the same problem. The case there is a little simpler, there's no copy, just writeCanonicalTo. No obligation for a PR to fix all plugins, but I'll leave this open until it has been fixed in both plugins.
Thanks for the pointers. With java.nio.file.attribute not providing an files system agnostic file mode approach, I believe the only option then would be remembering the original file attributes by copying the original file to the temp location, updating it, and then copying it back to the final location; a PR for this is in the making.
Activity
nedtwigg commentedon Jul 29, 2020
Interesting! There are two tasks involved.
spotless<Format>writes a correctly formatted file out to a temp location in thebuildfolder:spotless/lib/src/main/java/com/diffplug/spotless/PaddedCell.java
Lines 264 to 266 in 43e4e97
And then
spotless<Format>Applycopies that file into the final locaitonspotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessApply.java
Line 71 in 43e4e97
The purpose of the temp location is that it allows
checkandapplyto depend on a single, cacheable task. Happy to take a PR to fix this.nedtwigg commentedon Jul 29, 2020
I guess maven users probably have the same problem. The case there is a little simpler, there's no copy, just
writeCanonicalTo. No obligation for a PR to fix all plugins, but I'll leave this open until it has been fixed in both plugins.spotless/plugin-maven/src/main/java/com/diffplug/spotless/maven/SpotlessApplyMojo.java
Line 47 in 43e4e97
tglaeser commentedon Aug 1, 2020
Thanks for the pointers. With
java.nio.file.attributenot providing an files system agnostic file mode approach, I believe the only option then would be remembering the original file attributes by copying the original file to the temp location, updating it, and then copying it back to the final location; a PR for this is in the making.Create a failing test to reproduce #654.
spotlessApply no longer clobbers file permissions (pr #656, fixes #654)
nedtwigg commentedon Aug 5, 2020
Fixed in
plugin-gradle 5.1.1