On 6/07/10 10:34 PM, Chris Beams wrote:
I'm seeing the following:
org.gradle.api.UncheckedIOException: Could not add entry ':uploadDoc' to cache
'/Users/cbeams/Work/myproject/.gradle/0.9-preview-3/taskArtifacts/cache.bin'.
further down the stack trace, the root cause reads:
Caused by: java.io.NotSerializableException: Login_Decorated
Where 'Login' is the name of a task I've defined in buildSrc that extends
DefaultTask
If I update the definition of the Login task such that it 'implements
java.io.Serializable', I then get the same stack trace, but instead of
complaining about 'Login_Decorated', it is now a gradle-internal class causing
issues
Caused by: java.io.NotSerializableException:
org.gradle.api.internal.ConventionAwareHelper
The task in question (:uploadDoc) actually completes successfully, but the
build overall fails due to the exception being thrown when trying to write to
the cache.
Ring any bells? I don't see anything about task serializability in the docs,
etc.
Tasks aren't serializable, nor do they need to be. However, what does
need to be serializable is the value of any task property which is
marked as @Input. This is so that Gradle can persist the value to check
whether it has changed the next time Gradle executes the task.
In your case, it looks like the 'uploadDoc' task has an input property
whose value is a Login task (or references a Login task somewhere).
Perhaps this property should be a regular property, rather than an input
property?
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email