blob: b1fe832e0374bed52cf2b9bec1a4820ee4466a86 [file] [log] [blame]
Colin Cross72a8c4a2019-05-28 14:03:41 -07001//
2// Copyright (C) 2008 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
17//
18// Define rules to build temp_layoutlib.jar, which contains a subset of
19// the classes in framework.jar. The layoutlib_create tool is used to
20// transform the framework jar into the temp_layoutlib jar.
21//
22
Bob Badour5da52842021-02-12 20:17:07 -080023package {
Bob Badour182a1852022-01-19 15:33:57 -080024 // See: http://go/android-license-faq
25 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badour5da52842021-02-12 20:17:07 -080026}
27
Colin Cross72a8c4a2019-05-28 14:03:41 -070028java_genrule_host {
29 name: "temp_layoutlib",
30 tools: ["layoutlib_create"],
31 out: ["temp_layoutlib.jar"],
32 srcs: [
Cole Faust1f6af682024-10-22 16:30:58 -070033 ":atf-prebuilt-557133692{.jar}", // HOST
34 ":icu4j-icudata-jarjar{.jar}", // HOST
35 ":icu4j-icutzdata-jarjar{.jar}", // HOST
36 ],
37 device_common_srcs: [
Paul Duffind6d63812021-04-21 10:30:35 +010038 ":core-icu4j-for-host{.jar}",
Paul Duffin07ac8442021-04-19 17:26:27 +010039 ":core-libart-for-host{.jar}",
Jerome Gaillard0fe257a2020-01-02 17:50:50 +000040 ":framework-all{.jar}",
Colin Cross72a8c4a2019-05-28 14:03:41 -070041 ":ext{.jar}",
Jerome Gaillard7f24dfc2024-11-12 12:53:18 +000042 ":iconloader_base{.jar}",
Jerome Gaillard6dc349b2022-06-06 18:02:13 +010043 ":monet{.jar}",
Colin Cross72a8c4a2019-05-28 14:03:41 -070044 ],
45 cmd: "rm -f $(out) && $(location layoutlib_create) --create-stub $(out) $(in)",
46}
Jerome Gaillard89531a22019-06-06 12:14:09 +010047
Jerome Gaillardd65eb8f2025-01-13 17:35:03 +000048java_library_host {
49 name: "layoutlib-framework",
50 static_libs: ["temp_layoutlib"],
51 jarjar_rules: "jarjar-rules.txt",
52}
53
Jerome Gaillarda4937002021-09-22 16:00:25 +010054java_device_for_host {
55 name: "layoutlib_create-classpath",
56 libs: [
57 "conscrypt-for-host",
58 "core-icu4j-for-host",
59 "core-libart-for-host",
60 "ext",
61 "framework-all",
Jerome Gaillard7f24dfc2024-11-12 12:53:18 +000062 "iconloader_base",
Jerome Gaillarda4937002021-09-22 16:00:25 +010063 "icu4j-icudata-jarjar",
64 "icu4j-icutzdata-jarjar",
Jerome Gaillard6dc349b2022-06-06 18:02:13 +010065 "monet",
Jerome Gaillarda4937002021-09-22 16:00:25 +010066 ],
67}
Jerome Gaillardbb167ce2024-07-23 20:19:33 +010068
69cc_library_host_shared {
70 name: "layoutlib_jni",
71 srcs: [
Jerome Gaillardbb167ce2024-07-23 20:19:33 +010072 "jni/LayoutlibLoader.cpp",
73 ],
74 cflags: [
75 "-Wno-unused-parameter",
76 ],
77 header_libs: [
Jerome Gaillardbed57832024-10-31 18:03:42 +000078 "libbase_headers",
Jerome Gaillardbb167ce2024-07-23 20:19:33 +010079 ],
80 shared_libs: [
81 "libandroid_runtime",
82 ],
83 static_libs: [
Jerome Gaillard72fe76f2024-12-13 18:21:54 +000084 "libbase",
85 "libbinder",
86 "libcutils",
Jerome Gaillardbb167ce2024-07-23 20:19:33 +010087 "libinput",
Jerome Gaillard72fe76f2024-12-13 18:21:54 +000088 "libui-types",
89 "libutils",
Jerome Gaillardbb167ce2024-07-23 20:19:33 +010090 ],
Jerome Gaillarde03ebfc2024-08-01 15:03:59 +010091 stl: "libc++_static",
Jerome Gaillardbed57832024-10-31 18:03:42 +000092 target: {
Jerome Gaillardf1537172024-12-03 19:30:56 +000093 linux: {
94 version_script: "jni/linux/layoutlib_jni_export.txt",
95 },
96 darwin: {
Jerome Gaillardd840bf12024-12-12 16:58:04 +000097 exported_symbols_list: "jni/darwin/layoutlib_jni_export.exp",
Jerome Gaillardf1537172024-12-03 19:30:56 +000098 dist: {
99 targets: ["layoutlib_jni"],
100 dir: "layoutlib_native/darwin",
101 },
102 },
Jerome Gaillardbed57832024-10-31 18:03:42 +0000103 linux_glibc_x86_64: {
104 dist: {
105 targets: ["layoutlib"],
106 dir: "layoutlib_native/linux",
107 tag: "stripped_all",
108 },
109 },
110 },
Jerome Gaillardbb167ce2024-07-23 20:19:33 +0100111}