New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow converting singleton file tree to directory trees #8387
Conversation
Fixes #8394. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good as a fix for the particular problem. What I don't see is how we could prove there are no other holes like this. Can we do something to that end?
A bit of simplification among FileTree
implementations (similar maybe to what @adammurdoch did in #8403) could be nice, too.
@@ -45,4 +50,31 @@ class DefaultSingletonFileTreeTest extends Specification { | |||
} | |||
0 * visitor._ | |||
} | |||
|
|||
def "can be converted to a directory tree"() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention the @Issue
that triggered this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Added.
@@ -45,4 +50,31 @@ class DefaultSingletonFileTreeTest extends Specification { | |||
} | |||
0 * visitor._ | |||
} | |||
|
|||
def "can be converted to a directory tree"() { | |||
File f = temporaryFolder.file('test-file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: let's not use single-letter variable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
@lptr I added an extra test for the remaining method on We may add a separate test which would take a file tree and then exercises all methods. Then we would create a subclass for every file tree implementation to test it. I opened https://github.com/gradle/build-cache/issues/1476 for consolidating the file tree implementations. |
LGTM. Let's consolidate the creation of |
No description provided.