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

Add FileSpec output path #1719

Closed
scottjasso opened this issue Nov 8, 2023 · 3 comments · Fixed by #1514 or #1720
Closed

Add FileSpec output path #1719

scottjasso opened this issue Nov 8, 2023 · 3 comments · Fixed by #1514 or #1720

Comments

@scottjasso
Copy link

scottjasso commented Nov 8, 2023

Is your feature request related to a problem? Please describe.
I'm writing a gradle plugin to generate code from some source files, using gradle's InputChanges API.

  • When a source file is added, I create the FileSpec for that file and call writeTo(outputDirectory).
  • When a source file is removed, I want to delete the corresponding generated file. However, I have to calculate the generated file's relative path myself, because writeTo hides the details of that.

Describe the solution you'd like
An API like FileSpec.relativePath that gives the same relative path that writeTo(File) adds to the base directory.
Then I can call something like outputDirectory.resolve(fileSpec.relativePath).delete()

Describe alternatives you've considered
I can write my own FileSpec extension.

Additional context
The details aren't too complex to copy myself, I'm just worried that it could potentially get out of sync.

@scottjasso
Copy link
Author

@JakeWharton I don't think that works. That gives the path after writing. I want to know the path without calling writeTo().

@JakeWharton JakeWharton reopened this Nov 9, 2023
@JakeWharton
Copy link
Member

Yes I misread the issue. Seems reasonable.

@scottjasso
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants