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
With Gradle 4.10 the result of FileTreeElement.getPath() changed in a breaking way.
Expected Behavior
From the method documentation:
Returns the path of this file, relative to the root of the containing file tree. Always uses '/' as the hierarchy separator, regardless of platform file separator. Same as calling getRelativePath().getPathString().
The expected String path should be relative to the FileTree and use / as file seperators even on windows environments.
Current Behavior
With Gradle 4.10 this changed. The resulting String is an absolute system dependent path.
Context
In my plugin I provide a default FileCollection which is constructed with the help of PatternFilterable include(Spec<FileTreeElement> includeSpec); API.
In my Spec<FileTreeElement> implementation I retrieve the file path with `element.getPath() and do some checks based on the asumption that it is relative and normalized.
In gradle <= 4.9 the FileTreeElement was implemented as a DefaultFileVisitDetails which calls getRelativePath().getPathString(); as advertised in the docs.
As of gradle 4.10 some elements are implemented as PathBackedFileTreeElement which implements getPath() as follows:
Ah sorry I already fixed it with the last commit by using ‘getRelativePath().getPathString();’ instead. I could push a branch without the patch if needed.
With Gradle 4.10 the result of
FileTreeElement.getPath()
changed in a breaking way.Expected Behavior
From the method documentation:
The expected String path should be relative to the
FileTree
and use/
as file seperators even on windows environments.Current Behavior
With Gradle
4.10
this changed. The resulting String is an absolute system dependent path.Context
In my plugin I provide a default
FileCollection
which is constructed with the help ofPatternFilterable include(Spec<FileTreeElement> includeSpec);
API.In my
Spec<FileTreeElement>
implementation I retrieve the file path with `element.getPath() and do some checks based on the asumption that it is relative and normalized.In gradle
<= 4.9
theFileTreeElement
was implemented as aDefaultFileVisitDetails
which callsgetRelativePath().getPathString();
as advertised in the docs.As of gradle
4.10
some elements are implemented asPathBackedFileTreeElement
which implementsgetPath()
as follows:gradle/subprojects/core/src/main/java/org/gradle/internal/snapshot/impl/DirectorySnapshotter.java
Lines 304 to 307 in f3079d7
Steps to Reproduce (for bugs)
https://github.com/wooga/atlas-build-unity in branch
gradle/issue_6656
running the test specs from
UnityBuildPlayerTaskIntegrationSpec
will work from gradle version3.5
-4.9
and start to fail on4.10
.Your Environment
I can verify this issue both on macOS and windows systems.
The text was updated successfully, but these errors were encountered: