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

for generateProto, delete the output directory before calling protoc #347

Conversation

devinrsmith
Copy link

Fix for #331 / #332

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@devinrsmith
Copy link
Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@zhangkun83 zhangkun83 requested a review from voidzcy October 21, 2019 22:44
@joschi
Copy link

joschi commented Nov 24, 2020

I've been running into the same problem and worked around it as described in #331 (comment).

Any chance of getting this PR merged?

@voidzcy
Copy link
Collaborator

voidzcy commented Nov 25, 2020

I've been running into the same problem and worked around it as described in #331 (comment).

Any chance of getting this PR merged?

We can't get this merged as long as people are pointing generatedFilesBaseDir to their custom directory for generated files. People used to use it for putting generate files together with other files. We cannot just wipe the directory (see #332).

For general cases, you should at most need a clean build and that will delete unnecessary files after you proto definition changes.

We'd probably change the actual implementation of generatedFilesBaseDir to use a Copy task that copies generated files to the custom directory. Then we are free wipe the task's output directory while keeping existing users of generatedFilesBaseDir safe.

@mattwelke
Copy link

For general cases, you should at most need a clean build and that will delete unnecessary files after you proto definition changes.

So the solution here would be to do a ./gradlew clean build for example? The clean deletes the old generated Java source code, and the build creates new code?

@ejona86
Copy link
Collaborator

ejona86 commented Jan 5, 2023

#636 was merged in favor of this one. This has been a long-time pain, so I appreciate the effort to get it fixed.

@ejona86 ejona86 closed this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants