Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 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 | |
| 15 | common_excludes = [ |
| 16 | # Exclude all Android build files |
| 17 | "**/Android.bp", |
| 18 | "**/Android.mk", |
| 19 | |
Patrick Rohr | d575760 | 2023-02-21 11:41:53 -0800 | [diff] [blame] | 20 | # Exclude existing *OWNERS files |
| 21 | "**/*OWNERS", |
Patrick Rohr | fea38c9 | 2023-03-13 12:57:19 -0700 | [diff] [blame] | 22 | "**/.git/**", |
Patrick Rohr | 2bbe771 | 2023-03-21 10:39:17 -0700 | [diff] [blame] | 23 | "**/.gitignore", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 24 | ] |
| 25 | |
| 26 | cronet_origin_files = glob( |
| 27 | include = [ |
| 28 | "base/**", |
| 29 | "build/**", |
| 30 | "build/buildflag.h", |
| 31 | "chrome/VERSION", |
| 32 | "components/cronet/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 33 | "components/metrics/**", |
| 34 | "components/nacl/**", |
| 35 | "components/prefs/**", |
| 36 | "crypto/**", |
| 37 | "ipc/**", |
| 38 | "net/**", |
Patrick Rohr | 8902e90 | 2023-03-13 13:05:39 -0700 | [diff] [blame] | 39 | # Note: Only used for tests. |
| 40 | "testing/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 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 | |
Patrick Rohr | 8902e90 | 2023-03-13 13:05:39 -0700 | [diff] [blame] | 54 | # Per aosp/2399270 |
| 55 | "testing/buildbot/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 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/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 73 | "base/third_party/valgrind/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 74 | "buildtools/third_party/libc++/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 75 | "buildtools/third_party/libc++abi/**", |
Patrick Rohr | 8902e90 | 2023-03-13 13:05:39 -0700 | [diff] [blame] | 76 | # Note: Only used for tests. |
| 77 | "net/third_party/nist-pkits/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 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/**", |
Patrick Rohr | 8902e90 | 2023-03-13 13:05:39 -0700 | [diff] [blame] | 85 | # Note: Only used for tests. |
| 86 | "third_party/ced/**", |
| 87 | # Note: Only used for tests. |
| 88 | "third_party/googletest/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 89 | "third_party/icu/**", |
| 90 | "third_party/libevent/**", |
Patrick Rohr | 8902e90 | 2023-03-13 13:05:39 -0700 | [diff] [blame] | 91 | # Note: Only used for tests. |
| 92 | "third_party/libxml/**", |
| 93 | # Note: Only used for tests. |
| 94 | "third_party/lss/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 95 | "third_party/metrics_proto/**", |
| 96 | "third_party/modp_b64/**", |
| 97 | "third_party/protobuf/**", |
Patrick Rohr | 8902e90 | 2023-03-13 13:05:39 -0700 | [diff] [blame] | 98 | # Note: Only used for tests. |
| 99 | "third_party/quic_trace/**", |
Patrick Rohr | b781c8f | 2023-03-21 04:43:53 -0700 | [diff] [blame] | 100 | # Note: Cronet currently uses Android's zlib |
| 101 | # "third_party/zlib/**", |
Patrick Rohr | 3b452fe | 2023-03-21 03:44:53 -0700 | [diff] [blame] | 102 | "url/third_party/mozilla/**", |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 103 | ], |
| 104 | exclude = common_excludes, |
| 105 | ) |
| 106 | |
| 107 | core.workflow( |
| 108 | name = "import_cronet", |
| 109 | authoring = authoring.overwrite("Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com>"), |
Patrick Rohr | fea38c9 | 2023-03-13 12:57:19 -0700 | [diff] [blame] | 110 | # Origin folder is specified via source_ref argument, see import_cronet.sh |
| 111 | origin = folder.origin(), |
Patrick Rohr | 61e83c8 | 2023-02-17 15:09:44 -0800 | [diff] [blame] | 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 | ) |