blob: c066fc0ae26a17cde083333d88f257a283cce3ed [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/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070039 # Note: Only used for tests.
40 "testing/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080041 "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
Patrick Rohr8902e902023-03-13 13:05:39 -070054 # Per aosp/2399270
55 "testing/buildbot/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080056
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 # TODO: we should be able to remove this dependency.
74 "base/third_party/symbolize/**",
75 "base/third_party/valgrind/**",
76 "base/third_party/xdg_user_dirs/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080077 "buildtools/third_party/libc++/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080078 "buildtools/third_party/libc++abi/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070079 # Note: Only used for tests.
80 "net/third_party/nist-pkits/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080081 "net/third_party/quiche/**",
82 "net/third_party/uri_template/**",
83 "third_party/abseil-cpp/**",
84 "third_party/android_ndk/sources/android/cpufeatures/**",
85 "third_party/ashmem/**",
86 "third_party/boringssl/**",
87 "third_party/brotli/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070088 # Note: Only used for tests.
89 "third_party/ced/**",
90 # Note: Only used for tests.
91 "third_party/googletest/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080092 "third_party/icu/**",
93 "third_party/libevent/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070094 # Note: Only used for tests.
95 "third_party/libxml/**",
96 # Note: Only used for tests.
97 "third_party/lss/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080098 "third_party/metrics_proto/**",
99 "third_party/modp_b64/**",
100 "third_party/protobuf/**",
Patrick Rohr8902e902023-03-13 13:05:39 -0700101 # Note: Only used for tests.
102 "third_party/quic_trace/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -0800103 "third_party/zlib/**",
104 ],
105 exclude = common_excludes,
106)
107
108core.workflow(
109 name = "import_cronet",
110 authoring = authoring.overwrite("Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com>"),
Patrick Rohrfea38c92023-03-13 12:57:19 -0700111 # Origin folder is specified via source_ref argument, see import_cronet.sh
112 origin = folder.origin(),
Patrick Rohr61e83c82023-02-17 15:09:44 -0800113 origin_files = cronet_origin_files,
114 destination = git.destination(
115 # The destination URL is set by the invoking script.
116 url = "overwritten/by/script",
117 push = "upstream-import",
118 ),
119 mode = "SQUASH",
120)