Open AlexInCube opened 5 days ago
outputSubDir
can't move it to another part of the tree. It is a subdirectory. That's why there's the random broken C: in the middle of the string "...proto\main\C:\webprojects...". I suggest deleting the outputSubDir
lines
then how do i do the compilation to the folder i want? i have spent hours trying to figure it out but nothing works.
You can use a separate Sync
or Copy
task into the folder of your choosing. https://github.com/google/protobuf-gradle-plugin/issues/722 tracks letting it be configured.
The generateProtoTasks plugin uses the default outputSubDir of build/generated/source/proto/main under which it will create a "java" and "grpc" subdirs for the generated sources for the protos and the service respectively. So in your source sets you need to also change the paths for Java (for IDEs to pick up) from
java {
srcDir "${projectDir}/src/main/generatedProto"
}
to
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
Refer (example).
I want to compile just the files into the root of the project, but I'm having trouble. I tried to make this code, but it gives an error. My proto files are above the Java project in the hierarchy, because the Java project is one of the projects in the monorepository.