Remove duplicate libraries that are provided by system modules

An improvement in the Soong build means that it is no longer necessary
to duplicate the libraries that it provides. This change removes the
duplicates and moves the system_modules property next to sdk_version
property to be consistent and because those properties are tightly
coupled.

Bug: 141359858
Test: m checkbuild
Change-Id: Ifaa9ece8624e569c522a92d8ed0b5e8b23bb2551
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 7a939cc..d98541f 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -252,7 +252,6 @@
     java_resources: core_resources,
 
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     openjdk9: {
         javacflags: ["--patch-module=java.base=."],
@@ -299,7 +298,6 @@
     java_version: "1.9",
 
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     openjdk9: {
         javacflags: ["--patch-module=java.base=."],
@@ -385,7 +383,6 @@
     srcs: [":openjdk_hiddenapi_javadoc_files"],
 
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     openjdk9: {
         javacflags: ["--patch-module=java.base=."],
@@ -404,7 +401,6 @@
     installable: true,
     static_libs: ["core-oj"],
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     dxflags: ["--core-library"],
     dex_preopt: {
@@ -419,7 +415,6 @@
     installable: true,
     static_libs: ["core-libart"],
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     dxflags: ["--core-library"],
     dex_preopt: {
@@ -433,7 +428,6 @@
     installable: true,
     static_libs: ["core-icu4j"],
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     dxflags: ["--core-library"],
     dex_preopt: {
@@ -447,7 +441,6 @@
     hostdex: true,
 
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     openjdk9: {
         javacflags: ["--patch-module=java.base=."],
@@ -502,7 +495,6 @@
     ],
     hostdex: true,
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     openjdk9: {
         javacflags: ["--patch-module=java.base=."],
@@ -554,7 +546,6 @@
     static_libs: ["junit"],
 
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
 }
 
@@ -592,11 +583,10 @@
     ],
     srcs: ["jsr166-tests/src/test/java/**/*.java"],
     sdk_version: "none",
+    system_modules: "core-all-system-modules",
     libs: [
-        "core-all",
         "junit",
     ],
-    system_modules: "core-all-system-modules",
 }
 
 // A filegroup that provides access to a source file for a toolchain test that
@@ -646,12 +636,11 @@
     ],
 
     sdk_version: "none",
+    system_modules: "core-all-system-modules",
     libs: [
-        "core-all",
         "okhttp",
         "bouncycastle",
     ],
-    system_modules: "core-all-system-modules",
 
     static_libs: [
         "archive-patcher",
@@ -694,12 +683,11 @@
     ],
 
     sdk_version: "none",
+    system_modules: "core-all-system-modules",
     libs: [
-        "core-all",
         "okhttp",
         "bouncycastle",
     ],
-    system_modules: "core-all-system-modules",
 
     static_libs: ["testng"],
 
@@ -749,13 +737,12 @@
     ],
 
     sdk_version: "none",
+    system_modules: "core-all-system-modules",
     libs: [
-        "core-all",
         "bouncycastle",
         "okhttp",
         "testng",
     ],
-    system_modules: "core-all-system-modules",
 }
 
 // Exports annotated stubs source files in ojluni/annotations/sdk to make them
diff --git a/benchmarks/Android.bp b/benchmarks/Android.bp
index 2f2b65a..4f2f157 100644
--- a/benchmarks/Android.bp
+++ b/benchmarks/Android.bp
@@ -23,7 +23,6 @@
     system_modules: "core-all-system-modules",
     libs: [
         "caliper-api-target",
-        "core-all",
         "android.test.base",
     ],
 }
diff --git a/luni/src/test/java9language/Android.bp b/luni/src/test/java9language/Android.bp
index 2c855be..dddc184 100644
--- a/luni/src/test/java9language/Android.bp
+++ b/luni/src/test/java9language/Android.bp
@@ -24,7 +24,6 @@
     java_version: "1.9",
 
     sdk_version: "none",
-    libs: ["core-all"],
     system_modules: "core-all-system-modules",
     patch_module: "java.base",
 
@@ -66,13 +65,10 @@
         ":core-gen-test-repackaged-java-9-language-features",
     ],
     sdk_version: "none",
-    libs: [
-        "core-all",
-    ],
+    system_modules: "core-all-system-modules",
     static_libs: [
         "core-java-9-language-features-repackaged-for-test",
         "junit",
     ],
-    system_modules: "core-all-system-modules",
     visibility: ["//libcore"],
 }
diff --git a/mmodules/intracoreapi/Android.bp b/mmodules/intracoreapi/Android.bp
index 03a11a3..011015f 100644
--- a/mmodules/intracoreapi/Android.bp
+++ b/mmodules/intracoreapi/Android.bp
@@ -68,7 +68,6 @@
     name: "core-intra-stubs-system-modules",
     visibility: [
         "//external/conscrypt",
-        "//libcore",
     ],
     libs: ["core.intra.stubs"],
 }