Skip to content
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

java.nio.file.Path is not usable with Gradle #1122

Closed
octylFractal opened this issue Jan 8, 2017 · 4 comments
Closed

java.nio.file.Path is not usable with Gradle #1122

octylFractal opened this issue Jan 8, 2017 · 4 comments
Labels
a:feature A new functionality in:core DO NOT USE

Comments

@octylFractal
Copy link
Member

Path is not usable and can cause hard-to-debug problems when passed to Gradle.

Expected Behavior

Passing Path to project.file or project.files should result in the same behavior as passing path.toFile().

Current Behavior

  • project.file: Raises an exception
  • project.files: Does nothing on initial call, hangs Gradle when getFiles() is called

Context

I prefer to use Path to File, but I need to remember to double-check all the variables I pass to Gradle to ensure no Path instances are being used. Otherwise, Gradle will hang as noted in the second bullet point above.

Steps to Reproduce (for bugs)

https://github.com/kenzierocks/gradle-path-infinity-resolve

This project contains a single file, build.gradle with a singleFile task and a multiFile task. The singleFile task passes Paths.get('.') to project.file. The multiFile task passes Paths.get('.') to project.files. If everything is working properly, both tasks should print a path equivalent to ..

Your Environment

gradle -Dscan: https://scans.gradle.com/s/r4ylr7jlg6klq

@octylFractal octylFractal changed the title java.nio.files.Path is not usable with Gradle java.nio.file.Path is not usable with Gradle Jan 8, 2017
@lacasseio
Copy link
Contributor

Thanks @kenzierocks for the detailed issue. Could you provide us with a build scan for each behavior: project.file and project.files. That would help us. I see the Path object doesn't seem to be supported as a valid path and it make sense to support those.

@lacasseio lacasseio added a:feature A new functionality from:contributor in:core DO NOT USE labels Jan 9, 2017
@octylFractal
Copy link
Member Author

project.file: https://scans.gradle.com/s/osz7prvosbfyw
project.files: Impossible to do, as the build does not appear to stop. Manually killing it does not produce a scan.

@octylFractal
Copy link
Member Author

It looks like this might have been solved by #813. I'll test it soon.

@octylFractal
Copy link
Member Author

This has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:core DO NOT USE
Projects
None yet
Development

No branches or pull requests

3 participants