Remove old YouTube versions

Change-Id: I31145c327f1e9893166fc8e7f5c25ee8241395a8
diff --git a/build.gradle b/build.gradle
index 4feb96d..24233a5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -434,14 +434,6 @@
         "proto",
         "protobuf-lite",
         "retrace_internal",
-        "youtube/youtube.android_12.10",
-        "youtube/youtube.android_12.17",
-        "youtube/youtube.android_12.22",
-        "youtube/youtube.android_13.37",
-        "youtube/youtube.android_14.19",
-        "youtube/youtube.android_14.44",
-        "youtube/youtube.android_15.08",
-        "youtube/youtube.android_15.09",
         "youtube/youtube.android_15.33",
         "youtube/youtube.android_16.12"
     ],
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeDeployJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeDeployJarVerificationTest.java
deleted file mode 100644
index f6b78f6..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeDeployJarVerificationTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import com.android.tools.r8.CompilationMode;
-import com.android.tools.r8.R8RunArtTestsTest.CompilerUnderTest;
-import org.junit.Test;
-
-public class YouTubeDeployJarVerificationTest extends YouTubeCompilationTestBase {
-
-  public YouTubeDeployJarVerificationTest() {
-    super(12, 17);
-  }
-
-  @Test
-  public void buildDebugFromDeployJar() throws Exception {
-    runAndCheckVerification(
-        CompilerUnderTest.R8, CompilationMode.DEBUG, base + APK, null, base + DEPLOY_JAR);
-  }
-
-  @Test
-  public void buildReleaseFromDeployJar() throws Exception {
-    runAndCheckVerification(
-        CompilerUnderTest.R8, CompilationMode.RELEASE, base + APK, null, base + DEPLOY_JAR);
-  }
-}
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeDexVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeDexVerificationTest.java
deleted file mode 100644
index 32b7973..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeDexVerificationTest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import com.android.tools.r8.CompilationMode;
-import org.junit.Test;
-
-public class YouTubeDexVerificationTest extends YouTubeCompilationTestBase {
-
-  public YouTubeDexVerificationTest() {
-    super(12, 17);
-  }
-
-  @Test
-  public void buildDebugFromDex() throws Exception {
-    runR8AndCheckVerification(CompilationMode.DEBUG, APK);
-  }
-
-  @Test
-  public void buildReleaseFromDex() throws Exception {
-    runR8AndCheckVerification(CompilationMode.RELEASE, APK);
-  }
-}
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeProguardJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeProguardJarVerificationTest.java
deleted file mode 100644
index ffe4e14..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeProguardJarVerificationTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import com.android.tools.r8.CompilationMode;
-import com.android.tools.r8.R8RunArtTestsTest.CompilerUnderTest;
-import com.google.common.collect.ImmutableList;
-import org.junit.Test;
-
-public class YouTubeProguardJarVerificationTest extends YouTubeCompilationTestBase {
-
-  public YouTubeProguardJarVerificationTest() {
-    super(12, 17);
-  }
-
-  @Test
-  public void buildDebugFromProguardJar() throws Exception {
-    runAndCheckVerification(
-        CompilerUnderTest.R8,
-        CompilationMode.DEBUG,
-        base + APK,
-        null,
-        options -> options.testing.disableStackMapVerification = true,
-        ImmutableList.of(base + PG_JAR));
-  }
-
-  @Test
-  public void buildReleaseFromProguardJar() throws Exception {
-    runAndCheckVerification(
-        CompilerUnderTest.R8,
-        CompilationMode.RELEASE,
-        base + APK,
-        null,
-        options -> options.testing.disableStackMapVerification = true,
-        ImmutableList.of(base + PG_JAR));
-  }
-}
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeV1217TreeShakeJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeV1217TreeShakeJarVerificationTest.java
deleted file mode 100644
index 5f39a31..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeV1217TreeShakeJarVerificationTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import static org.junit.Assert.assertTrue;
-
-import com.android.tools.r8.CompilationMode;
-import com.android.tools.r8.R8RunArtTestsTest.CompilerUnderTest;
-import com.android.tools.r8.StringConsumer.FileConsumer;
-import com.android.tools.r8.utils.AndroidApp;
-import com.google.common.collect.ImmutableList;
-import java.io.File;
-import java.nio.file.Path;
-import org.junit.Test;
-
-public class YouTubeV1217TreeShakeJarVerificationTest extends YouTubeCompilationTestBase {
-
-  public YouTubeV1217TreeShakeJarVerificationTest() {
-    super(12, 17);
-  }
-
-  @Test
-  public void buildAndTreeShakeFromDeployJar() throws Exception {
-    Path proguardMapPath = File.createTempFile("mapping", ".txt", temp.getRoot()).toPath();
-    int maxSize = 20000000;
-    AndroidApp app =
-        runAndCheckVerification(
-            CompilerUnderTest.R8,
-            CompilationMode.RELEASE,
-            base + APK,
-            ImmutableList.of(base + PG_CONF),
-            options -> options.proguardMapConsumer = new FileConsumer(proguardMapPath),
-            // Don't pass any inputs. The input will be read from the -injars in the Proguard
-            // configuration file.
-            ImmutableList.of());
-    int bytes = app.applicationSize();
-    assertTrue("Expected max size of " + maxSize + ", got " + bytes, bytes < maxSize);
-  }
-}
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeV1419TreeShakeJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeV1419TreeShakeJarVerificationTest.java
deleted file mode 100644
index 42fc8f7..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeV1419TreeShakeJarVerificationTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import static com.android.tools.r8.ToolHelper.isLocalDevelopment;
-import static com.android.tools.r8.ToolHelper.shouldRunSlowTests;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-
-import com.android.tools.r8.R8TestCompileResult;
-import com.android.tools.r8.TestParameters;
-import com.android.tools.r8.TestParametersCollection;
-import com.android.tools.r8.ToolHelper;
-import com.android.tools.r8.graph.DexItemFactory;
-import com.android.tools.r8.utils.AndroidApiLevel;
-import com.android.tools.r8.utils.codeinspector.CodeInspector;
-import com.android.tools.r8.utils.codeinspector.analysis.ProtoApplicationStats;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-@RunWith(Parameterized.class)
-public class YouTubeV1419TreeShakeJarVerificationTest extends YouTubeCompilationTestBase {
-
-  private static final int MAX_SIZE = 27500000;
-
-  @Parameters(name = "{0}")
-  public static TestParametersCollection data() {
-    return getTestParameters().withNoneRuntime().build();
-  }
-
-  public YouTubeV1419TreeShakeJarVerificationTest(TestParameters parameters) {
-    super(14, 19);
-    parameters.assertNoneRuntime();
-  }
-
-  @Test
-  public void testR8() throws Exception {
-    // TODO(b/141603168): Enable this on the bots.
-    assumeTrue(isLocalDevelopment());
-    assumeTrue(shouldRunSlowTests());
-
-    LibrarySanitizer librarySanitizer =
-        new LibrarySanitizer(temp).addProguardConfigurationFiles(getKeepRuleFiles()).sanitize();
-
-    R8TestCompileResult compileResult =
-        testForR8(Backend.DEX)
-            .addKeepRuleFiles(librarySanitizer.getSanitizedProguardConfiguration())
-            .addLibraryFiles(librarySanitizer.getSanitizedLibrary())
-            .addMainDexRuleFiles(getMainDexRuleFiles())
-            .allowDiagnosticMessages()
-            .allowUnusedProguardConfigurationRules()
-            .setMinApi(AndroidApiLevel.H_MR2)
-            .compile()
-            .assertAllInfoMessagesMatch(
-                containsString("Proguard configuration rule does not match anything"))
-            .assertAllWarningMessagesMatch(containsString("Ignoring option:"));
-
-    if (ToolHelper.isLocalDevelopment()) {
-      DexItemFactory dexItemFactory = new DexItemFactory();
-      ProtoApplicationStats original =
-          new ProtoApplicationStats(dexItemFactory, new CodeInspector(getProgramFiles()));
-      ProtoApplicationStats actual =
-          new ProtoApplicationStats(dexItemFactory, compileResult.inspector(), original);
-      ProtoApplicationStats baseline =
-          new ProtoApplicationStats(
-              dexItemFactory, new CodeInspector(getReleaseApk(), getReleaseProguardMap()));
-      System.out.println(actual.getStats(baseline));
-    }
-
-    int applicationSize = compileResult.app.applicationSize();
-    System.out.println(applicationSize);
-
-    assertTrue(
-        "Expected max size of " + MAX_SIZE + ", got " + applicationSize,
-        applicationSize < MAX_SIZE);
-  }
-}
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeV1444TreeShakeJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeV1444TreeShakeJarVerificationTest.java
deleted file mode 100644
index a998521..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeV1444TreeShakeJarVerificationTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import static com.android.tools.r8.ToolHelper.isLocalDevelopment;
-import static com.android.tools.r8.ToolHelper.shouldRunSlowTests;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-
-import com.android.tools.r8.R8TestCompileResult;
-import com.android.tools.r8.TestParameters;
-import com.android.tools.r8.TestParametersCollection;
-import com.android.tools.r8.ToolHelper;
-import com.android.tools.r8.graph.DexItemFactory;
-import com.android.tools.r8.utils.AndroidApiLevel;
-import com.android.tools.r8.utils.codeinspector.CodeInspector;
-import com.android.tools.r8.utils.codeinspector.analysis.ProtoApplicationStats;
-import java.nio.file.Paths;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-@RunWith(Parameterized.class)
-public class YouTubeV1444TreeShakeJarVerificationTest extends YouTubeCompilationTestBase {
-
-  private static final boolean DUMP = false;
-  private static final int MAX_SIZE = 27500000;
-
-  @Parameters(name = "{0}")
-  public static TestParametersCollection data() {
-    return getTestParameters().withNoneRuntime().build();
-  }
-
-  public YouTubeV1444TreeShakeJarVerificationTest(TestParameters parameters) {
-    super(14, 44);
-    parameters.assertNoneRuntime();
-  }
-
-  @Test
-  public void testR8() throws Exception {
-    // TODO(b/141603168): Enable this on the bots.
-    assumeTrue(isLocalDevelopment());
-    assumeTrue(shouldRunSlowTests());
-
-    LibrarySanitizer librarySanitizer =
-        new LibrarySanitizer(temp)
-            .addProgramFiles(getProgramFiles())
-            .addLibraryFiles(getLibraryFiles())
-            .sanitize()
-            .assertSanitizedProguardConfigurationIsEmpty();
-
-    R8TestCompileResult compileResult =
-        testForR8(Backend.DEX)
-            .addProgramFiles(getProgramFiles())
-            .addLibraryFiles(librarySanitizer.getSanitizedLibrary())
-            .addKeepRuleFiles(getKeepRuleFiles())
-            .addMainDexRuleFiles(getMainDexRuleFiles())
-            .setMinApi(AndroidApiLevel.H_MR2)
-            .allowDiagnosticMessages()
-            .allowUnusedProguardConfigurationRules()
-            .compile();
-
-    if (ToolHelper.isLocalDevelopment()) {
-      if (DUMP) {
-        long time = System.currentTimeMillis();
-        compileResult.writeToZip(Paths.get("YouTubeV1444-" + time + ".zip"));
-        compileResult.writeProguardMap(Paths.get("YouTubeV1444-" + time + ".map"));
-      }
-
-      DexItemFactory dexItemFactory = new DexItemFactory();
-      ProtoApplicationStats original =
-          new ProtoApplicationStats(dexItemFactory, new CodeInspector(getProgramFiles()));
-      ProtoApplicationStats actual =
-          new ProtoApplicationStats(dexItemFactory, compileResult.inspector(), original);
-      ProtoApplicationStats baseline =
-          new ProtoApplicationStats(
-              dexItemFactory, new CodeInspector(getReleaseApk(), getReleaseProguardMap()));
-      System.out.println(actual.getStats(baseline));
-    }
-
-    int applicationSize = compileResult.app.applicationSize();
-    System.out.println(applicationSize);
-
-    assertTrue(
-        "Expected max size of " + MAX_SIZE + ", got " + applicationSize,
-        applicationSize < MAX_SIZE);
-  }
-}
diff --git a/src/test/java/com/android/tools/r8/internal/YouTubeV1508TreeShakeJarVerificationTest.java b/src/test/java/com/android/tools/r8/internal/YouTubeV1508TreeShakeJarVerificationTest.java
deleted file mode 100644
index eccb336d..0000000
--- a/src/test/java/com/android/tools/r8/internal/YouTubeV1508TreeShakeJarVerificationTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2020, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-package com.android.tools.r8.internal;
-
-import static com.android.tools.r8.ToolHelper.isLocalDevelopment;
-import static com.android.tools.r8.ToolHelper.shouldRunSlowTests;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-
-import com.android.tools.r8.R8TestCompileResult;
-import com.android.tools.r8.TestParameters;
-import com.android.tools.r8.TestParametersCollection;
-import com.android.tools.r8.ToolHelper;
-import com.android.tools.r8.graph.DexItemFactory;
-import com.android.tools.r8.utils.AndroidApiLevel;
-import com.android.tools.r8.utils.codeinspector.CodeInspector;
-import com.android.tools.r8.utils.codeinspector.analysis.ProtoApplicationStats;
-import java.nio.file.Paths;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-@RunWith(Parameterized.class)
-public class YouTubeV1508TreeShakeJarVerificationTest extends YouTubeCompilationTestBase {
-
-  private static final boolean DUMP = false;
-  private static final int MAX_SIZE = 27500000;
-
-  @Parameters(name = "{0}")
-  public static TestParametersCollection data() {
-    return getTestParameters().withNoneRuntime().build();
-  }
-
-  public YouTubeV1508TreeShakeJarVerificationTest(TestParameters parameters) {
-    super(15, 8);
-    parameters.assertNoneRuntime();
-  }
-
-  @Test
-  public void testR8() throws Exception {
-    // TODO(b/141603168): Enable this on the bots.
-    assumeTrue(isLocalDevelopment());
-    assumeTrue(shouldRunSlowTests());
-
-    LibrarySanitizer librarySanitizer =
-        new LibrarySanitizer(temp)
-            .addProgramFiles(getProgramFiles())
-            .addLibraryFiles(getLibraryFiles())
-            .sanitize()
-            .assertSanitizedProguardConfigurationIsEmpty();
-
-    R8TestCompileResult compileResult =
-        testForR8(Backend.DEX)
-            .addProgramFiles(getProgramFiles())
-            .addLibraryFiles(librarySanitizer.getSanitizedLibrary())
-            .addKeepRuleFiles(getKeepRuleFiles())
-            .addMainDexRuleFiles(getMainDexRuleFiles())
-            .allowDiagnosticMessages()
-            .allowUnusedProguardConfigurationRules()
-            .setMinApi(AndroidApiLevel.H_MR2)
-            .compile();
-
-    if (ToolHelper.isLocalDevelopment()) {
-      if (DUMP) {
-        long time = System.currentTimeMillis();
-        compileResult.writeToZip(Paths.get("YouTubeV1508-" + time + ".zip"));
-        compileResult.writeProguardMap(Paths.get("YouTubeV1508-" + time + ".map"));
-      }
-
-      DexItemFactory dexItemFactory = new DexItemFactory();
-      ProtoApplicationStats original =
-          new ProtoApplicationStats(dexItemFactory, new CodeInspector(getProgramFiles()));
-      ProtoApplicationStats actual =
-          new ProtoApplicationStats(dexItemFactory, compileResult.inspector(), original);
-      ProtoApplicationStats baseline =
-          new ProtoApplicationStats(
-              dexItemFactory, new CodeInspector(getReleaseApk(), getReleaseProguardMap()));
-      System.out.println(actual.getStats(baseline));
-    }
-
-    int applicationSize = compileResult.app.applicationSize();
-    System.out.println(applicationSize);
-
-    assertTrue(
-        "Expected max size of " + MAX_SIZE + ", got " + applicationSize,
-        applicationSize < MAX_SIZE);
-  }
-}
diff --git a/third_party/youtube/youtube.android_12.10.tar.gz.sha1 b/third_party/youtube/youtube.android_12.10.tar.gz.sha1
deleted file mode 100644
index b158784..0000000
--- a/third_party/youtube/youtube.android_12.10.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-63e48370be53db00638fae52ffc9d4161df6c6ff
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_12.17.tar.gz.sha1 b/third_party/youtube/youtube.android_12.17.tar.gz.sha1
deleted file mode 100644
index d64239b..0000000
--- a/third_party/youtube/youtube.android_12.17.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-258a23ca677435c44d014a51c6d9737ebc8f2dcf
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_12.22.tar.gz.sha1 b/third_party/youtube/youtube.android_12.22.tar.gz.sha1
deleted file mode 100644
index 8f6813c..0000000
--- a/third_party/youtube/youtube.android_12.22.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-73c4880898d734064815d0426d8fe84ee6d075b4
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_13.37.tar.gz.sha1 b/third_party/youtube/youtube.android_13.37.tar.gz.sha1
deleted file mode 100644
index ffc92a8..0000000
--- a/third_party/youtube/youtube.android_13.37.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-533819c8e988bfbcdd7bc3dbd17e0d374c4ba9ab
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_14.19.tar.gz.sha1 b/third_party/youtube/youtube.android_14.19.tar.gz.sha1
deleted file mode 100644
index eee098b..0000000
--- a/third_party/youtube/youtube.android_14.19.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-32d92330cfa672f687f80969bb6eeb5af5b9bd01
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_14.44.tar.gz.sha1 b/third_party/youtube/youtube.android_14.44.tar.gz.sha1
deleted file mode 100644
index bdf9586..0000000
--- a/third_party/youtube/youtube.android_14.44.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-368f0029be6a0a2629ba8f05ea6954a3a859115e
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_15.08.tar.gz.sha1 b/third_party/youtube/youtube.android_15.08.tar.gz.sha1
deleted file mode 100644
index 357adeb..0000000
--- a/third_party/youtube/youtube.android_15.08.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-dc8d9b8f89d9284336897fa4cb2a925ff9e07c67
\ No newline at end of file
diff --git a/third_party/youtube/youtube.android_15.09.tar.gz.sha1 b/third_party/youtube/youtube.android_15.09.tar.gz.sha1
deleted file mode 100644
index b5c44a1..0000000
--- a/third_party/youtube/youtube.android_15.09.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-6acec0dc032536d90798060badaed13154c92685
\ No newline at end of file
diff --git a/tools/internal_test.py b/tools/internal_test.py
index e267763..ee7a8323 100755
--- a/tools/internal_test.py
+++ b/tools/internal_test.py
@@ -38,6 +38,8 @@
 import utils
 import run_on_app
 
