Open grossws opened 1 year ago
Looking at #33 and #636 I could guess that users (ab)used this parameter to put generated files under <projectDir>/src/
so I totally understand reluctance to expose it as a property but Provider<Directory>
would still be safe in that case.
What's needed here is a new property completely separate from that old thing. The new thing would clear the directory before generating output. Also, as we see below, maybe this doesn't need configuration to change the output dir.
to mark relevant directories as generated sources in the IDE
This should be addressed by adding the idle or eclipse plugins to your build. That is detected by this plugin to eagerly create the tasks and eagerly create the directories. That's the biggest issue with the IDEs: they expect the source directories to exist before the tasks are run.
to add them to the sources jar
https://github.com/google/protobuf-gradle-plugin/issues/714 may fix that, since we're actually about to use source sets for Kotlin now. You might not to do anything after the next release.
to place them under generated/sources/
That's just a change to the plugin. The plugin is quite old, so may actually predate that convention.
The
com.google.protobuf
plugin (as of version0.9.3
) hasProtobufExtension#getGeneratedFilesBaseDirProperty
method with@PackageScope
. This prevents at least Kotlin DSL users from modifying this directory except via deprecated setter method.I would expect this method to be public and return
DirectoryProperty
(orProvider<Directory>
if you intend to prevent modification). To allow user to address its subdirectories.Also the plugin use
generated/source/proto/<sourceSet>
instead of more conventionalgenerated/sources/proto/<sourceSet>
(wordsources
in plural) alongside annotation processors output.I currently have 3 cases where I want to access this property:
generated/sources/