-
Notifications
You must be signed in to change notification settings - Fork 274
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
How can I disable registering the generated Java code as sources? #739
Comments
I don't understand how "git submodule" is related to "manually include generated code in source set." Could you explain more of what you are trying to do? What would go wrong if you simply didn't add the sync task output to your source set? |
Git submodule is just an example. Suppose I build my application source on a CI tool. In the other way, I can place compiled file. This way doesn't require IDLs. However this way needs the IDL compile automation. Therefore, I want to do not register the compiled files as sources to the IDE. The key point is the IDE occurs the redeclaration error when I use Sync task because same files with compiled file appear at a destination directory of the Sync task too. |
Why? It seems it should only need one or the other, but not both.
Why? If you have the generated code, then you don't need the plugin. If you are putting the pre-generated code into the source set, you don't need the plugin to compile those to .class files. |
The CI should build the source. The source needs the generated code from IDL in order to be built. Thus, It needs IDL unless the source code contains generated code. I think the CI can obtain the IDL from Git or the other storage. It doesn't matter where it is. Anyway, the CI should obtain IDL in order to build the source code. That's why I explained 'both'.
That's right but I don't have the generated code so I want to use your plugin because the plugin helps me to easy configure the compiler, to easy add plugin such as gRPC and execute at all by just one command. (Yes, the plugin is so beautiful) I also just want to change the output directory from That's why I want to disable registering the generated Java code as sources. |
You don't need to add The current status is you can't change the output directory. Some people wanted to check in the generated code. That allows you to not use the plugin in certain builds. The solution to that is to use Sync to copy the files out of build/. In your case, I'd suggest "do nothing" and just accept the generated code being output to build/, since it doesn't seem you need to commit the generated code. |
Seems like this is resolved. If not, comment, and it can be reopened. |
I had considered very much after I read your opinion and then I eventually decide to use protoc and shell script. The script moves the generated code to proper sourceset directory. This approach works well. Thank you. |
Hello.
I want to don't care how servers and clients obtain the IDL. It doesn't matter whether the way is submodule of Git or the other ways.
So I think it is better to involve the generated Java code to my source sets.
As far as I look for, You recommended it to people that using a Sync task of Gradle rather than changing
generatedFilesBaseDir
.However, I met redeclaration error when I sync the generated files because the plugin registered the files as sources.
I want to do not register the generated files as sources. How can I disable the function?
Thanks.
The text was updated successfully, but these errors were encountered: