-
Notifications
You must be signed in to change notification settings - Fork 16
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
gitPublishCopy doesn't get implicit dependencies from gitPublish.contents anymore #41
Comments
@wolfs, would you mind providing some feedback here? Since CopySpec doesn't implement/extend anything that Task#dependsOn accepts, I'm not sure how to (or if I can) get implicit dependencies to work again after the switch away from the Copy task. |
The easiest way is to add the contents of the copy spec as an input. This can be done for example by:
Sadly, |
OK, I'll have to think about whether there's another way to handle input/outputs or just documenting that they'll need to be added explicitly. Thanks for sending that over. |
I thought some more about the problems with not declaring outputs of the tasks vs. declaring outputs of the tasks and I think there would be less surprises for the users if all tasks for this set of plugins would declare the outputs. |
Thanks for thinking more about this. Yeah, I agree on the inputs/outputs posing fewer surprises. Some of the finer points on the inputs/outputs aren't clear to me, somewhat related to your comments on #39:
I should be able to identify upToDateWhen checks for each of the tasks. I'm less sure what to do for inputs. This would probably include writing "real" tasks (which is probably beneficial anyway), which might do the trick. Also, does it make sense for all of these tasks to use the repo directory as an output? Or should it just be the reset (which sets it up in the first place) and the copy? What does the outputs declaration do when many tasks change small pieces of the same directory? |
@ajoberstar Sorry for taking so long to come back to you. |
Implement real task classes instead of ad-hoc ones. This allows proper declaration of inputs/outputs. Generally, the intent is to ensure Gradle knows the repo directory is managed by these tasks. This allows us to restore support for implicit task dependencies when someone uses the contents copy spec: task createOutput { // output some stuff } gitPublish { contents { from createOutput } } This drops support for Gradle < 4.3 due to requirement of Provider APIs for lazy configuration. This fixes #41.
In 0.3.2, a fix to #35 was added that stops using a Copy task for
gitPublishCopy
. This avoids some issues with an inconsistent use of declared inputs/outputs. However, now that we're using aproject.copy
call with thegitPublish.contents
CopySpec, we don't get the implicit dependencies we used to.This means something like this:
Results in:
Instead of:
The text was updated successfully, but these errors were encountered: