blob: 64256a0be1865c00250bff129613d3498ac7f74b [file] [log] [blame]
Patrick Rohr61e83c82023-02-17 15:09:44 -08001# 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]
23
24cronet_origin_files = glob(
25 include = [
26 "base/**",
27 "build/**",
28 "build/buildflag.h",
29 "chrome/VERSION",
30 "components/cronet/**",
31 "components/grpc_suport/**",
32 "components/metrics/**",
33 "components/nacl/**",
34 "components/prefs/**",
35 "crypto/**",
36 "ipc/**",
37 "net/**",
38 "url/**",
39 "LICENSE",
40 ],
41 exclude = common_excludes + [
42 # Per aosp/2367109
43 "build/android/CheckInstallApk-debug.apk",
44 "build/android/unused_resources/**",
45 "build/linux/**",
46
47 # Per aosp/2374766
48 "components/cronet/ios/**",
49 "components/cronet/native/**",
50
51
52 # Exclude all third-party directories. Those are specified explicitly
53 # below, so no dependency can accidentally creep in.
54 "**/third_party/**",
55 ],
56) + glob(
57 # Explicitly include third-party dependencies.
58 # Note: some third-party dependencies include a third_party folder within
59 # them. So far, this has not become a problem.
60 include = [
61 "base/third_party/cityhash/**",
62 "base/third_party/cityhash_v103/**",
63 "base/third_party/double_conversion/**",
64 "base/third_party/dynamic_annotations/**",
65 "base/third_party/icu/**",
66 "base/third_party/nspr/**",
67 "base/third_party/superfasthash/**",
68 # TODO: we should be able to remove this dependency.
69 "base/third_party/symbolize/**",
70 "base/third_party/valgrind/**",
71 "base/third_party/xdg_user_dirs/**",
72 # Not present in source repo; requires gclient sync.
73 "buildtools/third_party/libc++/**",
74 # Not present in source repo; requires gclient sync.
75 "buildtools/third_party/libc++abi/**",
76 "net/third_party/quiche/**",
77 "net/third_party/uri_template/**",
78 "third_party/abseil-cpp/**",
79 "third_party/android_ndk/sources/android/cpufeatures/**",
80 "third_party/ashmem/**",
81 "third_party/boringssl/**",
82 "third_party/brotli/**",
83 # Not present in source repo; requires gclient sync.
84 "third_party/icu/**",
85 "third_party/libevent/**",
86 "third_party/metrics_proto/**",
87 "third_party/modp_b64/**",
88 "third_party/protobuf/**",
89 "third_party/zlib/**",
90 ],
91 exclude = common_excludes,
92)
93
94core.workflow(
95 name = "import_cronet",
96 authoring = authoring.overwrite("Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com>"),
97 origin = git.origin(
98 url = "rpc://chromium/chromium/src",
99 # Source ref is set by the invoking script.
100 ref = "overwritten-by-script",
101 partial_fetch = True,
102 ),
103 origin_files = cronet_origin_files,
104 destination = git.destination(
105 # The destination URL is set by the invoking script.
106 url = "overwritten/by/script",
107 push = "upstream-import",
108 ),
109 mode = "SQUASH",
110)