Move core-icu4j, core-icu4j-testdex and i18n.module... to external/icu

Bug: 141683101
Test: m checkbuild
Change-Id: I030955a63c401fbb290e4686bf737fccd8052e57
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index bbb8c27..3dc4363 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -223,7 +223,7 @@
 // core-libart as well as the lambda stubs needed to compile Java lambda code.
 // It does not contain other parts of core library like conscrypt, bouncycastle,
 // etc. This system_modules definition is used to bootstrap compilation for
-// other parts of the core library like core-oj, core-libart, core-icu4j, conscrypt,
+// other parts of the core library like core-oj, core-libart, conscrypt,
 // bouncycastle, etc.
 java_system_modules {
     name: "core-all-system-modules",
@@ -321,32 +321,6 @@
     },
 }
 
-// A separated core library that contains ICU4J because ICU4J will be in a different APEX module,
-// not in Runtime module.
-java_library {
-    name: "core-icu4j",
-    visibility: [
-        "//art/build/apex",
-        "//external/robolectric-shadows",
-        "//frameworks/layoutlib",
-    ],
-    defaults: ["libcore_java_defaults"],
-    installable: true,
-    hostdex: true,
-
-    srcs: [":android_icu4j_src_files"],
-    libs: ["libcore-unsupportedappusage-annotation"],
-    static_libs: ["android_icu4j_resources_lib_sdk_core_current"],
-
-    // We use art-module-public-api-stubs-system-modules when compiling core-icu4j as ICU4J does not
-    // use any internal or android specific code. If it ever did then it could depend on
-    // core-intra-stubs-system-modules (a superset) instead.
-    // It is important that core-icu4j is restricted to only use stable APIs from the ART module
-    // since it is in a different APEX module that can be updated independently.
-    sdk_version: "none",
-    system_modules: "art-module-public-api-stubs-system-modules",
-}
-
 // Provided solely to contribute information about which hidden parts of the
 // core-oj API are used by apps.
 //
@@ -384,7 +358,7 @@
 }
 
 //
-// Guaranteed unstripped versions of core-icu4j, core-oj and core-libart.
+// Guaranteed unstripped versions of core-oj and core-libart.
 //
 // The build system may or may not strip the core-oj and core-libart jars,
 // but these will not be stripped. See b/24535627.
@@ -417,18 +391,6 @@
     notice: "ojluni/NOTICE",
 }
 
-java_library {
-    name: "core-icu4j-testdex",
-    installable: true,
-    static_libs: ["core-icu4j"],
-    sdk_version: "none",
-    system_modules: "core-all-system-modules",
-    dxflags: ["--core-library"],
-    dex_preopt: {
-        enabled: false,
-    },
-}
-
 java_defaults {
     name: "core_lambda_stubs_defaults",
     defaults: ["libcore_java_defaults"],
@@ -768,6 +730,9 @@
 // A stubs target containing the parts of the public SDK API provided by the ART module.
 java_library {
     name: "art.module.public.api.stubs",
+    visibility: [
+        "//external/icu/android_icu4j",
+    ],
     srcs: [":art-module-public-api-stubs-gen"],
     errorprone: {
         javacflags: [
@@ -785,6 +750,7 @@
 java_system_modules {
     name: "art-module-public-api-stubs-system-modules",
     visibility: [
+        "//external/icu/android_icu4j",
         "//external/wycheproof",
     ],
     libs: [
@@ -829,35 +795,6 @@
     system_modules: "art-module-public-api-stubs-system-modules",
 }
 
-// Generates stubs for the parts of the public SDK API provided by the i18n module.
-//
-// Only for use by i18n.module.public.api.stubs target below.
-droidstubs {
-    name: "i18n-module-public-api-stubs-gen",
-    srcs: [
-        ":android_icu4j_src_files",
-    ],
-    java_version: "1.9",
-    installable: false,
-    sdk_version: "none",
-    libs: [
-        "art.module.public.api.stubs",
-    ],
-}
-
-// A stubs target containing the parts of the public SDK API provided by the i18n module.
-java_library {
-    name: "i18n.module.public.api.stubs",
-    srcs: [":i18n-module-public-api-stubs-gen"],
-    errorprone: {
-        javacflags: [
-            "-Xep:MissingOverride:OFF",
-        ],
-    },
-    sdk_version: "none",
-    system_modules: "art-module-public-api-stubs-system-modules",
-}
-
 // A stubs target containing the parts of the public SDK API provided by the
 // core library.
 //
@@ -941,6 +878,9 @@
 // that should not introduce any runtime dependency for compiling core libraries, e.g. core-icu4j,
 java_library {
     name: "libcore-unsupportedappusage-annotation",
+    visibility: [
+        "//external/icu/android_icu4j",
+    ],
     srcs: [
         ":unsupportedappusage_annotation_files",
     ],