Build and archive compatproguard.jar

Change-Id: I88e0c9856b0a1f18bbe1938d875efc3b677c9d96
diff --git a/tools/archive.py b/tools/archive.py
index 4e36724..2ab1f1f 100755
--- a/tools/archive.py
+++ b/tools/archive.py
@@ -3,6 +3,7 @@
 # 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 gradle
 import d8
 import os
 import r8
@@ -68,7 +69,10 @@
     print 'On master, using git hash for archiving'
     version = GetGitHash()
 
-  for jar in [utils.D8_JAR, utils.R8_JAR, utils.COMPATDX_JAR]:
+  # Ensure all archived artifacts has been built before archiving.
+  gradle.RunGradle([utils.D8, utils.R8, utils.COMPATDX, utils.COMPATPROGUARD])
+
+  for jar in [utils.D8_JAR, utils.R8_JAR, utils.COMPATDX_JAR, utils.COMPATPROGUARD_JAR]:
     file_name = os.path.basename(jar)
     destination = GetUploadDestination(version, file_name, is_master)
     print('Uploading %s to %s' % (jar, destination))
diff --git a/tools/utils.py b/tools/utils.py
index 18f9779..7d198fa 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -18,11 +18,17 @@
 DEX_SEGMENTS_JAR = os.path.join(REPO_ROOT, 'build', 'libs',
     'dexsegments.jar')
 DEX_SEGMENTS_RESULT_PATTERN = re.compile('- ([^:]+): ([0-9]+)')
-COMPATDX_JAR = os.path.join(REPO_ROOT, 'build', 'libs', 'compatdx.jar')
 LIBS = os.path.join(REPO_ROOT, 'build', 'libs')
+
+D8 = 'd8'
+R8 = 'r8'
+COMPATDX = 'compatdx'
+COMPATPROGUARD = 'compatproguard'
+
 D8_JAR = os.path.join(LIBS, 'd8.jar')
 R8_JAR = os.path.join(LIBS, 'r8.jar')
 COMPATDX_JAR = os.path.join(LIBS, 'compatdx.jar')
+COMPATPROGUARD_JAR = os.path.join(LIBS, 'compatproguard.jar')
 
 def PrintCmd(s):
   if type(s) is list: