How the Protobuf Gradle plugin works
masterThe plugin automates two primary tasks:
- Code Generation: It assembles the Protobuf Compiler (
protoc) command line to generate source files (e.g., Java) from your.protofiles. - Source Integration: It automatically adds the generated Java source files to the corresponding compilation unit (the
sourceSetin Java projects or thevariantin Android projects).
Note: If you are generating non-Java/Kotlin source files, they are not automatically included in the compilation process. You must manually add them to your language-specific source sets.