Change `AbstractIntegrationSpec` to fail when a test runs a build that fails with more than one exception and does not verify the number of exceptions in the failure using `assertHasFailures()`. This is to avoid additional exceptions unintentionally being introduced, for example when a failure starts being thrown because of configuration cache problems alongside the expected failure.
Do not write the source paths for a `CopySpec` multiple times to the instant execution cache. Previously, these were written once when the `CopySpec` was serialized and once when the associated input property spec was serialized.
This commit adds some special case handling for this case. It also preserves the identity of each `FileTree` and `FileCollection` instance for each task to enable short circuiting when the same file collections are referenced via multiple paths, such as in the `CopySpec` case.