test.py: add aosp_jar test

Bug:
Change-Id: Iae1ffc97fb4a361dae78c768fdbbc7dd647290b2
diff --git a/build.gradle b/build.gradle
index 4d25a44..9a48a4d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -912,13 +912,21 @@
     }
 }
 
+task AospJarTest(type: Exec) {
+    dependsOn CompatDx, downloadDeps
+    def script = "tools/test_aosp_jar.py"
+    inputs.file script
+    commandLine "python", script, "--no-build"
+    workingDir = projectDir
+}
+
 test {
     dependsOn supportLibList
     testLogging.exceptionFormat = 'full'
     if (project.hasProperty('print_test_stdout')) {
         testLogging.showStandardStreams = true
     }
-    if (project.hasProperty('dex_vm')) {
+    if (project.hasProperty('dex_vm') && project.property('dex_vm') != 'default') {
         println "Running with non default vm: " + project.property('dex_vm')
         systemProperty 'dex_vm', project.property('dex_vm')
         if (project.property('dex_vm') == '5.1.1' || project.property('dex_vm') == '6.0.1') {
@@ -928,6 +936,7 @@
             exclude "com/android/tools/r8/art/jack/**"
         }
     }
+
     if (project.hasProperty('one_line_per_test')) {
         beforeTest { desc ->
             println "Start executing test ${desc.name} [${desc.className}]"
@@ -970,6 +979,9 @@
     if (project.hasProperty('test_dir')) {
         systemProperty 'test_dir', project.property('test_dir')
     }
+    if (project.hasProperty('aosp_jar')) {
+        dependsOn AospJarTest
+    }
 
     if (OperatingSystem.current().isLinux()
             || OperatingSystem.current().isMacOsX()