blob: 3b65442ea45309b75c27bbc9f64fa3e70ff6d1c8 [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"],
93
94 srcs: [":openjdk_java_files"],
95 java_resource_dirs: core_resource_dirs,
96 libs: ["core-all"],
97
98 notice: "ojluni/NOTICE",
99
100 required: [
101 "tzdata",
102 "tzlookup.xml",
103 ],
104}
105
106// Definitions to make the core library.
107java_library {
108 name: "core-libart",
109 defaults: ["libcore_java_defaults"],
110
111 srcs: [
112 ":non_openjdk_java_files",
113 ":android_icu4j_src_files",
114 ],
115 static_libs: ["android_icu4j_res"],
116
117 libs: ["core-all"],
118
119 required: [
120 "tzdata",
121 "tzlookup.xml",
122 ],
123}
124
125// A library that exists to satisfy javac when
126// compiling source code that contains lambdas.
127java_library {
128 name: "core-lambda-stubs",
129 defaults: ["libcore_java_defaults"],
130
131 srcs: [
132 ":openjdk_lambda_stub_files",
133 ":openjdk_lambda_duplicate_stub_files",
134 ],
135
136 libs: ["core-all"],
137
138 notice: "ojluni/NOTICE",
139
140 installable: false,
141 include_srcs: true,
142}