#!/bin/bash # Copyright 2023 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Script to generate `gn desc` json outputs that are used as an input to the # gn2bp conversion tool. # Inputs: # Arguments: # -d dir: The directory that points to a local checkout of chromium/src. # -r rev: The reference revision of upstream Chromium to use. Must match the # last revision that has been imported using import_cronet.sh. # Optional arguments: # -f: Force reset the chromium/src directory. set -e -x OPTSTRING=d:fr: usage() { cat < "${out_file}" ) while getopts "${OPTSTRING}" opt; do case "${opt}" in d) chromium_dir="${OPTARG}" ;; f) force_reset=true ;; r) rev="${OPTARG}" ;; ?) usage ;; *) echo "'${opt}' '${OPTARG}'" esac done if [ -z "${chromium_dir}" ]; then echo "-d argument required" usage fi if [ -z "${rev}" ]; then echo "-r argument required" usage fi setup_chromium_src_repo "${rev}" "${chromium_dir}" "${force_reset}" apply_patches "${chromium_dir}" gn_desc x86 "${chromium_dir}" gn_desc x64 "${chromium_dir}" gn_desc arm "${chromium_dir}" gn_desc arm64 "${chromium_dir}"