• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2023 Google Inc. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15common_excludes = [
16    # Exclude all Android build files
17    "**/Android.bp",
18    "**/Android.mk",
19
20    # Exclude existing *OWNERS files
21    "**/*OWNERS",
22    "**/.git/**",
23    "**/.gitignore",
24]
25
26cronet_origin_files = glob(
27    include = [
28        "base/**",
29        "build/**",
30        "build/buildflag.h",
31        "chrome/VERSION",
32        "components/cronet/**",
33        "components/metrics/**",
34        "components/nacl/**",
35        "components/prefs/**",
36        "crypto/**",
37        "ipc/**",
38        "net/**",
39        # Note: Only used for tests.
40        "testing/**",
41        "url/**",
42        "LICENSE",
43    ],
44    exclude = common_excludes + [
45        # Per aosp/2367109
46        "build/android/CheckInstallApk-debug.apk",
47        "build/android/unused_resources/**",
48        "build/linux/**",
49
50        # Per aosp/2374766
51        "components/cronet/ios/**",
52        "components/cronet/native/**",
53
54        # Per aosp/2399270
55        "testing/buildbot/**",
56
57        # Exclude all third-party directories. Those are specified explicitly
58        # below, so no dependency can accidentally creep in.
59        "**/third_party/**",
60    ],
61) + glob(
62    # Explicitly include third-party dependencies.
63    # Note: some third-party dependencies include a third_party folder within
64    # them. So far, this has not become a problem.
65    include = [
66        "base/third_party/cityhash/**",
67        "base/third_party/cityhash_v103/**",
68        "base/third_party/double_conversion/**",
69        "base/third_party/dynamic_annotations/**",
70        "base/third_party/icu/**",
71        "base/third_party/nspr/**",
72        "base/third_party/superfasthash/**",
73        "base/third_party/valgrind/**",
74        "buildtools/third_party/libc++/**",
75        "buildtools/third_party/libc++abi/**",
76        # Note: Only used for tests.
77        "net/third_party/nist-pkits/**",
78        "net/third_party/quiche/**",
79        "net/third_party/uri_template/**",
80        "third_party/abseil-cpp/**",
81        "third_party/android_ndk/sources/android/cpufeatures/**",
82        "third_party/ashmem/**",
83        "third_party/boringssl/**",
84        "third_party/brotli/**",
85        # Note: Only used for tests.
86        "third_party/ced/**",
87        # Note: Only used for tests.
88        "third_party/googletest/**",
89        "third_party/icu/**",
90        "third_party/libevent/**",
91        # Note: Only used for tests.
92        "third_party/libxml/**",
93        # Note: Only used for tests.
94        "third_party/lss/**",
95        "third_party/metrics_proto/**",
96        "third_party/modp_b64/**",
97        "third_party/protobuf/**",
98        # Note: Only used for tests.
99        "third_party/quic_trace/**",
100        # Note: Cronet currently uses Android's zlib
101        # "third_party/zlib/**",
102        "url/third_party/mozilla/**",
103    ],
104    exclude = common_excludes,
105)
106
107core.workflow(
108    name = "import_cronet",
109    authoring = authoring.overwrite("Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com>"),
110    # Origin folder is specified via source_ref argument, see import_cronet.sh
111    origin = folder.origin(),
112    origin_files = cronet_origin_files,
113    destination = git.destination(
114        # The destination URL is set by the invoking script.
115        url = "overwritten/by/script",
116        push = "upstream-import",
117    ),
118    mode = "SQUASH",
119)
120