• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2019 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    default_team: "trendy_team_updatable_sdk_apis",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_defaults {
21    name: "derive_classpath-defaults",
22    host_supported: true,
23    min_sdk_version: "30",
24    // static c++/libbase for smaller size
25    stl: "c++_static",
26    shared_libs: select(os(), {
27        "android": [
28            "liblog",
29        ],
30        default: [],
31    }),
32    static_libs: [
33        "libbase",
34        "libclasspaths_proto",
35        "libprotobuf-cpp-lite",
36    ] + select(os(), {
37        "android": [
38            "libmodules-utils-build",
39        ],
40        default: [
41            "liblog",
42        ],
43    }),
44    cflags: select(os(), {
45        "android": ["-DSDKEXT_ANDROID"],
46        default: [],
47    }),
48}
49
50cc_library {
51    name: "libderive_classpath",
52    srcs: ["derive_classpath.cpp"],
53    defaults: ["derive_classpath-defaults"],
54    apex_available: ["com.android.sdkext"],
55}
56
57cc_defaults {
58    name: "derive_classpath_binary-defaults",
59    defaults: ["derive_classpath-defaults"],
60    srcs: ["main.cpp"],
61    static_libs: ["libderive_classpath"],
62}
63
64cc_binary {
65    name: "derive_classpath",
66    defaults: ["derive_classpath_binary-defaults"],
67    apex_available: ["com.android.sdkext"],
68}
69
70// Work around testing using a 64-bit test suite on 32-bit test device by
71// using a prefer32 version of derive_sdk in testing.
72cc_binary {
73    name: "derive_classpath_prefer32",
74    defaults: ["derive_classpath_binary-defaults"],
75    compile_multilib: "prefer32",
76    stem: "derive_classpath",
77    apex_available: ["test_com.android.sdkext"],
78    installable: false,
79}
80
81cc_test {
82    name: "derive_classpath_test",
83    defaults: ["derive_classpath-defaults"],
84    srcs: ["derive_classpath_test.cpp"],
85    require_root: true,
86    static_libs: ["libderive_classpath"],
87    test_suites: ["device-tests"],
88}
89
90prebuilt_etc {
91    name: "derive_classpath.rc",
92    src: "derive_classpath.rc",
93    installable: false,
94}
95