blob: e220dcbed645f8d73dc8bfe19ea73321ef4aa545 [file] [log] [blame]
Colin Cross919bf5c2017-10-06 13:29:25 -07001//
2// Copyright (C) 2016 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
Colin Cross919bf5c2017-10-06 13:29:25 -070017// Build jacoco-agent from sources for the platform
18//
19// Note: this is only intended to be used for the platform development. This is *not* intended
20// to be used in the SDK where apps can use the official jacoco release.
Colin Crossf4e43e62017-10-09 12:39:29 -070021java_library {
Colin Cross919bf5c2017-10-06 13:29:25 -070022 name: "jacocoagent",
Colin Cross730cc262018-07-12 10:38:52 -070023 installable: true,
Colin Cross919bf5c2017-10-06 13:29:25 -070024
25 srcs: [
26 "org.jacoco.core/src/**/*.java",
27 "org.jacoco.agent/src/**/*.java",
28 "org.jacoco.agent.rt/src/**/*.java",
29 ],
30
Colin Crossb760c472017-11-22 13:57:52 -080031 // Some Jacoco source files depend on classes that do not exist in Android.
32 // While these classes are not executed at runtime (because we use offline
33 // instrumentation), they will cause issues when compiling them with ART
34 // during dex pre-opting. Therefore, it would prevent from applying code
35 // coverage on classes in the bootclasspath (frameworks, services, ...) or
36 // system apps.
37 // Note: we still may need to update the source code to cut dependencies in
38 // mandatory jacoco classes.
Colin Cross919bf5c2017-10-06 13:29:25 -070039 exclude_srcs: [
40 "org.jacoco.core/src/org/jacoco/core/runtime/ModifiedSystemClassRuntime.java",
41 "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/PreMain.java",
42 "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/CoverageTransformer.java",
43 "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/JmxRegistration.java",
44 ],
45
Colin Crossb760c472017-11-22 13:57:52 -080046 // In order to include Jacoco in core libraries, we cannot depend on
47 // anything in the bootclasspath (or we would create dependency cycle).
48 // Therefore we compile against the SDK android.jar which gives the same
49 // APIs Jacoco depends on.
Colin Cross919bf5c2017-10-06 13:29:25 -070050 sdk_version: "9",
51
Colin Crossb760c472017-11-22 13:57:52 -080052 // TODO(b/69671801): there's no bytecode on the device, so these shouldn't
53 // be necessary.
54 static_libs: [
55 "asm-6.0",
56 "asm-commons-6.0",
57 "asm-tree-6.0",
58 ],
Colin Cross919bf5c2017-10-06 13:29:25 -070059}
60
61// Build jacoco-cli from sources for the platform
62
63// TODO(jeffrygaston) it'd be nice to keep the build process and/or list of source files in sync with
64// what is defined in the pom.xml files, although it's probably much more trouble than it's worth
65java_library_host {
66 name: "jacoco-cli",
67
68 manifest: "org.jacoco.cli/src/MANIFEST.MF",
69
70 srcs: [
71 "org.jacoco.core/src/**/*.java",
72 "org.jacoco.report/src/**/*.java",
73 "org.jacoco.cli/src/**/*.java",
74 ],
75
76 java_resource_dirs: [
77 "org.jacoco.core/src",
78 "org.jacoco.report/src",
79 ],
80
81 static_libs: [
Colin Crossb760c472017-11-22 13:57:52 -080082 "asm-6.0",
83 "asm-commons-6.0",
84 "asm-tree-6.0",
Colin Cross919bf5c2017-10-06 13:29:25 -070085 "args4j-2.0.28",
86 ],
87}