Incremental resource merger support.

First a ChangeManager (and associated classes) that detects changed
files across build runs. This is to be replaced by Gradle once this
information is given to the tasks.

Then, a rewrite of ResourceMerger and ResourceSet to allow saving a
post run state, and reloading it on the next run, to allow for
incremental updates of the merged resource folder by only updating
the resources that changed, were removed or were added.

Finally a change to the BaseTask to support incremental tasks and
provide some default support that actual tasks can use or not.
The BaseTask will do some first checks to figure out if incremental
runs are supported by the class or by the current state, and
call one of two methods to do either full run or incremental run.

The MergerResourceTask is changed to use this, and its incremental
method does a bit more checking and reverts to full run when it
cannot do an incremental run.

Finally a bunch of tests to ensure this works fine.

Change-Id: I3808e2d57aa45882eaf1030e16b092ecd58d9729
diff --git a/build.gradle b/build.gradle
index b27411f..5a6b743 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-allprojects {
+subprojects {
     apply plugin: 'idea'
 
     repositories {
@@ -12,6 +12,23 @@
     group = 'com.android.tools.build'
 }
 
-task wrapper(type: Wrapper) {
-    gradleVersion = '1.3'
+// delay evaluation of this project before all subprojects have been evaluated.
+subprojects.each { subproject -> evaluationDependsOn(subproject.name) }
+
+def testTasks = subprojects.collect { it.tasks.withType(Test) }.flatten()
+
+task aggregateResults(type: Copy) {
+    from { testTasks*.testResultsDir }
+    into { file("build/results") }
 }
+aggregateResults.dependsOn testTasks
+
+task makeAggregateReport(dependsOn: aggregateResults) {
+    def report = new org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport(testReportDir: file("build/reports/tests"), testResultsDir: file("build/results"))
+    report.generateReport()
+}
+
+task check {
+    //nothing
+}
+check.dependsOn makeAggregateReport