• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2019 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "art_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["art_license"],
24}
25
26cc_defaults {
27    name: "libartpalette_defaults",
28    defaults: ["art_defaults"],
29    host_supported: true,
30    export_include_dirs: ["include"],
31}
32
33cc_library_headers {
34    name: "libartpalette-headers",
35    export_include_dirs: ["include"],
36    host_supported: true,
37    visibility: [
38        "//art:__subpackages__",
39        "//system/libartpalette",
40    ],
41}
42
43// libartpalette is the dynamic loader of the platform abstraction
44// layer. It is only used on Android. For other targets, it just
45// implements a fake platform implementation.
46art_cc_library {
47    name: "libartpalette",
48    defaults: ["libartpalette_defaults"],
49    visibility: [
50        // TODO(b/183483755): Please visibility checks when the prebuilt
51        // libartpalette is present but not preferred, and the prebuilt
52        // libdexfile hence depends on the source instead.
53        // TODO(b/172480617): Alternatively, clean up when we no longer need to
54        // support both prebuilts and sources present simultaneously.
55        "//prebuilts/module_sdk/art:__subpackages__",
56    ],
57    header_libs: [
58        "libbase_headers",
59        "jni_headers",
60    ],
61    export_header_lib_headers: [
62        "jni_headers",
63    ],
64    target: {
65        // Targets supporting dlopen build the client library which loads
66        // and binds the methods in the libartpalette-system library.
67        android: {
68            // libartpalette.so dlopen()'s libartpalette-system.
69            runtime_libs: ["libartpalette-system"],
70            srcs: ["apex/palette.cc"],
71            shared_libs: ["liblog"],
72            version_script: "libartpalette.map",
73        },
74        host_linux: {
75            header_libs: ["libbase_headers"],
76            srcs: ["system/palette_fake.cc"],
77            shared: {
78                shared_libs: [
79                    "libbase",
80                    "liblog",
81                ],
82            },
83            version_script: "libartpalette.map",
84        },
85        // Targets without support for dlopen just use the sources for
86        // the system library which actually implements functionality.
87        darwin: {
88            enabled: true,
89            header_libs: ["libbase_headers"],
90            srcs: ["system/palette_fake.cc"],
91            static_libs: [
92                "libbase",
93                "liblog",
94            ],
95        },
96        windows: {
97            enabled: true,
98            header_libs: ["libbase_headers"],
99            srcs: ["system/palette_fake.cc"],
100            static_libs: [
101                "libbase",
102                "liblog",
103            ],
104        },
105    },
106    apex_available: [
107        "com.android.art",
108        "com.android.art.debug",
109        // TODO(b/142944931): remove this
110        "com.android.runtime", // due to the transitive dependency from linker
111    ],
112}
113
114art_cc_defaults {
115    name: "art_libartpalette_tests_defaults",
116    srcs: ["apex/palette_test.cc"],
117    shared_libs: [
118        "libartpalette",
119        "libnativehelper",
120    ],
121    target: {
122        android: {
123            static_libs: ["libmodules-utils-build"],
124        },
125    },
126}
127
128// Version of ART gtest `art_libartpalette_tests` bundled with the ART APEX on target.
129// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
130art_cc_test {
131    name: "art_libartpalette_tests",
132    defaults: [
133        "art_gtest_defaults",
134        "art_libartpalette_tests_defaults",
135    ],
136    host_supported: true,
137}
138
139// Standalone version of ART gtest `art_libartpalette_tests`, not bundled with the ART APEX on
140// target.
141art_cc_test {
142    name: "art_standalone_libartpalette_tests",
143    defaults: [
144        "art_standalone_gtest_defaults",
145        "art_libartpalette_tests_defaults",
146    ],
147    test_config_template: ":art-gtests-target-standalone-cts-template",
148    test_suites: ["cts"],
149}
150