Refactor libart_runtime_headers_ndk to a header lib also used by libart
itself.

This renames it and drops `sdk_version: "current"` as well.

Test: art/build/apex/runtests.sh
Test: m art-module-sdk art-module-{host,test}-exports
Bug: 204364566
Change-Id: I62c18fb1406e96865ad60d5022dcc4b60e778cbd
diff --git a/disassembler/Android.bp b/disassembler/Android.bp
index 71ad051..4de4a4f 100644
--- a/disassembler/Android.bp
+++ b/disassembler/Android.bp
@@ -48,8 +48,7 @@
         "libbase",
     ],
     header_libs: [
-        "art_libartbase_headers",
-        "libart_runtime_headers_ndk",
+        "libart_headers",
     ],
     export_include_dirs: ["."],
 }
diff --git a/runtime/Android.bp b/runtime/Android.bp
index f87a0e9..be060c9 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -66,6 +66,25 @@
     },
 }
 
+cc_library_headers {
+    name: "libart_headers",
+    host_supported: true,
+
+    export_include_dirs: ["."],
+
+    // ART's macros.h depends on libbase's macros.h.
+    // Note: runtime_options.h depends on cmdline. But we don't really want to export this
+    //       generically. dex2oat takes care of it itself.
+    header_libs: ["art_libartbase_headers"],
+    export_header_lib_headers: ["art_libartbase_headers"],
+
+    apex_available: [
+        "com.android.art",
+        "com.android.art.debug",
+    ],
+    min_sdk_version: "S",
+}
+
 libart_cc_defaults {
     name: "libart_defaults",
     defaults: ["art_defaults"],
@@ -423,8 +442,10 @@
         "art_cmdlineparser_headers",
         "cpp-define-generator-definitions",
         "jni_platform_headers",
+        "libart_headers",
         "libnativehelper_header_only",
     ],
+    export_header_lib_headers: ["libart_headers"],
     whole_static_libs: [
         "libcpu_features",
     ],
@@ -454,12 +475,6 @@
         //   manifest-art.json.
         "libjavacore",
     ],
-
-    export_include_dirs: ["."],
-    // ART's macros.h depends on libbase's macros.h.
-    // Note: runtime_options.h depends on cmdline. But we don't really want to export this
-    //       generically. dex2oat takes care of it itself.
-    export_shared_lib_headers: ["libbase"],
 }
 
 libart_static_cc_defaults {
@@ -866,19 +881,6 @@
     test_config: "art_standalone_runtime_compiler_tests.xml",
 }
 
-cc_library_headers {
-    name: "libart_runtime_headers_ndk",
-    host_supported: true,
-    export_include_dirs: ["."],
-    sdk_version: "current",
-
-    apex_available: [
-        "com.android.art",
-        "com.android.art.debug",
-    ],
-    min_sdk_version: "S",
-}
-
 genrule {
     name: "libart_mterp.x86ng",
     out: ["mterp_x86ng.S"],
diff --git a/tools/cpp-define-generator/Android.bp b/tools/cpp-define-generator/Android.bp
index 3c6acb9..b27ccd6 100644
--- a/tools/cpp-define-generator/Android.bp
+++ b/tools/cpp-define-generator/Android.bp
@@ -35,7 +35,7 @@
     header_libs: [
         "art_libartbase_headers", // For base/bit_utils.h
         "jni_headers",
-        "libart_runtime_headers_ndk",
+        "libart_headers",
         "libdexfile_all_headers", // For dex/modifiers.h
     ],
     // Produce text file rather than binary.