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