Add scripts to create a self-contained dir of logged D8 calls.

For AOSP/D8 performance testing we need a self-contained directory that contains
the 'compatdx' invocations and their source files from an AOSP build.

The 'compatdx' calls will then be re-run with the actual version of compatdx/d8
for performance measurements without the need of a full AOSP build.

This CL adds

- A Java executable 'd8Logger' which is a drop-in replacement for 'compatdx' with
  an extra logging feature.
- The script 'test_android_cts.sh' has been replaced by its python version. Also
  new options to  for creating the log of 'compatdx' calls during the AOSP build
  and easily switch between jack/dx/d8 tools.
- A script 'create_d8_replay.sh' which creates a self-contained directory
  from the logged calls.

Change-Id: I11614a68f4b7f1b5f3d2fb37bb814d8f25f85cff
diff --git a/build.gradle b/build.gradle
index 3c6a20a..59192bd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -239,6 +239,20 @@
     }
 }
 
+task D8Logger(type: Jar) {
+    from sourceSets.main.output
+    baseName 'd8logger'
+    manifest {
+      attributes 'Main-Class': 'com.android.tools.r8.D8Logger'
+    }
+    // In order to build without dependencies, pass the exclude_deps property using:
+    // gradle -Pexclude_deps D8Logger
+    if (!project.hasProperty('exclude_deps')) {
+        // Also include dependencies
+        from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
+    }
+}
+
 task disasm(type: Jar) {
     from sourceSets.main.output
     baseName 'disasm'