-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
92 lines (88 loc) · 3.29 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
load("//tools/base/bazel:bazel.bzl", "iml_module")
load("//tools/base/bazel:kotlin.bzl", "kotlin_library", "kotlin_test")
load("//tools/base/bazel:proto.bzl", "java_proto_library")
# managed by go/iml_to_build
iml_module(
name = "studio.android.sdktools.adblib",
srcs = ["src"],
iml_files = ["android.sdktools.adblib.iml"],
lint_baseline = "lint_baseline.xml",
test_srcs = ["test/src"],
visibility = ["//visibility:public"],
# do not sort: must match IML order
deps = [
"@intellij//:intellij-sdk",
"@intellij//:com.intellij.java",
"//tools/adt/idea/.idea/libraries:kotlin-test[test]",
"//tools/base/fakeadbserver:studio.android.sdktools.fakeadbserver[module, test]",
"//tools/adt/idea/.idea/libraries:libadb-server-proto",
],
)
# Build adblib as a standalone library, with side effect of ensuring that adblib does not
# use unwanted dependencies from "studio-sdk" in the iml_module rule above
# Build with: bazel build //tools/base/adblib:adblib
kotlin_library(
name = "adblib",
srcs = glob([
"src/**/*.kt",
]),
lint_baseline = "lint_baseline_adblib.xml",
resource_strip_prefix = "tools/base/adblib",
visibility = [
"//tools/base/adb-proxy:__subpackages__",
"//tools/base/adblib-ddmlibcompatibility:__subpackages__",
"//tools/base/adblib-tools:__subpackages__",
"//tools/base/deploy/deployer:__subpackages__",
"//tools/vendor/google/directaccess-client:__subpackages__",
],
deps = [
"@maven//:org.jetbrains.kotlin.kotlin-stdlib-jdk8",
"@maven//:org.jetbrains.kotlinx.kotlinx-coroutines-core",
# Required to build the java file generated by ":app-processes-proto" rule
"@maven//:com.google.protobuf.protobuf-java",
# See rule at end of this file
":adb-server-proto",
],
)
# Test adblib as a standalone library, with side effect of ensuring that adblib does not
# use unwanted dependencies from "studio-sdk" in the iml_module rule above
# Run tests with: bazel test //tools/base/adblib:adblib.tests.test
kotlin_test(
name = "adblib.tests",
# buildifier: disable=bad-recursive-glob
srcs = glob([
"test/src/**/*.kt",
"test/src/**/*.java",
]),
# So that we can use adblib "internal" classes/functions from Unit Tests
friends = [":adblib"],
jvm_flags = ["-Dtest.suite.jar=adblib.tests.jar"],
lint_baseline = "lint_baseline_tests.xml",
test_class = "com.android.testutils.JarTestSuite",
visibility = [
"//tools/base/adblib-ddmlibcompatibility:__subpackages__",
"//tools/base/adblib-tools:__subpackages__",
],
deps = [
":adblib",
# For "JarTestSuite"
"//tools/base/testutils:tools.testutils",
# For JUnit4 support
"@maven//:junit.junit",
# FakeAdbServer
"//tools/base/fakeadbserver:tools.fakeadbserver",
],
)
#
# Rule to compile 'proto/app_processes.proto' for the stand-alone "kotlin_library" version
# of adblib. This compiles the proto into the "com.android.server.adb.protos" package.
#
java_proto_library(
# buildifier: disable=java_proto_library-naming
name = "adb-server-proto",
srcs = [
"proto/app_processes.proto",
"proto/devices.proto",
],
visibility = ["//visibility:public"],
)