Add java tools sources archive and update the deploy jars.

- Updated third_party/java/java_tools/update_java_tools.sh to create a zip of the java tools source code.
- Run third_party/java/java_tools/update_java_tools.sh to update all the tools and create the initial source zip.
- Added a target for creating the Java tools archive that will be uploaded to mirror.bazel.build.
diff --git a/third_party/BUILD b/third_party/BUILD
index 5fcb476..8467532 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -1,5 +1,7 @@
 package(default_visibility = ["//visibility:public"])
 
+load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
+
 filegroup(
     name = "srcs",
     srcs = glob(["**"]) + [
@@ -599,6 +601,28 @@
     ],
 )
 
+pkg_tar(
+    name = "java_tools_pkg",
+    srcs = [
+        "//third_party/java/java_tools:java_tools",
+        "//third_party/java/jdk/langtools:javac_jar",
+        "//third_party/java/jdk/langtools:jdk_compiler_jar",
+        "//third_party/java/jdk/langtools:java_compiler_jar"
+    ],
+)
+
+pkg_tar(
+    name = "java_tools_pkg-gz",
+    srcs = [
+        "//third_party/java/java_tools:java_tools",
+        "//third_party/java/jdk/langtools:javac_jar",
+        "//third_party/java/jdk/langtools:jdk_compiler_jar",
+        "//third_party/java/jdk/langtools:java_compiler_jar"
+    ],
+    extension = "tar.gz"
+)
+
+
 load(":compiler_config_setting.bzl", "create_compiler_config_setting")
 
 create_compiler_config_setting(
diff --git a/third_party/java/java_tools/BUILD.pkg b/third_party/java/java_tools/BUILD.pkg
index b5d71e8..4f9dc4f 100644
--- a/third_party/java/java_tools/BUILD.pkg
+++ b/third_party/java/java_tools/BUILD.pkg
@@ -37,7 +37,11 @@
     srcs = ["bazel-singlejar_deploy.jar"],
 )
 
+<<<<<<< HEAD
 filegroup(
+=======
+filegrup(
+>>>>>>> Add java tools sources archive and update the deploy jars.
     name = "JarJar",
     srcs = ["jarjar_command_deploy.jar"],
 )
@@ -50,6 +54,7 @@
 filegroup(
     name = "TurbineDirect",
     srcs = ["turbine_direct_binary_deploy.jar"],
+<<<<<<< HEAD
 )
 
 filegroup(
@@ -66,3 +71,6 @@
     name = "java_compiler_jar",
     srcs = ["java_compiler.jar"],
 )
+=======
+)
+>>>>>>> Add java tools sources archive and update the deploy jars.
diff --git a/third_party/java/java_tools/JavaBuilder_deploy.jar b/third_party/java/java_tools/JavaBuilder_deploy.jar
index 4100277..e3d2c09 100755
--- a/third_party/java/java_tools/JavaBuilder_deploy.jar
+++ b/third_party/java/java_tools/JavaBuilder_deploy.jar
Binary files differ
diff --git a/third_party/java/java_tools/README.md b/third_party/java/java_tools/README.md
index 408669c..b3a66f1 100644
--- a/third_party/java/java_tools/README.md
+++ b/third_party/java/java_tools/README.md
@@ -3,22 +3,20 @@
 To see how to update the tools run:
 
 ```
-./third_party/java/java_tools/update_java_tools.sh help
+third_party/java/java_tools/update_java_tools.sh help
 ```
 
-The following tools were built with bazel 0.21.0 at commit 252c82cd135f1bcdadfc961c127895e9b2347b77
-
-third_party/java/java_tools/JavaBuilder_deploy.jar
-third_party/java/java_tools/VanillaJavaBuilder_deploy.jar
-third_party/java/java_tools/GenClass_deploy.jar
-third_party/java/java_tools/Runner_deploy.jar
-third_party/java/java_tools/ExperimentalRunner_deploy.jar
-third_party/java/java_tools/JacocoCoverage_jarjar_deploy.jar
-third_party/java/java_tools/turbine_deploy.jar
-third_party/java/java_tools/turbine_direct_binary_deploy.jar
-third_party/java/java_tools/SingleJar_deploy.jar
-
-The following tools were built with bazel 0.21.0 at commit 019f13b64630ea7e7837a2ed8b664c4262322b1c by running:
+The following tools were built with bazel 0.21.0 at commit 9cf5c6955a8ea7cd9dffb2670b7b2e4c509dc2d0 by running:
 $ third_party/java/java_tools/update_java_tools.sh
 
-third_party/java/java_tools/jarjar_command_deploy.jar
\ No newline at end of file
+third_party/java/java_tools/java_tools-srcs.zip
+third_party/java/java_tools/turbine_deploy.jar
+third_party/java/java_tools/ExperimentalRunner_deploy.jar
+third_party/java/java_tools/bazel-singlejar_deploy.jar
+third_party/java/java_tools/GenClass_deploy.jar
+third_party/java/java_tools/VanillaJavaBuilder_deploy.jar
+third_party/java/java_tools/JacocoCoverage_jarjar_deploy.jar
+third_party/java/java_tools/turbine_direct_binary_deploy.jar
+third_party/java/java_tools/JavaBuilder_deploy.jar
+third_party/java/java_tools/jarjar_command_deploy.jar
+third_party/java/java_tools/Runner_deploy.jar
diff --git a/third_party/java/java_tools/VanillaJavaBuilder_deploy.jar b/third_party/java/java_tools/VanillaJavaBuilder_deploy.jar
index 34c3095..50dd8d8 100755
--- a/third_party/java/java_tools/VanillaJavaBuilder_deploy.jar
+++ b/third_party/java/java_tools/VanillaJavaBuilder_deploy.jar
Binary files differ
diff --git a/third_party/java/java_tools/bazel-singlejar_deploy.jar b/third_party/java/java_tools/bazel-singlejar_deploy.jar
index 4330508..f92fcd8 100755
--- a/third_party/java/java_tools/bazel-singlejar_deploy.jar
+++ b/third_party/java/java_tools/bazel-singlejar_deploy.jar
Binary files differ
diff --git a/third_party/java/java_tools/java_tools-srcs.zip b/third_party/java/java_tools/java_tools-srcs.zip
new file mode 100644
index 0000000..2de937d
--- /dev/null
+++ b/third_party/java/java_tools/java_tools-srcs.zip
Binary files differ
diff --git a/third_party/java/java_tools/turbine_deploy.jar b/third_party/java/java_tools/turbine_deploy.jar
index 693c912..31f9ac5 100755
--- a/third_party/java/java_tools/turbine_deploy.jar
+++ b/third_party/java/java_tools/turbine_deploy.jar
Binary files differ
diff --git a/third_party/java/java_tools/turbine_direct_binary_deploy.jar b/third_party/java/java_tools/turbine_direct_binary_deploy.jar
index 46865e1..b9d197a 100755
--- a/third_party/java/java_tools/turbine_direct_binary_deploy.jar
+++ b/third_party/java/java_tools/turbine_direct_binary_deploy.jar
Binary files differ
diff --git a/third_party/java/java_tools/update_java_tools.sh b/third_party/java/java_tools/update_java_tools.sh
index c77013c..d20e832 100755
--- a/third_party/java/java_tools/update_java_tools.sh
+++ b/third_party/java/java_tools/update_java_tools.sh
@@ -4,7 +4,7 @@
 # by the Java rules in Bazel.
 #
 # For usage please run
-# ~/third_party/java/java_tools/update_java_tools.sh help
+# third_party/java/java_tools/update_java_tools.sh help
 
 # Maps the java tool names to their associated bazel target.
 declare -A tool_name_to_target=(["JavaBuilder"]="src/java_tools/buildjar:JavaBuilder_deploy.jar" \
@@ -22,7 +22,12 @@
 "used by the Java rules in Bazel.
 
 To update all the tools simultaneously run from your bazel workspace root:
-~/third_party/java/java_tools/update_java_tools.sh
+third_party/java/java_tools/update_java_tools.sh
+
+WARNING: This script also allows updating individual tools, but it is not recommended
+to do so, because it involves creating the sources archive manually from
+different commits in bazel. Prefer to update all the tools, even though you
+only target one of them.
 
 To update only one or one subset of the tools run
 third_party/java/java_tools/update_java_tools.sh tool_1 tool_2 ... tool_n
@@ -43,19 +48,33 @@
 
 # Stores the names of the tools required for update.
 tools_to_update=()
-if [[ ! -z "$@" ]]
-then
-   # Update only the tools specified on the command line.
-   tools_to_update=("$@")
-else
-  # If no tools were specified update all of them.
-  tools_to_update=(${!tool_name_to_target[*]})
-fi
 
 # Stores the workspace relative path of all the tools that were updated
 # (e.g. third_party/java/java_tools/JavaBuilder_deploy.jar)
 updated_tools=()
 
+if [[ ! -z "$@" ]]
+then
+   # Update only the tools specified on the command line.
+   tools_to_update=("$@")
+   echo "The sources archive was NOT created. Please create it manually!"
+else
+  # If no tools were specified update all of them.
+  tools_to_update=(${!tool_name_to_target[*]})
+  # Create the sources archive only when all the tools were updated.
+  # TODO(iirina): Find another archiving method that is reproducible
+  # (e.g. doesn't include timestamps).
+  zip -Xr third_party/java/java_tools/java_tools-srcs.zip src/java_tools/buildjar/* \
+  src/java_tools/junitrunner/* src/java_tools/singlejar/* third_party/jarjar/* \
+  third_party/java/jdk/langtools/LICENSE \
+  third_party/java/jdk/langtools/java_compiler-src.jar \
+  third_party/java/jdk/langtools/javac-9+181-r4173-1.srcjar \
+  third_party/java/jdk/langtools/jdk_compiler-src.jar \
+  echo "Created sources archive third_party/java/java_tools/java_tools-srcs.zip"
+  updated_tools+=("third_party/java/java_tools/java_tools-srcs.zip")
+fi
+
+
 # Updates the tool with the given bazel target.
 #
 # Builds the given bazel target and copies the generated binary
@@ -99,6 +118,8 @@
 if [[ ${#updated_tools[@]} -gt 0 ]]; then
   bazel_version=$(bazel version | grep "Build label" | cut -d " " -f 3)
   git_head=$(git rev-parse HEAD)
+  echo "IMPORTANT: Make sure that third_party/java/java_tools/java_tools-srcs.zip was created \
+or create it manually!"
   echo ""
   echo "Please copy/paste the following into third_party/java/java_tools/README.md:"
   echo ""