Skip to content
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

Don't register output directory as a set of files, since this breaks Gradle 5.0+ #940

Merged
merged 1 commit into from
Nov 22, 2018
Merged

Don't register output directory as a set of files, since this breaks Gradle 5.0+ #940

merged 1 commit into from
Nov 22, 2018

Conversation

lared
Copy link
Contributor

@lared lared commented Nov 22, 2018

In order for task caching to work, tasks have to define their inputs and
outputs. These are defined as a set of files, directories, properties
and such.

Until Gradle 4.3 defining inputs was very lax - you could pass
directories in place of files and vice versa. Starting with 4.3
there is a set of validators which check for this and issue
a warning if at configuration time the declared type of file
(directory/normal file) doesn't match the filesystem.

Starting with 5.0, these warnings are now errors - while the task works
just fine on the first build, subsequent ones discover that the output
is a directory, while it's defined in two places as both a file and a
directory - this fails the build at configuration time (even if the task
is not ran).

Removal of this line resolves #809 by removing that ambiguity. Tested on
Gradle 2.3, 4.10.2, 5.0-rc-4.

@joelittlejohn Since that is a weird hooking-up-in-framework kind of a bug, would you recommend any tests to be also written? It seems like this is very unlikely to provide any sort of benefit in the future.

In order for task caching to work, tasks have to define their inputs and
outputs. These are defined as a set of files, directories, properties
and such.

Until Gradle 4.3 defining inputs was very lax - you could pass
directories in place of files and vice versa. Starting with 4.3
there is a set of validators which check for this and issue
a warning if at configuration time the declared type of file
(directory/normal file) doesn't match the filesystem.

Starting with 5.0, these warnings are now errors - while the task works
just fine on the first build, subsequent ones discover that the output
is a directory, while it's defined in two places as both a file and a
directory = this fails the build at configuration time (even if the task
is not ran).

Removal of this line resolves #809 by removing that ambiguity. Tested on
Gradle 2.3, 4.10.2, 5.0-rc-4.
@joelittlejohn
Copy link
Owner

Agreed, writing some kind of test to verify this in different Gradle versions will involve a lot of gymnastics and not much future value, so I'm happy to merge this based on your exploratory testing.

@joelittlejohn joelittlejohn added this to the 1.0.0 milestone Nov 22, 2018
@joelittlejohn joelittlejohn changed the title Issue #809 - don't register output directory as a set of files Don't register output directory as a set of files, since this breaks Gradle 5.0+ Nov 22, 2018
@joelittlejohn joelittlejohn merged commit 2a4b29e into joelittlejohn:master Nov 22, 2018
@lared
Copy link
Contributor Author

lared commented Nov 22, 2018

Thanks! Do you plan on releasing any subsequent beta versions in the near future? I guess I'm not the only one who intends to upgrade to Gradle 5.0 soon after it gets released, and this issue is going to affect everyone with any sort of a multi-step build pipeline.

@lared lared deleted the issue-809-invalidGradleTaskOutputs branch November 22, 2018 18:24
@joelittlejohn
Copy link
Owner

My plan was to release 1.0.0 (GA) next.

@lared
Copy link
Contributor Author

lared commented Nov 25, 2018

@joelittlejohn thanks. Do you have any plans as to when the release is going to take place? Even a guesstimate?

@joelittlejohn
Copy link
Owner

@lared Lets do it very soon :)

@lared
Copy link
Contributor Author

lared commented Dec 13, 2018

@joelittlejohn: do you happen to have updates on "very soon" :D? Sorry for being a pain in the ass.

@joelittlejohn
Copy link
Owner

@lared It's done. Thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registering invalid inputs and outputs via TaskInputs and TaskOutputs
2 participants