• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "art_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["art_license"],
22}
23
24soong_config_module_type_import {
25    from: "art/build/SoongConfig.bp",
26    module_types: [
27        "art_module_sdk",
28        "art_module_exports",
29    ],
30}
31
32// Additional visibility to add to the prebuilt modules that are part of
33// the snapshots of the ART sdk/module_exports to ensure that they are
34// visible to each other.
35prebuilt_visibility = [
36    // TODO(b/155921753): Restrict this when prebuilts are in their proper
37    // locations.
38    "//prebuilts:__subpackages__",
39]
40
41// The SDK for the art module apex.
42art_module_sdk {
43    name: "art-module-sdk",
44    host_supported: true,
45
46    // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
47    enabled: false,
48    soong_config_variables: {
49        source_build: {
50            enabled: true,
51        },
52    },
53
54    prebuilt_visibility: prebuilt_visibility,
55
56    traits: {
57        native_bridge_support: [
58            "jni_headers",
59        ],
60        ramdisk_image_required: [
61            "jni_headers",
62        ],
63        recovery_image_required: [
64            "jni_headers",
65        ],
66    },
67
68    target: {
69        // Both android and host linux but not windows or darwin.
70        linux: {
71            native_header_libs: [
72                "jni_headers",
73                "libartpalette-headers",
74                "libnativehelper_header_only",
75                "libopenjdkjvmti_headers",
76                "odrefresh_headers",
77            ],
78
79            native_shared_libs: [
80                "libandroidio",
81                "libdexfile",
82                "libnativebridge",
83                "libnativehelper",
84                "libnativeloader",
85                "libsigchain",
86            ],
87
88            native_static_libs: [
89                "libdexfile_support",
90                "libdexfile_static",
91                "libnativehelper_lazy",
92            ],
93        },
94
95        android: {
96            bootclasspath_fragments: [
97                // Adds the fragment and its contents to the sdk.
98                "art-bootclasspath-fragment",
99            ],
100
101            systemserverclasspath_fragments: [
102                "art-systemserverclasspath-fragment",
103            ],
104
105            compat_configs: [
106                "libcore-platform-compat-config",
107            ],
108
109            java_header_libs: [
110                // Needed by any module that builds against any non-numeric
111                // sdk_version other than "none".
112                //
113                // This is actually only used for compiling Java 8 and kotlin.
114                // Java 9 uses system modules which encapsulates this
115                // internally.
116                "core-lambda-stubs",
117
118                // A special form or "core-lambda-stubs" for use in
119                // java_system_modules.
120                "core-lambda-stubs-for-system-modules",
121
122                // Needed when javac compiles code containing @Generated
123                // annotations produced by some code generation tools.
124                "core-generated-annotation-stubs",
125            ],
126
127            java_sdk_libs: [
128                "art.module.public.api",
129            ],
130
131            java_system_modules: [
132                "art-module-public-api-stubs-system-modules",
133                "art-module-lib-api-stubs-system-modules",
134                "art-module-intra-core-api-stubs-system-modules",
135            ],
136            native_header_libs: [
137                "libnativeloader-headers",
138            ],
139            native_shared_libs: [
140                "libnativebridge_lazy",
141                "libnativehelper_compat_libc++",
142                "libnativeloader_lazy",
143            ],
144        },
145
146        linux_bionic: {
147            enabled: false,
148        },
149        darwin: {
150            enabled: false,
151        },
152    },
153}
154
155// Exported host tools and libraries.
156art_module_exports {
157    name: "art-module-host-exports",
158    host_supported: true,
159
160    // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
161    enabled: false,
162    soong_config_variables: {
163        source_build: {
164            enabled: true,
165        },
166    },
167
168    prebuilt_visibility: prebuilt_visibility,
169
170    java_libs: [
171        // Needed for grpc-grpc-java
172        "okhttp-norepackage",
173    ],
174
175    target: {
176        host: {
177            // Set in target.host because the top level compile_multilib
178            // property is fixed to "both" in the sdk/module_exports
179            // implementation and cannot be overridden any other way.
180            compile_multilib: "64",
181
182            java_libs: [
183                "art.module.api.annotations",
184            ],
185            native_binaries: [
186                "dex2oat",
187                "dex2oatd",
188                "dexdump",
189                "hiddenapi",
190                "oatdump",
191                "profman",
192                "veridex",
193            ],
194            native_libs: [
195                // libdexfile dependencies for host tests.
196                // TODO(b/178691801): Support transitive internal library
197                // dependencies in module_export snapshots and clean this up.
198                "libartpalette",
199                "libartbase",
200            ],
201        },
202
203        linux_bionic: {
204            enabled: false,
205        },
206        darwin: {
207            enabled: false,
208        },
209        windows: {
210            enabled: false,
211        },
212    },
213}
214
215// Exported tests and supporting libraries
216art_module_exports {
217    name: "art-module-test-exports",
218
219    // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
220    enabled: false,
221    soong_config_variables: {
222        source_build: {
223            enabled: true,
224        },
225    },
226
227    prebuilt_visibility: prebuilt_visibility,
228
229    java_libs: [
230        "core-compat-test-rules",
231        "core-test-rules",
232        "core-tests-support",
233        "okhttp-tests-nojarjar",
234
235        // Needed for CtsJvmtiDeviceRunTestAppBase.
236        "art_cts_jvmti_test_library",
237        "expected_cts_outputs",
238
239        // Needed for robolectric.
240        "core-libart-for-host",
241        "okhttp-for-host",
242
243        // Needed for CtsLibcore...TestCases
244        "libcore-expectations-knownfailures-jar",
245        "libcore-expectations-virtualdeviceknownfailures-jar",
246
247        // Needed for CtsLibcoreOkHttpTestCases
248        "okhttp-nojarjar",
249    ],
250
251    java_tests: [
252        // Needed for CtsJdwpTestCases.
253        "apache-harmony-jdwp-tests",
254
255        "libcore-crypto-tests",
256
257        // Needed for CtsLibcoreOjTestCases
258        "core-ojtests-public",
259
260        // Needed for CtsLibcoreJsr166TestCases
261        "jsr166-tests",
262
263        // Needed for CtsLibcoreTestCases
264        "apache-harmony-tests",
265        "core-tests",
266    ],
267
268    native_shared_libs: [
269        "libjavacoretests",
270    ],
271    native_static_libs: [
272        // TODO(b/187288515): Providing this as a prebuilt introduces an issue
273        // with sdk_version propagation. Temporarily use the source library
274        // instead.
275        //"libctstiagent",
276    ],
277}
278