blob: ec274e6e29d9c6824bd11c690e658dcd6977c7e8 [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/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080032 "components/metrics/**",
33 "components/nacl/**",
34 "components/prefs/**",
35 "crypto/**",
36 "ipc/**",
37 "net/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070038 # Note: Only used for tests.
39 "testing/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080040 "url/**",
41 "LICENSE",
42 ],
43 exclude = common_excludes + [
44 # Per aosp/2367109
45 "build/android/CheckInstallApk-debug.apk",
46 "build/android/unused_resources/**",
47 "build/linux/**",
48
49 # Per aosp/2374766
50 "components/cronet/ios/**",
51 "components/cronet/native/**",
52
Patrick Rohr8902e902023-03-13 13:05:39 -070053 # Per aosp/2399270
54 "testing/buildbot/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080055
56 # Exclude all third-party directories. Those are specified explicitly
57 # below, so no dependency can accidentally creep in.
58 "**/third_party/**",
59 ],
60) + glob(
61 # Explicitly include third-party dependencies.
62 # Note: some third-party dependencies include a third_party folder within
63 # them. So far, this has not become a problem.
64 include = [
65 "base/third_party/cityhash/**",
66 "base/third_party/cityhash_v103/**",
67 "base/third_party/double_conversion/**",
68 "base/third_party/dynamic_annotations/**",
69 "base/third_party/icu/**",
70 "base/third_party/nspr/**",
71 "base/third_party/superfasthash/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080072 "base/third_party/valgrind/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080073 "buildtools/third_party/libc++/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080074 "buildtools/third_party/libc++abi/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070075 # Note: Only used for tests.
76 "net/third_party/nist-pkits/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080077 "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/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070084 # Note: Only used for tests.
85 "third_party/ced/**",
86 # Note: Only used for tests.
87 "third_party/googletest/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080088 "third_party/icu/**",
89 "third_party/libevent/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070090 # Note: Only used for tests.
91 "third_party/libxml/**",
92 # Note: Only used for tests.
93 "third_party/lss/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -080094 "third_party/metrics_proto/**",
95 "third_party/modp_b64/**",
96 "third_party/protobuf/**",
Patrick Rohr8902e902023-03-13 13:05:39 -070097 # Note: Only used for tests.
98 "third_party/quic_trace/**",
Patrick Rohrb781c8f2023-03-21 04:43:53 -070099 # Note: Cronet currently uses Android's zlib
100 # "third_party/zlib/**",
Patrick Rohr3b452fe2023-03-21 03:44:53 -0700101 "url/third_party/mozilla/**",
Patrick Rohr61e83c82023-02-17 15:09:44 -0800102 ],
103 exclude = common_excludes,
104)
105
106core.workflow(
107 name = "import_cronet",
108 authoring = authoring.overwrite("Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com>"),
Patrick Rohrfea38c92023-03-13 12:57:19 -0700109 # Origin folder is specified via source_ref argument, see import_cronet.sh
110 origin = folder.origin(),
Patrick Rohr61e83c82023-02-17 15:09:44 -0800111 origin_files = cronet_origin_files,
112 destination = git.destination(
113 # The destination URL is set by the invoking script.
114 url = "overwritten/by/script",
115 push = "upstream-import",
116 ),
117 mode = "SQUASH",
118)