+import youtube_data
+
 # How often the bot/tester should check state
 PULL_DELAY = 30
 TEST_RESULT_DIR = 'internal'
@@ -74,7 +76,7 @@
     },
     {
         'app': 'youtube',
-        'version': '12.22',
+        'version': youtube_data.LATEST_VERSION,
         'find-xmx-min': 750,
         'find-xmx-max': 1150,
         'find-xmx-range': 32,
diff --git a/tools/run_on_app.py b/tools/run_on_app.py
index 60cd4f1..c775aa0 100755
--- a/tools/run_on_app.py
+++ b/tools/run_on_app.py
@@ -396,7 +396,7 @@
     version = options.version or '20180926'
     data = nest_data
   elif options.app == 'youtube':
-    version = options.version or '12.22'
+    version = options.version or youtube_data.LATEST_VERSION
     data = youtube_data
   elif options.app == 'chrome':
     version = options.version or '180917'
diff --git a/tools/run_proguard_dx_on_app.py b/tools/run_proguard_dx_on_app.py
deleted file mode 100755
index bb1d72a..0000000
--- a/tools/run_proguard_dx_on_app.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-# Run ProGuard and the DX (= D8) tool on GmsCore V10.
-
-from __future__ import print_function
-from glob import glob
-from os import makedirs
-from os.path import exists, join, splitext
-from subprocess import check_call
-import argparse
-import fnmatch
-import gmscore_data
-import jdk
-import os
-import stat
-import sys
-import time
-
-import gmail_data
-import gmscore_data
-import golem
-import proguard
-import utils
-import youtube_data
-
-APPS = ['gmscore', 'youtube']
-DX_JAR = join(utils.REPO_ROOT, 'tools', 'linux', 'dx', 'framework', 'dx.jar')
-
-def parse_arguments(argv):
-  parser = argparse.ArgumentParser(
-      description = 'Run ProGuard and the DX tool on GmsCore V10.')
-  parser.add_argument('--app', required = True, choices = APPS)
-  parser.add_argument('--out',
-      help = 'Output directory for the DX tool.',
-      default = os.getcwd())
-  parser.add_argument('--golem',
-      help = 'Link in third party dependencies.',
-      default = False,
-      action = 'store_true')
-  parser.add_argument('--print-runtimeraw',
-      metavar = 'BENCHMARKNAME',
-      help = 'Print the line \'<BENCHMARKNAME>(RunTimeRaw): <elapsed>' +
-             ' ms\' at the end where <elapsed> is the elapsed time in' +
-             ' milliseconds.')
-  parser.add_argument('--print-memoryuse',
-      metavar='BENCHMARKNAME',
-      help='Print the line \'<BENCHMARKNAME>(MemoryUse):' +
-           ' <mem>\' at the end where <mem> is the peak' +
-           ' peak resident set size (VmHWM) in bytes.')
-  parser.add_argument('--print-dexsegments',
-      metavar = 'BENCHMARKNAME',
-      help = 'Print the sizes of individual dex segments as ' +
-          '\'<BENCHMARKNAME>-<segment>(CodeSize): <bytes>\'')
-  return parser.parse_args(argv)
-
-def Main(argv):
-  options = parse_arguments(argv)
-  if options.golem:
-    golem.link_third_party()
-  utils.check_java_version()
-  outdir = options.out
-
-  if options.app == 'gmscore':
-    version = 'v10'
-    data = gmscore_data
-    base = data.V10_BASE
-  elif options.app == 'youtube':
-    version = '12.22'
-    data = youtube_data
-    base = data.V12_22_BASE
-  else:
-    raise Exception('Unexpected')
-
-
-  args = ['-forceprocessing']
-
-  if not outdir.endswith('.zip') and not outdir.endswith('.jar') \
-      and not exists(outdir):
-    makedirs(outdir)
-
-
-  values_deploy = data.VERSIONS[version]['deploy']
-  values_proguarded = data.VERSIONS[version]['proguarded']
-  assert 'pgconf' in values_deploy
-
-  for pgconf in values_deploy['pgconf']:
-    args.extend(['@' + pgconf])
-
-  # find seeds file
-  inputs = data.VERSIONS[version]['proguarded']['inputs']
-  assert len(inputs) == 1
-  basename_wo_ext = splitext(os.path.basename(inputs[0]))[0]
-  seeds_filename = basename_wo_ext + '.seeds'
-
-  seeds_files = []
-  for root, dirnames, filenames in os.walk(join(base, 'blaze-out')):
-    for filename in fnmatch.filter(filenames, seeds_filename):
-        seeds_files.append(os.path.join(root, filename))
-  assert len(seeds_files) == 1
-
-  seeds_path = seeds_files[0]
-  proguarded_jar_path = splitext(seeds_path)[0] + '.jar'
-
-  # Remove write-protection from seeds file. The seeds file is an output of
-  # ProGuard so it aborts if this is not writeable.
-  st = os.stat(seeds_path)
-  os.chmod(seeds_path,
-      st.st_mode | stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
-
-  t0 = time.time()
-
-  proguard_memoryuse = None
-
-  with utils.TempDir() as temp:
-    track_memory_file = None
-    if options.print_memoryuse:
-      track_memory_file = join(temp, utils.MEMORY_USE_TMP_FILE)
-    proguard.run(
-        args,
-        version='pg_internal',
-        track_memory_file = track_memory_file,
-        stdout=open(os.devnull, 'w'))
-    if options.print_memoryuse:
-      proguard_memoryuse = utils.grep_memoryuse(track_memory_file)
-
-  # run dex on the result
-  jar = DX_JAR
-
-  with utils.TempDir() as temp:
-    track_memory_file = None
-    cmd = []
-    if options.print_memoryuse:
-      track_memory_file = join(temp, utils.MEMORY_USE_TMP_FILE)
-      cmd.extend(['tools/track_memory.sh', track_memory_file])
-    cmd.extend([jdk.GetJavaExecutable(), '-jar', jar, '--multi-dex',
-        '--output=' + outdir])
-    if 'min-api' in values_proguarded:
-      cmd.append('--min-sdk-version=' + values_proguarded['min-api'])
-    cmd.extend(['--dex', proguarded_jar_path])
-    utils.PrintCmd(cmd);
-    check_call(cmd)
-    if options.print_memoryuse:
-      dx_memoryuse = utils.grep_memoryuse(track_memory_file)
-      print('{}(MemoryUse): {}'
-          .format(options.print_memoryuse,
-              max(proguard_memoryuse, dx_memoryuse)))
-
-  if options.print_runtimeraw:
-    print('{}(RunTimeRaw): {} ms'
-        .format(options.print_runtimeraw, 1000.0 * (time.time() - t0)))
-
-  if options.print_dexsegments:
-    dex_files = glob(os.path.join(outdir, '*.dex'))
-    utils.print_dexsegments(options.print_dexsegments, dex_files)
-
-if __name__ == '__main__':
-  sys.exit(Main(sys.argv[1:]))
diff --git a/tools/run_proguard_dx_on_gmscore.py b/tools/run_proguard_dx_on_gmscore.py
deleted file mode 100755
index 5a6e42a..0000000
--- a/tools/run_proguard_dx_on_gmscore.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-# Run ProGuard and the DX or CompatDX (= D8) tool on GmsCore V10.
-
-import sys
-
-import run_proguard_dx_on_app
-
-if __name__ == '__main__':
-  sys.exit(run_proguard_dx_on_app.Main(sys.argv[1:] + ['--app', 'gmscore']))
diff --git a/tools/youtube_data.py b/tools/youtube_data.py
index 04d9e1f..d12cfb6 100644
--- a/tools/youtube_data.py
+++ b/tools/youtube_data.py
@@ -2,7 +2,6 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-import glob
 import os
 import utils
 
@@ -10,256 +9,20 @@
 ANDROID_L_API = '21'
 BASE = os.path.join(utils.THIRD_PARTY, 'youtube')
 
-V12_10_BASE = os.path.join(BASE, 'youtube.android_12.10')
-V12_10_PREFIX = os.path.join(V12_10_BASE, 'YouTubeRelease')
-
-V12_17_BASE = os.path.join(BASE, 'youtube.android_12.17')
-V12_17_PREFIX = os.path.join(V12_17_BASE, 'YouTubeRelease')
-
-V12_22_BASE = os.path.join(BASE, 'youtube.android_12.22')
-V12_22_PREFIX = os.path.join(V12_22_BASE, 'YouTubeRelease')
-
-V13_37_BASE = os.path.join(BASE, 'youtube.android_13.37')
-V13_37_PREFIX = os.path.join(V13_37_BASE, 'YouTubeRelease')
-
-V14_19_BASE = os.path.join(BASE, 'youtube.android_14.19')
-V14_19_PREFIX = os.path.join(V14_19_BASE, 'YouTubeRelease')
-
-V14_44_BASE = os.path.join(BASE, 'youtube.android_14.44')
-V14_44_PREFIX = os.path.join(V14_44_BASE, 'YouTubeRelease')
-
-V15_08_BASE = os.path.join(BASE, 'youtube.android_15.08')
-V15_08_PREFIX = os.path.join(V15_08_BASE, 'YouTubeRelease')
-
-V15_09_BASE = os.path.join(BASE, 'youtube.android_15.09')
-V15_09_PREFIX = os.path.join(V15_09_BASE, 'YouTubeRelease')
-
 V15_33_BASE = os.path.join(BASE, 'youtube.android_15.33')
 V15_33_PREFIX = os.path.join(V15_33_BASE, 'YouTubeRelease')
 
 V16_12_BASE = os.path.join(BASE, 'youtube.android_16.12')
 V16_12_PREFIX = os.path.join(V16_12_BASE, 'YouTubeRelease')
 
-# NOTE: we always use android.jar for SDK v25, later we might want to revise it
-#       to use proper android.jar version for each of youtube version separately.
-ANDROID_JAR = utils.get_android_jar(25)
+LATEST_VERSION = '16.12'
 
 VERSIONS = {
-  '12.10': {
-    'dex' : {
-      'inputs': [os.path.join(V12_10_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V12_10_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      'inputs': ['%s_deploy.jar' % V12_10_PREFIX],
-      'pgconf': ['%s_proguard.config' % V12_10_PREFIX,
-                 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-                 utils.IGNORE_WARNINGS_RULES],
-      'min-api' : ANDROID_L_API,
-    }
-    # The 'proguarded' version cannot be handled by D8/R8 because there are
-    # parameter annotations for parameters that do not exist, which is not
-    # handled gracefully by ASM (see b/116089492).
-    #'proguarded' : {
-    #  'inputs': ['%s_proguard.jar' % V12_10_PREFIX],
-    #  'pgmap': '%s_proguard.map' % V12_10_PREFIX,
-    #  'min-api' : ANDROID_L_API,
-    #}
-  },
-  '12.17': {
-    'dex' : {
-      'inputs': [os.path.join(V12_17_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V12_17_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      'inputs': ['%s_deploy.jar' % V12_17_PREFIX],
-      'pgconf': ['%s_proguard.config' % V12_17_PREFIX,
-                 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-                 utils.IGNORE_WARNINGS_RULES],
-      'min-api' : ANDROID_L_API,
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V12_17_PREFIX],
-      'pgmap': '%s_proguard.map' % V12_17_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
-  '12.22': {
-    'dex' : {
-      'inputs': [os.path.join(V12_22_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V12_22_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      'inputs': ['%s_deploy.jar' % V12_22_PREFIX],
-      'pgconf': [
-          '%s_proguard.config' % V12_22_PREFIX,
-          '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-          utils.IGNORE_WARNINGS_RULES],
-      'maindexrules' : [
-          os.path.join(V12_22_BASE, 'mainDexClasses.rules'),
-          os.path.join(V12_22_BASE, 'main-dex-classes-release.cfg'),
-          os.path.join(V12_22_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V12_22_PREFIX],
-      'pgmap': '%s_proguard.map' % V12_22_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
-  '13.37': {
-    'dex' : {
-      'inputs': [os.path.join(V13_37_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V13_37_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      'inputs': ['%s_deploy.jar' % V13_37_PREFIX],
-      'pgconf': [
-          '%s_proguard.config' % V13_37_PREFIX,
-          '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-          utils.IGNORE_WARNINGS_RULES],
-      # Build for native multi dex, as Currently R8 cannot meet the main-dex
-      # constraints.
-      #'maindexrules' : [
-      #    os.path.join(V13_37_BASE, 'mainDexClasses.rules'),
-      #    os.path.join(V13_37_BASE, 'main-dex-classes-release-optimized.cfg'),
-      #    os.path.join(V13_37_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
-      'min-api' : ANDROID_L_API,
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V13_37_PREFIX],
-      'pgmap': '%s_proguard.map' % V13_37_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
-  '14.19': {
-    'dex' : {
-      'inputs': [os.path.join(V14_19_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V14_19_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      'inputs': ['%s_deploy.jar' % V14_19_PREFIX],
-      'pgconf': [
-          '%s_proguard.config' % V14_19_PREFIX,
-          '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-          utils.IGNORE_WARNINGS_RULES],
-      'maindexrules' : [
-          os.path.join(V14_19_BASE, 'mainDexClasses.rules'),
-          os.path.join(V14_19_BASE, 'main-dex-classes-release-optimized.pgcfg'),
-          os.path.join(V14_19_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
-      'min-api' : ANDROID_H_MR2_API,
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V14_19_PREFIX],
-      'pgmap': '%s_proguard.map' % V14_19_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
-  '14.44': {
-    'dex' : {
-      'inputs': [os.path.join(V14_44_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V14_44_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      # When -injars and -libraryjars are used for specifying inputs library
-      # sanitization is on by default. For this version of YouTube -injars and
-      # -libraryjars are not used, but library sanitization is still required.
-      'sanitize_libraries': True,
-      'inputs': ['%s_deploy.jar' % V14_44_PREFIX],
-      'libraries' : [os.path.join(V14_44_BASE, 'legacy_YouTubeRelease_combined_library_jars.jar')],
-      'pgconf': [
-          '%s_proguard.config' % V14_44_PREFIX,
-          '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-          utils.IGNORE_WARNINGS_RULES],
-      'maindexrules' : [
-          os.path.join(V14_44_BASE, 'mainDexClasses.rules'),
-          os.path.join(V14_44_BASE, 'main-dex-classes-release-optimized.pgcfg'),
-          os.path.join(V14_44_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
-      'min-api' : ANDROID_H_MR2_API,
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V14_44_PREFIX],
-      'pgmap': '%s_proguard.map' % V14_44_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
-  '15.08': {
-    'dex' : {
-      'inputs': [os.path.join(V15_08_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V15_08_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      # When -injars and -libraryjars are used for specifying inputs library
-      # sanitization is on by default. For this version of YouTube -injars and
-      # -libraryjars are not used, but library sanitization is still required.
-      'sanitize_libraries': True,
-      'inputs': ['%s_deploy.jar' % V15_08_PREFIX],
-      'libraries' : [os.path.join(V15_08_BASE, 'legacy_YouTubeRelease_combined_library_jars.jar')],
-      'pgconf': [
-          '%s_proguard.config' % V15_08_PREFIX,
-          '%s_proto_safety.pgcfg' % V15_08_PREFIX,
-          '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-          utils.IGNORE_WARNINGS_RULES],
-      'maindexrules' : [
-          os.path.join(V15_08_BASE, 'mainDexClasses.rules'),
-          os.path.join(V15_08_BASE, 'main-dex-classes-release-optimized.pgcfg'),
-          os.path.join(V15_08_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
-      'min-api' : ANDROID_H_MR2_API,
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V15_08_PREFIX],
-      'pgmap': '%s_proguard.map' % V15_08_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
-  '15.09': {
-    'dex' : {
-      'inputs': [os.path.join(V15_09_BASE, 'YouTubeRelease_unsigned.apk')],
-      'pgmap': '%s_proguard.map' % V15_09_PREFIX,
-      'libraries' : [ANDROID_JAR],
-      'min-api' : ANDROID_L_API,
-    },
-    'deploy' : {
-      # When -injars and -libraryjars are used for specifying inputs library
-      # sanitization is on by default. For this version of YouTube -injars and
-      # -libraryjars are not used, but library sanitization is still required.
-      'sanitize_libraries': True,
-      'inputs': ['%s_deploy.jar' % V15_09_PREFIX],
-      'libraries' : [os.path.join(V15_09_BASE, 'legacy_YouTubeRelease_combined_library_jars.jar')],
-      'pgconf': [
-          '%s_proguard.config' % V15_09_PREFIX,
-          '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
-          utils.IGNORE_WARNINGS_RULES],
-      'maindexrules' : [
-          os.path.join(V15_09_BASE, 'mainDexClasses.rules'),
-          os.path.join(V15_09_BASE, 'main-dex-classes-release-optimized.pgcfg'),
-          os.path.join(V15_09_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
-      'min-api' : ANDROID_H_MR2_API,
-    },
-    'proguarded' : {
-      'inputs': ['%s_proguard.jar' % V15_09_PREFIX],
-      'pgmap': '%s_proguard.map' % V15_09_PREFIX,
-      'min-api' : ANDROID_L_API,
-    }
-  },
   '15.33': {
     'dex' : {
       'inputs': [os.path.join(V15_33_BASE, 'YouTubeRelease_unsigned.apk')],
       'pgmap': '%s_proguard.map' % V15_33_PREFIX,
-      'libraries' : [ANDROID_JAR],
+      'libraries' : [utils.get_android_jar(25)],
       'min-api' : ANDROID_L_API,
     },
     'deploy' : {