Specify input files to mac_arm using narrower glob functions

Using `glob(["**"])`, bazel will traverse directory symlinks which we
do not want. Instead we explicitly add each symlink as a file so that
downstream actions will receive the expected file list.

Bug: 185519599
Test: Inspected tools/adt/idea/studio:android_studio mac_arm.zip.res.lst
argument file

Change-Id: I838b8af12d759d13f272866f5f9dd5bfce9f3769
diff --git a/BUILD b/BUILD
index 3e89aab..8a87e64 100644
--- a/BUILD
+++ b/BUILD
@@ -15,7 +15,29 @@
     name = "jdk-bundle",
     files_linux = glob(["jdk11-runtime/linux/**"]),
     files_mac = glob(["jdk11-runtime/mac/**"]),
-    files_mac_arm = glob(["jdk11-runtime/mac-arm64/**"]),
+    # For directory symbolic links to be preserved, files must be listed explicitly.
+    # Otherwise, glob(["/**"]) will traverse the directory symlink.
+    files_mac_arm = [
+        "jdk11-runtime/mac-arm64/Contents/Info.plist",
+        "jdk11-runtime/mac-arm64/Contents/Home/release",
+        "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/Headers",
+        "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/Modules",
+        "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/Resources",
+        "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation",
+        "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/JavaNativeFoundation.tbd",
+        "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/Versions/Current",
+    ] + glob(
+        [
+            "jdk11-runtime/mac-arm64/Contents/MacOS/*",
+            "jdk11-runtime/mac-arm64/Contents/Home/bin/*",
+            "jdk11-runtime/mac-arm64/Contents/Home/conf/**",
+            "jdk11-runtime/mac-arm64/Contents/Home/include/**",
+            "jdk11-runtime/mac-arm64/Contents/Home/jmods/**",
+            "jdk11-runtime/mac-arm64/Contents/Home/legal/**",
+            "jdk11-runtime/mac-arm64/Contents/Home/lib/**",
+            "jdk11-runtime/mac-arm64/Contents/Home/Frameworks/JavaNativeFoundation.framework/Versions/A/**",
+        ],
+    ),
     files_win = glob(["jdk11-runtime/win/**"]),
     mappings = {
         "prebuilts/studio/jdk/jdk11-runtime/linux/": "",