Repository: bazelbuild/bazel
Issue: Remove dependency on the java.desktop module
Labels: P2
team-Performance

It contributes 13MB to the the size of the embedded JDK which is ~40MB in total right now.

This list describes the paths in the `server.jar` which contain classes that depend on the java.desktop module:
- [x] `javax/xml/bind`
- [x] `com/android/ddmlib`
- [ ] `com/android/ide/common/util`
- [ ] `com/android/ide/common/rendering`
- [ ] `com/android/ide/common/rendering/api`
- [ ] `com/android/ide/common/vectordrawable`
- [ ] `com/android/tools/lint/checks`
- [ ] `com/android/sdklib/devices`
- [ ] `com/android/builder/png`
- [x] `lombok/ast/ecj`
- [x] `lombok/ast/grammar`

In turn `javax.xml.bind` is used by maven_jar (see #6799) and by the android_common dependency of `android_sdk_repository`.
`lombok/.*` comes from `third_party/android_common/com.android.tools.external.lombok_lombok-ast_0.2.3.jar`.


Issue comments:
Making a change in android_common jars will typically incur a lot of changes internally - please let us (@ahumesky / myself) know if you stumble upon any roadblocks. 
@jin to be clear: I still count on you / the Android team to work on unbundling the tools (#1055).
This issue is to keep track of the removal of the module itself and the outstanding blockers.
Ah, my bad, I misunderstood the assignment on this issue as you taking it up :) Thanks for clarifying! Unbundling the mobile tools will definitely be part of the ongoing Android Starlark migration (and land in bazelbuild/tools_android).

Pull request review comments:

Patch that resolved the issue:
diff --git a/WORKSPACE b/WORKSPACE
index 5f03fb422aa173..607da272ad6b9d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -192,9 +192,9 @@ http_file(
 http_file(
     name = "openjdk_linux_minimal",
     downloaded_file_path = "zulu-linux-minimal.tar.gz",
-    sha256 = "734cbfc9a5264e6cff4877d6694acb2305359531a503748879a84d4996b24932",
+    sha256 = "5123bc8dd21886761d1fd9ca0fb1898b3372d7243064a070ec81ca9c9d1a6791",
     urls = [
-        "https://mirror.bazel.build/openjdk/azul-zulu11.29.3-ca-jdk11.0.2/zulu11.29.3-ca-jdk11.0.2-linux_x64-minimal-7a3af9f6f98ce69c1ebd2931817c2664a18cf279-1552657479.tar.gz",
+        "https://mirror.bazel.build/openjdk/azul-zulu11.29.3-ca-jdk11.0.2/zulu11.29.3-ca-jdk11.0.2-linux_x64-minimal-524ae2ca2a782c9f15e00f08bd35b3f8ceacbd7f-1556011926.tar.gz",
     ],
 )
 
@@ -231,9 +231,9 @@ http_file(
 http_file(
     name = "openjdk_macos_minimal",
     downloaded_file_path = "zulu-macos-minimal.tar.gz",
-    sha256 = "fd2a39d8947c53879f3d809c2ff783fc279d96f4ef2cccefb34d1d1b9cc6165f",
+    sha256 = "ac56e44db46fd56ac78b39b6823daed4faa74a2677ac340c7d217f863884ec0f",
     urls = [
-        "https://mirror.bazel.build/openjdk/azul-zulu11.29.3-ca-jdk11.0.2/zulu11.29.3-ca-jdk11.0.2-macosx_x64-minimal-7a3af9f6f98ce69c1ebd2931817c2664a18cf279-1552657467.tar.gz",
+        "https://mirror.bazel.build/openjdk/azul-zulu11.29.3-ca-jdk11.0.2/zulu11.29.3-ca-jdk11.0.2-macosx_x64-minimal-524ae2ca2a782c9f15e00f08bd35b3f8ceacbd7f-1556003114.tar.gz",
     ],
 )
 
@@ -258,9 +258,9 @@ http_file(
 http_file(
     name = "openjdk_win_minimal",
     downloaded_file_path = "zulu-win-minimal.zip",
-    sha256 = "ce063face0ca9d539084731edf2ec92a3faa3c1d1b6915cf5ec1a09facbf52ac",
+    sha256 = "8e5dada6e9ebcc9ce29b4d051449bb95d3ee1e620e166da862224bbf15211f8b",
     urls = [
-        "https://mirror.bazel.build/openjdk/azul-zulu11.29.3-ca-jdk11.0.2/zulu11.29.3-ca-jdk11.0.2-win_x64-minimal-7a3af9f6f98ce69c1ebd2931817c2664a18cf279-1552657495.zip",
+        "https://mirror.bazel.build/openjdk/azul-zulu11.29.3-ca-jdk11.0.2/zulu11.29.3-ca-jdk11.0.2-win_x64-minimal-524ae2ca2a782c9f15e00f08bd35b3f8ceacbd7f-1556003136.zip",
     ],
 )
 


Test patch: