On Aug 18, 2009, at 8:08 AM, Hans Dockter wrote:
On Aug 18, 2009, at 7:31 AM, Hans Dockter wrote:
I have implemented the history functionality for task execution.
Every task has now a getHistory() method which returns a
TaskHistory object. TaskHistory has two methods, wasSuccessful and
getExecutionTime. The latter is null if the last execution was not
successful. A non existing history file is equivalent to a non-
successful last execution. If a task fails, any existing history
file is deleted. The history files are under <buildDir>/.gradle/
task-execution-history. This means the history is removed by a clean.
Now I'm left with one problem. After the clean task is executed,
the build directory is created again for storing the history
information of the clean task. I'm glad that our integration tests
pointed this out to me :)
I don't see a good solution for this problem yet. Right now the
history is written in the DefaultTaskExecuter. To solve the problem
above we could:
1.) We could start implementing our task input/output model. At the
moment that would be a simple flag indicating whether a task has
output or not. Only for tasks with output a history is written.
2.) Move the history writing to the AbstractTask class into a
method that can be overridden.
Of course we can also save the history files into projectDir/.gradle/
task-execution-history. I guess this is what I will do for now.
Change of plans again. I think the clean task should really remove all
task history. So I get back to the idea of introducing the notion of
task output.
My idea is to let each task return an object of type output. The
output type has three properties: (hasOutput, createdSuccessfully,
lastModified). For a task that has no output the values are (false,
null, null). For a task with output the lastModified timestamp is
updated if didWork is true. If an output task fails the values are
(true, false, null).
- Hans
--
Hans Dockter
Gradle Project Manager
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email