blob: a4c103cab5ba70602a70b42f30ef5c6e17833b4c [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",
23
24 srcs: [
25 "org.jacoco.core/src/**/*.java",
26 "org.jacoco.agent/src/**/*.java",
27 "org.jacoco.agent.rt/src/**/*.java",
28 ],
29
Colin Crossb760c472017-11-22 13:57:52 -080030 // Some Jacoco source files depend on classes that do not exist in Android.
31 // While these classes are not executed at runtime (because we use offline
32 // instrumentation), they will cause issues when compiling them with ART
33 // during dex pre-opting. Therefore, it would prevent from applying code
34 // coverage on classes in the bootclasspath (frameworks, services, ...) or
35 // system apps.
36 // Note: we still may need to update the source code to cut dependencies in
37 // mandatory jacoco classes.
Colin Cross919bf5c2017-10-06 13:29:25 -070038 exclude_srcs: [
39 "org.jacoco.core/src/org/jacoco/core/runtime/ModifiedSystemClassRuntime.java",
40 "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/PreMain.java",
41 "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/CoverageTransformer.java",
42 "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/JmxRegistration.java",
43 ],
44
Colin Crossb760c472017-11-22 13:57:52 -080045 // In order to include Jacoco in core libraries, we cannot depend on
46 // anything in the bootclasspath (or we would create dependency cycle).
47 // Therefore we compile against the SDK android.jar which gives the same
48 // APIs Jacoco depends on.
Colin Cross919bf5c2017-10-06 13:29:25 -070049 sdk_version: "9",
50
Colin Crossb760c472017-11-22 13:57:52 -080051 // TODO(b/69671801): there's no bytecode on the device, so these shouldn't
52 // be necessary.
53 static_libs: [
54 "asm-6.0",
55 "asm-commons-6.0",
56 "asm-tree-6.0",
57 ],
Colin Cross919bf5c2017-10-06 13:29:25 -070058}
59
60// Build jacoco-cli from sources for the platform
61
62// TODO(jeffrygaston) it'd be nice to keep the build process and/or list of source files in sync with
63// what is defined in the pom.xml files, although it's probably much more trouble than it's worth
64java_library_host {
65 name: "jacoco-cli",
66
67 manifest: "org.jacoco.cli/src/MANIFEST.MF",
68
69 srcs: [
70 "org.jacoco.core/src/**/*.java",
71 "org.jacoco.report/src/**/*.java",
72 "org.jacoco.cli/src/**/*.java",
73 ],
74
75 java_resource_dirs: [
76 "org.jacoco.core/src",
77 "org.jacoco.report/src",
78 ],
79
80 static_libs: [
Colin Crossb760c472017-11-22 13:57:52 -080081 "asm-6.0",
82 "asm-commons-6.0",
83 "asm-tree-6.0",
Colin Cross919bf5c2017-10-06 13:29:25 -070084 "args4j-2.0.28",
85 ],
86}