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 15common_excludes = [ 16 # Exclude all Android build files 17 "**/Android.bp", 18 "**/Android.mk", 19 20 # Exclude existing *OWNERS files 21 "**/*OWNERS", 22 "**/.git/**", 23 "**/.gitignore", 24] 25 26cronet_origin_files = glob( 27 include = [ 28 "base/**", 29 "build/**", 30 "build/buildflag.h", 31 "chrome/VERSION", 32 "components/cronet/**", 33 "components/metrics/**", 34 # See https://chromium-review.googlesource.com/c/chromium/src/+/4896104 35 "components/miracle_parameter/**", 36 "components/nacl/**", 37 "components/prefs/**", 38 "crypto/**", 39 "ipc/**", 40 "net/**", 41 # Note: Only used for tests. 42 "testing/**", 43 "url/**", 44 "LICENSE", 45 ], 46 exclude = common_excludes + [ 47 # Per aosp/2367109 48 "build/android/CheckInstallApk-debug.apk", 49 "build/android/unused_resources/**", 50 "build/linux/**", 51 52 # Per aosp/2374766 53 "components/cronet/ios/**", 54 "components/cronet/native/**", 55 56 # Per aosp/2399270 57 "testing/buildbot/**", 58 59 # Exclude all third-party directories. Those are specified explicitly 60 # below, so no dependency can accidentally creep in. 61 "**/third_party/**", 62 ], 63) + glob( 64 # Explicitly include third-party dependencies. 65 # Note: some third-party dependencies include a third_party folder within 66 # them. So far, this has not become a problem. 67 include = [ 68 "base/third_party/cityhash/**", 69 "base/third_party/cityhash_v103/**", 70 "base/third_party/double_conversion/**", 71 "base/third_party/dynamic_annotations/**", 72 "base/third_party/icu/**", 73 "base/third_party/nspr/**", 74 "base/third_party/superfasthash/**", 75 "base/third_party/valgrind/**", 76 # Those are temporarily needed until Chromium finish the migration 77 # of libc++[abi] 78 "buildtools/third_party/libc++/**", 79 "buildtools/third_party/libc++abi/**", 80 # Note: Only used for tests. 81 "net/third_party/nist-pkits/**", 82 "net/third_party/quiche/**", 83 "net/third_party/uri_template/**", 84 "third_party/abseil-cpp/**", 85 "third_party/android_ndk/sources/android/cpufeatures/**", 86 # See https://chromium-review.googlesource.com/c/chromium/src/+/4885470 87 # Note: Only used for tests. 88 "third_party/anonymous_tokens/**", 89 "third_party/ashmem/**", 90 # Note: Only used for tests. 91 "third_party/apache-portable-runtime/**", 92 "third_party/boringssl/**", 93 "third_party/brotli/**", 94 # Note: Only used for tests. 95 "third_party/ced/**", 96 "third_party/cpu_features/**", 97 # Note: Only used for tests. 98 "third_party/google_benchmark/**", 99 # Note: Only used for tests. 100 "third_party/googletest/**", 101 "third_party/icu/**", 102 "third_party/jni_zero/**", 103 "third_party/libc++/**", 104 "third_party/libc++abi/**", 105 "third_party/libevent/**", 106 # Note: Only used for tests. 107 "third_party/libxml/**", 108 # Note: Only used for tests. 109 "third_party/lss/**", 110 "third_party/metrics_proto/**", 111 "third_party/modp_b64/**", 112 # Note: Only used for tests. 113 "third_party/netty4/**", 114 # Note: Only used for tests. 115 "third_party/netty-tcnative/**", 116 "third_party/protobuf/**", 117 # Note: Only used for tests. 118 "third_party/quic_trace/**", 119 # Note: Only used for tests. 120 "third_party/re2/**", 121 # Note: Cronet currently uses Android's zlib 122 # "third_party/zlib/**", 123 "url/third_party/mozilla/**", 124 ], 125 exclude = common_excludes, 126) 127 128core.workflow( 129 name = "import_cronet", 130 authoring = authoring.overwrite("Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com>"), 131 # Origin folder is specified via source_ref argument, see import_cronet.sh 132 origin = folder.origin(), 133 origin_files = cronet_origin_files, 134 destination = git.destination( 135 # The destination URL is set by the invoking script. 136 url = "overwritten/by/script", 137 push = "upstream-import", 138 ), 139 mode = "SQUASH", 140) 141