summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/config/android/test/proto/BUILD.gn
blob: a28111a66a86921a12f563e3791506a1cbdf6b67 (plain)
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
93
94
95
96
97
98
99
100
101
102
103
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/android/rules.gni")
import("//third_party/protobuf/proto_library.gni")

# The purpose of these targets is test that |deps| satisfies java compilation
# dependencies, and that |import_dirs| allows us to deal with various relative
# imports to other proto dependencies. Although we should strive to avoid using
# |import_dirs| and relative import paths, preferring to use absolute imports
# whenever possible. See https://crbug.com/691451. While this target is
# primarily to test that the Java proto targets build correctly, also build the
# C++ versions of the protos as well. There are currently some configurations of
# Java protos that can be built but will not work for C++, see
# https://crbug.com/1039014, so make sure we don't create any tests that would
# violate that.
group("test_build_protos") {
  deps = [
    ":absolute_root_proto",
    ":absolute_root_proto_java",
    ":relative_root_proto",
    ":relative_root_proto_java",
  ]
}

proto_java_library("absolute_root_proto_java") {
  proto_path = "//"
  import_dirs = [ "relative_dep/" ]
  sources = [
    "root/absolute_child.proto",
    "root/absolute_root.proto",
  ]
  deps = [
    ":absolute_dep_proto_java",
    ":relative_dep_proto_java",
  ]
}

proto_java_library("relative_root_proto_java") {
  proto_path = "root/"
  import_dirs = [
    "relative_dep/",
    "//",
  ]
  sources = [
    "root/relative_child.proto",
    "root/relative_root.proto",
  ]
  deps = [
    ":absolute_dep_proto_java",
    ":relative_dep_proto_java",
  ]
}

proto_java_library("absolute_dep_proto_java") {
  proto_path = "//"
  sources = [ "absolute_dep/absolute_dep.proto" ]
}

proto_java_library("relative_dep_proto_java") {
  proto_path = "relative_dep/"
  sources = [ "relative_dep/relative_dep.proto" ]
}

proto_library("absolute_root_proto") {
  proto_in_dir = "//"
  import_dirs = [ "relative_dep/" ]
  sources = [
    "root/absolute_child.proto",
    "root/absolute_root.proto",
  ]
  link_deps = [
    ":absolute_dep_proto",
    ":relative_dep_proto",
  ]
}

proto_library("relative_root_proto") {
  proto_in_dir = "root/"
  import_dirs = [
    "relative_dep/",
    "//",
  ]
  sources = [
    "root/relative_child.proto",
    "root/relative_root.proto",
  ]
  link_deps = [
    ":absolute_dep_proto",
    ":relative_dep_proto",
  ]
}

proto_library("absolute_dep_proto") {
  proto_in_dir = "//"
  sources = [ "absolute_dep/absolute_dep.proto" ]
}

proto_library("relative_dep_proto") {
  proto_in_dir = "relative_dep/"
  sources = [ "relative_dep/relative_dep.proto" ]
}