blob: 98fe24c62f1c42d7b36cdb09df65e43b1ee6d4fa [file] [log] [blame]
Colin Crossaf0b54c2017-09-27 17:22:32 -07001// Copyright (C) 2007 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
15//
16// Definitions for building the Java library and associated tests.
17//
18
19// libcore is divided into modules.
20//
21// The structure of each module is:
22//
23// src/
24// main/ # To be shipped on every device.
25// java/ # Java source for library code.
26// native/ # C++ source for library code.
27// resources/ # Support files.
28// test/ # Built only on demand, for testing.
29// java/ # Java source for tests.
30// native/ # C++ source for tests (rare).
31// resources/ # Support files.
32//
33// All subdirectories are optional
34
35build = [
36 "openjdk_java_files.bp",
37 "non_openjdk_java_files.bp",
38]
39
40// The Java files and their associated resources.
41core_resource_dirs = [
42 "luni/src/main/java",
43 "ojluni/src/main/resources/",
44]
45
46java_defaults {
47 name: "libcore_java_defaults",
48 javacflags: [
49 //"-Xlint:all",
50 //"-Xlint:-serial,-deprecation,-unchecked",
51 ],
52 dxflags: ["--core-library"],
53 no_standard_libs: true,
54
55 // For user / userdebug builds, strip the local variable table and the local variable
56 // type table. This has no bearing on stack traces, but will leave less information
57 // available via JDWP.
58 //
59 // TODO: Should this be conditioned on a PRODUCT_ flag or should we just turn this
60 // on for all builds. Also, name of the flag TBD.
61 // TODO(ccross): PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
62 // local_javac_flags += ["-g:source,lines"]
63}
64
65//
66// Build for the target (device).
67//
68
69java_library {
70 name: "core-all",
71 defaults: ["libcore_java_defaults"],
72
73 srcs: [
74 ":openjdk_java_files",
75 ":non_openjdk_java_files",
76 ":android_icu4j_src_files",
77 ":openjdk_lambda_stub_files",
78 ],
79 java_resource_dirs: core_resource_dirs,
80 static_libs: ["android_icu4j_res"],
81
82 required: [
83 "tzdata",
84 "tzlookup.xml",
85 ],
86
87 installable: false,
88}
89
90java_library {
91 name: "core-oj",
92 defaults: ["libcore_java_defaults"],
Colin Crossbb180be2017-10-09 14:54:53 -070093 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -070094
95 srcs: [":openjdk_java_files"],
96 java_resource_dirs: core_resource_dirs,
97 libs: ["core-all"],
98
99 notice: "ojluni/NOTICE",
100
101 required: [
102 "tzdata",
103 "tzlookup.xml",
104 ],
Colin Crossbb180be2017-10-09 14:54:53 -0700105
Colin Crossaf0b54c2017-09-27 17:22:32 -0700106}
107
108// Definitions to make the core library.
109java_library {
110 name: "core-libart",
111 defaults: ["libcore_java_defaults"],
Colin Crossbb180be2017-10-09 14:54:53 -0700112 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700113
114 srcs: [
115 ":non_openjdk_java_files",
116 ":android_icu4j_src_files",
117 ],
118 static_libs: ["android_icu4j_res"],
119
120 libs: ["core-all"],
121
122 required: [
123 "tzdata",
124 "tzlookup.xml",
125 ],
126}
127
128// A library that exists to satisfy javac when
129// compiling source code that contains lambdas.
130java_library {
131 name: "core-lambda-stubs",
132 defaults: ["libcore_java_defaults"],
133
134 srcs: [
135 ":openjdk_lambda_stub_files",
136 ":openjdk_lambda_duplicate_stub_files",
137 ],
138
139 libs: ["core-all"],
140
141 notice: "ojluni/NOTICE",
142
143 installable: false,
144 include_srcs: true,
145}