Create system modules using .txt stubs

Create a parallel set of java_system_modules provided by the SDK. This
parallel set will build using stubs of core libraries generated from
.txt files. Since stub generation from .txt is not available at ToT yet,
these modules have been marked "enabled: false". decodeSdkDep will be
updated to use these systemModules behind a flag.

(Will create java_system_modules for core_platform in a future CL)

Test: None (will test when the enabled flag is turned on)
Change-Id: Idd89d656fcbc87e8698fe05d65a685ade4488546
diff --git a/java/core-libraries/Android.bp b/java/core-libraries/Android.bp
index 372502d..128829e 100644
--- a/java/core-libraries/Android.bp
+++ b/java/core-libraries/Android.bp
@@ -357,3 +357,7 @@
         "art-module-intra-core-api-stubs-system-modules-lib",
     ],
 }
+
+build = [
+    "TxtStubLibraries.bp",
+]
diff --git a/java/core-libraries/TxtStubLibraries.bp b/java/core-libraries/TxtStubLibraries.bp
new file mode 100644
index 0000000..0046d68
--- /dev/null
+++ b/java/core-libraries/TxtStubLibraries.bp
@@ -0,0 +1,84 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This file contains java_system_modules provided by the SDK.
+// These system modules transitively depend on core stub libraries generated from .txt files.
+
+// Same as core-public-stubs-system-modules, but the stubs are generated from .txt files
+java_system_modules {
+    name: "core-public-stubs-system-modules.from-text",
+    visibility: ["//visibility:public"],
+    libs: [
+        "core-current-stubs-for-system-modules-no-annotations.from-text",
+    ],
+    // TODO: Enable after stub generation from .txt file is available
+    enabled: false,
+}
+
+java_library {
+    name: "core-current-stubs-for-system-modules-no-annotations.from-text",
+    visibility: ["//visibility:private"],
+    defaults: [
+        "system-modules-no-annotations",
+    ],
+    static_libs: [
+        "core.current.stubs.from-txt",
+        "core-lambda-stubs-for-system-modules",
+    ],
+    // TODO: Enable after stub generation from .txt file is available
+    enabled: false,
+}
+
+// Same as core-module-lib-stubs-system-modules, but the stubs are generated from .txt files
+java_system_modules {
+    name: "core-module-lib-stubs-system-modules.from-text",
+    visibility: ["//visibility:public"],
+    libs: [
+        "core-module-lib-stubs-for-system-modules-no-annotations.from-text",
+    ],
+    // TODO: Enable after stub generation from .txt file is available
+    enabled: false,
+}
+
+java_library {
+    name: "core-module-lib-stubs-for-system-modules-no-annotations.from-text",
+    visibility: ["//visibility:private"],
+    defaults: [
+        "system-modules-no-annotations",
+    ],
+    static_libs: [
+        "core.module_lib.stubs.txt",
+        "core-lambda-stubs-for-system-modules",
+    ],
+    // TODO: Enable after stub generation from .txt file is available
+    enabled: false,
+}
+
+java_library {
+    name: "core.module_lib.stubs.from-text",
+    static_libs: [
+        "art.module.public.api.stubs.module_lib.from-text",
+
+        // Replace the following with the module-lib correspondence when Conscrypt or i18N module
+        // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides
+        // @SystemApi(MODULE_LIBRARIES).
+        "conscrypt.module.public.api.stubs.from-text",
+        "i18n.module.public.api.stubs.from-text",
+    ],
+    sdk_version: "none",
+    system_modules: "none",
+    visibility: ["//visibility:private"],
+    // TODO: Enable after stub generation from .txt file is available
+    enabled: false,
+}