xref: /aosp_15_r20/external/apache-xml/Android.bp (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1//
2// Copyright (C) 2011 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
17package {
18    default_visibility: ["//visibility:private"],
19    default_applicable_licenses: ["external_apache-xml_license"],
20}
21
22// Added automatically by a large-scale-change that took the approach of
23// 'apply every license found to every target'. While this makes sure we respect
24// every license restriction, it may not be entirely correct.
25//
26// e.g. GPL in an MIT project might only apply to the contrib/ directory.
27//
28// Please consider splitting the single license below into multiple licenses,
29// taking care not to lose any license_kind information, and overriding the
30// default license using the 'licenses: [...]' property on targets as needed.
31//
32// For unused files, consider creating a 'fileGroup' with "//visibility:private"
33// to attach the license to, and including a comment whether the files may be
34// used in the current project.
35// See: http://go/android-license-faq
36license {
37    name: "external_apache-xml_license",
38    visibility: [":__subpackages__"],
39    license_kinds: [
40        "SPDX-license-identifier-Apache-2.0",
41        "SPDX-license-identifier-W3C",
42    ],
43    license_text: [
44        "NOTICE",
45    ],
46}
47
48// The set of files that contribute to APIs.
49// Generally, apache-xml source files are not marked with @hide so we add them
50// one-by-one after having done so.
51filegroup {
52    name: "apache-xml_api_files",
53    visibility: ["//libcore"],
54    srcs: [],
55}
56
57java_library {
58    name: "apache-xml",
59    visibility: [
60        "//art/build/apex",
61        "//art/build/sdk",
62        "//art/tools/ahat",
63        "//art/tools/fuzzer",
64        "//libcore",
65        "//packages/modules/ArtPrebuilt",
66    ],
67    apex_available: [
68        "com.android.art",
69        "com.android.art.debug",
70    ],
71    srcs: ["src/main/java/**/*.java"],
72    java_resource_dirs: ["src/main/java"],
73
74    installable: true,
75    hostdex: true,
76    errorprone: {
77        javacflags: [
78            "-Xep:MissingOverride:OFF",
79            "-Xep:LockOnBoxedPrimitive:WARN",
80        ],
81    },
82    lint: {
83        warning_checks: ["SuspiciousIndentation"],
84    },
85
86    sdk_version: "none",
87    system_modules: "core-all-system-modules",
88    min_sdk_version: "31",
89}
90
91java_library_static {
92    name: "apache-xml-tests",
93    visibility: [
94        "//libcore",
95        "//packages/modules/ArtPrebuilt",
96    ],
97    srcs: [
98        "test/android_src/**/*.java",
99        "test/java/src/**/*.java",
100        "test/tests/bugzilla/**/*.java",
101        "test/tests/extensions/java/**/*.java",
102        // org.apache.xalan.trace package in xalan-java has to be imported because
103        // the test version is 2.7.3 while the implementation version is 2_7_1.
104        "test/trace-src/org/apache/xalan/trace/**/*.java",
105    ],
106    exclude_srcs: [
107        // The following java files fail to build.
108        "test/java/src/org/apache/qetest/xsl/XSLApiTestsResultTask.java",
109        "test/java/src/org/apache/qetest/xsl/XSLTestAntTask.java",
110        "test/java/src/org/apache/qetest/xsl/XsltcTestsTask.java",
111        "test/java/src/org/apache/qetest/xslwrapper/XTWrapper.java",
112        "test/java/src/org/apache/qetest/xslwrapper/XsltcMainWrapper.java",
113        "test/tests/bugzilla/Bugzilla1110.java",
114        "test/tests/bugzilla/Bugzilla1288.java",
115        "test/tests/bugzilla/Bugzilla6181.java",
116        "test/tests/extensions/java/javaElem01.java",
117        "test/tests/extensions/java/javaSample4.java",
118        "test/java/src/org/apache/qetest/xalanj2/TraceListenerTest.java",
119        "test/java/src/org/apache/qetest/xslwrapper/XalanProcessWrapper.java",
120        "test/tests/bugzilla/BugzillaNodeInfo.java",
121    ],
122    java_resource_dirs: [
123        "test/tests",
124        "test/java/xdocs",
125    ],
126    // soong_zip doesn't accept this file, likely due to unescaped space characters.
127    exclude_java_resources: ["test/tests/conf-gold/output/Test 31 Gif.gif"],
128
129    errorprone: {
130        javacflags: [
131            "-Xep:MissingOverride:OFF",
132            "-Xep:LockOnBoxedPrimitive:WARN",
133        ],
134    },
135    static_libs: [
136        "apache-xml-jtidy-prebuilt",
137    ],
138    libs: [
139        "apache-xml",
140        "junit",
141        "platform-test-annotations",
142    ],
143    sdk_version: "none",
144    system_modules: "core-all-system-modules",
145}
146
147java_import {
148    name: "apache-xml-jtidy-prebuilt",
149    jars: ["test/tools/jtidy-1.0.3.jar"],
150}
151