-
Notifications
You must be signed in to change notification settings - Fork 275
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
buildDir is not lazily evaluated for determining the generated files base directory #674
Comments
Hello, could you please provide an example project? Or full reproducible gradle configuration file? |
Unfortunately, for IDE support, I don't think we can delay initialization of the build directory. There's some ways to fix it today, but they'd go away shortly as we rework the IDE support to not require adding old plugins like I don't think this was regressed when I emulated generatedFilesBaseDir. The extension has been eagerly grabbing the buildDir for a while now, I think. |
In our setup the build output directories are outside of the source tree. That's why we change the When switching to version 0.9.2, the build output directories inside the source tree would suddenly show up containing the protobuf generated sources (conflicting with another build system we use). The emulated generatedFilesBaseDir thus doesn't have the effect anymore we relied on so far. This is not a show-stopper, as in the meantime you included eclipse support allowing us to remove the generatedFilesBaseDir setting and our customized eclipse plugin setttings. So far that seems to work good. It just took quite some time to figure out how to get the rid of the build directories in the source tree. |
Ah, yeah, that sounds "fun." We are creating the directories for IDEs today in But that would retain a reference to |
This causes the plugin to use the correct configuration when users use a non-default buildDir. Fixes google#674
This causes the plugin to use the correct configuration when users use a non-default buildDir. Note that for IDEs we create directories in afterEvaluate{}. It is possible for the user's own afterEvaluate{} to change buildDir. In that case, the task will output to the 'correct' directory but the mkdirs for IDEs can be the 'old' buildDir. But users shouldn't be using afterEvaluate{}, so we don't care and there's no real fix anyway. Fixes google#674
With my other fix, things are probably working if you are careful. But I think it depends on when tasks are configured. We should swap some other buildDir usages over to using the provider as well. |
Is this issue still open, if yes i would like to contribute, please assign this to me. |
If I change the
buildDir
in a gradle project to a non-default location, the plugin (in version 0.9.2) does not consider the changedbuildDir
for the output directory of the generated source code if it has already been initialized. Workaround is to initialize the plugin after changing the buildDir using apply:The plugin should be able to lazily detect changes to the buildDir so that I can declare it in the plugins block the usual way.
The text was updated successfully, but these errors were encountered: