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

bug: Delete old generated code #1273

Open
JavierSegoviaCordoba opened this issue Oct 16, 2022 · 5 comments
Open

bug: Delete old generated code #1273

JavierSegoviaCordoba opened this issue Oct 16, 2022 · 5 comments
Labels
bug Something isn't working stale

Comments

@JavierSegoviaCordoba
Copy link

Expected behavior

When a type is removed from the GraphQL schema, generateJava task should delete the previous generated classes.

Actual behavior

The old classes are kept so it is necessary to delete them manually.

Steps to reproduce

  • Create a type in the schema and run generateJava
  • Remove that type from the schema, run generateJava and check how the old type is still there in the generated directory.
@JavierSegoviaCordoba JavierSegoviaCordoba added the bug Something isn't working label Oct 16, 2022
@berngp
Copy link
Contributor

berngp commented Oct 17, 2022

Did you tried calling 'clean' before 'generateJava'?

@JavierSegoviaCordoba
Copy link
Author

That is not a recommended practice even if it works.

@srinivasankavitha
Copy link
Contributor

We will look into a fix in the next week or two. In the meantime, if this is a more immediate problem for you, feel free to open a PR as we welcome contributions.

@JavierSegoviaCordoba
Copy link
Author

I would have to check, but I think that deleting all files from the output directory before the codegen should be enough, as input are the same the task would still be cacheable and wouldn't run if they haven't changed 🤔

@JavierSegoviaCordoba
Copy link
Author

JavierSegoviaCordoba commented Oct 17, 2022

Well, the approach I mentioned before is for the Gradle generateJavaTask. But probably it should be fixed in more places, not only there, if it has to be fixed only in Gradle, I can create a PR for it.

@github-actions github-actions bot added the stale label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants