├── bazel ├── cbuildbot ├── cros_sdk ├── gerrit ├── whitespace.txt ├── testing_support ├── __init__.py ├── cipd.bat └── cipd ├── third_party ├── repo │ ├── __init__.py │ └── README.chromium ├── schema │ ├── __init__.py │ ├── MANIFEST.in │ ├── setup.cfg │ ├── .editorconfig │ ├── README.chromium │ ├── .travis.yml │ ├── setup.py │ ├── tox.ini │ └── LICENSE-MIT ├── __init__.py └── colorama │ ├── __init__.py │ ├── README.chromium │ └── LICENSE.txt ├── .flake8 ├── win_toolchain ├── OWNERS └── DIR_METADATA ├── recipes ├── recipe_modules │ ├── bot_update │ │ ├── resources │ │ │ └── __init__.py │ │ ├── examples │ │ │ └── full.expected │ │ │ │ └── unrecognized_commit_repo.json │ │ ├── tests │ │ │ ├── download_topics.py │ │ │ ├── ensure_checkout.py │ │ │ └── do_not_retry_patch_failures_in_cq.py │ │ └── __init__.py │ ├── gitiles │ │ ├── OWNERS │ │ ├── resources │ │ │ └── gerrit_client.py.vpython3 │ │ └── __init__.py │ ├── OWNERS │ ├── osx_sdk │ │ ├── OWNERS │ │ ├── examples │ │ │ ├── full.expected │ │ │ │ ├── win.json │ │ │ │ └── linux.json │ │ │ └── full.py │ │ └── __init__.py │ ├── git_cl │ │ ├── __init__.py │ │ └── examples │ │ │ └── full.py │ ├── gerrit │ │ └── __init__.py │ ├── git │ │ ├── __init__.py │ │ ├── test_api.py │ │ └── resources │ │ │ └── git_setup.py │ ├── gsutil │ │ ├── __init__.py │ │ └── properties.proto │ ├── depot_tools │ │ ├── __init__.py │ │ └── examples │ │ │ ├── full.py │ │ │ └── full.expected │ │ │ ├── basic.json │ │ │ └── win.json │ ├── gclient │ │ ├── resources │ │ │ ├── cleanup.py │ │ │ └── diff_deps.py │ │ ├── __init__.py │ │ ├── tests │ │ │ └── sync_failure.py │ │ └── test_api.py │ ├── presubmit │ │ ├── examples │ │ │ ├── full.py │ │ │ └── full.expected │ │ │ │ └── basic.json │ │ ├── properties.proto │ │ ├── test_api.py │ │ ├── __init__.py │ │ └── tests │ │ │ └── prepare.py │ ├── tryserver │ │ ├── __init__.py │ │ ├── tests │ │ │ ├── get_change_description.py │ │ │ ├── gerrit_change_owner.py │ │ │ ├── gerrit_change_target_ref.py │ │ │ └── gerrit_change_fetch_ref_timeout.py │ │ └── examples │ │ │ └── full.expected │ │ │ ├── basic_tags.json │ │ │ └── with_wrong_patch.json │ └── windows_sdk │ │ ├── __init__.py │ │ └── examples │ │ ├── full.py │ │ └── full.expected │ │ ├── linux.json │ │ └── mac.json ├── .style.yapf ├── OWNERS └── trigger_recipe_roller.txt ├── DIR_METADATA ├── RECLIENT_OWNERS ├── infra ├── README.md └── config │ ├── README.md │ ├── OWNERS │ └── recipes.cfg ├── .style.yapf ├── tests ├── gstools │ ├── lorem_ipsum.txt.md5 │ ├── download_test_data │ │ ├── rootfolder_text.txt │ │ ├── rootfolder_text.txt.sha1 │ │ ├── uploaded_lorem_ipsum.txt.sha1 │ │ └── subfolder │ │ │ ├── subfolder_text.txt.sha1 │ │ │ └── subfolder_text.txt │ ├── lorem_ipsum.txt │ └── lorem_ipsum2.txt ├── OWNERS ├── recipes_test.py └── git_cl_creds_check_report.txt ├── cipd_client_version ├── metadata ├── tests │ └── data │ │ ├── LICENSE │ │ ├── src │ │ └── LICENSE.txt │ │ ├── README.chromium.test.single-valid │ │ ├── README.chromium.test.multi-valid │ │ └── README.chromium.test.multi-invalid ├── OWNERS ├── __init__.py ├── fields │ ├── __init__.py │ └── custom │ │ └── __init__.py ├── PRESUBMIT.py ├── README.md └── discover.py ├── man ├── src │ ├── .gitignore │ ├── _git-cl_desc.helper.txt │ ├── _git-retry_desc.helper.txt │ ├── _git-thaw_desc.helper.txt │ ├── git-map.demo.1.sh │ ├── _git-freeze_desc.helper.txt │ ├── _git-reparent-branch_desc.helper.txt │ ├── _git-footers_desc.helper.txt │ ├── _git-mark-merge-base_desc.helper.txt │ ├── _git-upstream-diff_desc.helper.txt │ ├── _helper_prefix.txt │ ├── _git-nav-downstream_desc.helper.txt │ ├── _git-nav-upstream_desc.helper.txt │ ├── _git-new-branch_desc.helper.txt │ ├── _git-hyper-blame_desc.helper.txt │ ├── _git-rebase-update_desc.helper.txt │ ├── _git-rename-branch_desc.helper.txt │ ├── _git-squash-branch_desc.helper.txt │ ├── git-hyper-blame.demo.1.sh │ ├── _git-map_desc.helper.txt │ ├── _aliases.txt │ ├── _git-map-branches_desc.helper.txt │ ├── git-hyper-blame.demo.2.sh │ ├── git-map-branches.demo.1.sh │ ├── asciidoc-override.css │ ├── git-nav-upstream.demo.1.sh │ ├── git-nav-downstream.demo.1.sh │ ├── _footer.txt │ ├── git-squash-branch.demo.1.sh │ ├── git-footers.demo.1.sh │ ├── git-freeze.demo.1.sh │ ├── git-thaw.txt │ ├── git-new-branch.demo.1.sh │ ├── git-rename-branch.txt │ ├── git-nav-upstream.txt │ ├── git-nav-downstream.txt │ ├── depot_tools.txt │ ├── demo_repo.sh │ ├── git-mark-merge-base.txt │ ├── git-reparent-branch.txt │ ├── git-freeze.txt │ └── git-map-branches.txt ├── push_to_gs.sh └── README.txt ├── BUILD_OWNERS ├── CROS_OWNERS ├── bootstrap ├── git.template.bat ├── git-bash.template.sh ├── profile.d.python.sh ├── manifest.txt └── manifest_bleeding_edge.txt ├── zsh-goodies ├── README └── _gclient ├── git-cache ├── git-map ├── git-cl ├── git-drover ├── git-footers ├── git-new-branch ├── git-number ├── git-find-releases ├── git-hyper-blame ├── git-map-branches ├── git-mark-merge-base ├── git-nav-downstream ├── git-rebase-update ├── git-rename-branch ├── git-reparent-branch ├── git-squash-branch ├── git-migrate-default-branch ├── LUCI_OWNERS ├── git-nav-upstream ├── git-freeze ├── git-retry ├── siso ├── vpython3.bat ├── ninja ├── reclient_metrics ├── codereview.settings ├── cipd_manifest_cros_python2.versions ├── clang-format ├── profile.xml ├── reclientreport ├── swift-format ├── cipd_bin_setup.bat ├── bb.bat ├── infra_to_superproject ├── compile_single_file ├── rdb.bat ├── dirmd.bat ├── prpc.bat ├── download_from_google_storage ├── led.bat ├── pinpoint.bat ├── luci-auth.bat ├── lucicfg.bat ├── git-upstream-diff ├── mac_toolchain ├── python-bin ├── python3 └── python3.bat ├── bb ├── led ├── rdb ├── dirmd ├── lucicfg ├── pinpoint ├── prpc ├── cpplint.bat ├── goma_auth.bat ├── crosjobs ├── luci-auth ├── siso.bat ├── gn.bat ├── reclient_metrics.bat ├── compile_single_file.bat ├── pylint-2.17.bat ├── gn ├── ninja.bat ├── reclientreport.bat ├── yapf.bat ├── pylint-2.6.bat ├── pylint-2.7.bat ├── clang-format.bat ├── autosiso ├── roll-dep.bat ├── infra_to_superproject.bat ├── fetch ├── python2-bin ├── python2.bat └── python2 ├── roll-dep ├── download_from_google_storage.bat ├── breakpad.py ├── git-thaw ├── goma_ctl.bat ├── git-gs ├── autosiso.bat ├── goma_auth ├── git-runhooks ├── fetch.bat ├── cipd_bin_setup.sh ├── goma_ctl ├── yapf ├── gsutil.vpython3 ├── WATCHLISTS ├── gsutil.py.bat ├── gclient.bat ├── isort ├── gclient ├── fetch_configs ├── infra.py ├── webrtc_ios.py ├── android.py ├── ios.py ├── webrtc_android.py ├── chrome.py ├── android_internal.py ├── infra_internal.py ├── ios_internal.py ├── skia.py ├── syzygy.py ├── gn.py ├── skia_buildbot.py ├── inspector_protocol.py ├── gyp.py ├── website.py ├── goma_client.py ├── flutter.py ├── crashpad.py ├── node-ci.py ├── v8.py ├── dart.py ├── depot_tools.py ├── devtools-frontend.py ├── breakpad.py ├── devtools-internal.py ├── angle.py ├── naclports.py ├── nacl.py ├── node.py ├── webrtc.py ├── infra_superproject.py ├── pdfium.py └── chromium.py ├── git_squash_branch.py ├── ninja_reclient.py ├── utils.py ├── .isort.cfg ├── upload_metrics.py ├── git_freezer.py ├── bootstrap_python3 ├── autoninja ├── black ├── update_depot_tools_toggle.py ├── cipd_manifest_cros_python2.txt ├── git_cl_completion.sh ├── cros_python2.vpython ├── LICENSE └── vpython3 /bazel: -------------------------------------------------------------------------------- 1 | bazel.py -------------------------------------------------------------------------------- /cbuildbot: -------------------------------------------------------------------------------- 1 | cros -------------------------------------------------------------------------------- /cros_sdk: -------------------------------------------------------------------------------- 1 | cros -------------------------------------------------------------------------------- /gerrit: -------------------------------------------------------------------------------- 1 | cros -------------------------------------------------------------------------------- /whitespace.txt: -------------------------------------------------------------------------------- 1 | Hi 2 | -------------------------------------------------------------------------------- /testing_support/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /third_party/repo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 80 3 | 4 | -------------------------------------------------------------------------------- /win_toolchain/OWNERS: -------------------------------------------------------------------------------- 1 | brucedawson@chromium.org 2 | -------------------------------------------------------------------------------- /recipes/recipe_modules/bot_update/resources/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gitiles/OWNERS: -------------------------------------------------------------------------------- 1 | smut@google.com 2 | -------------------------------------------------------------------------------- /third_party/schema/__init__.py: -------------------------------------------------------------------------------- 1 | from .schema import * 2 | -------------------------------------------------------------------------------- /DIR_METADATA: -------------------------------------------------------------------------------- 1 | monorail: { 2 | component: "Infra>SDK" 3 | } 4 | -------------------------------------------------------------------------------- /RECLIENT_OWNERS: -------------------------------------------------------------------------------- 1 | abdelaal@google.com 2 | bentekkie@google.com 3 | -------------------------------------------------------------------------------- /infra/README.md: -------------------------------------------------------------------------------- 1 | This directory contains infra-specific files. 2 | -------------------------------------------------------------------------------- /.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = pep8 3 | column_limit = 80 4 | -------------------------------------------------------------------------------- /tests/gstools/lorem_ipsum.txt.md5: -------------------------------------------------------------------------------- 1 | 734d7c1ed3545383837428f031840a1e 2 | -------------------------------------------------------------------------------- /third_party/schema/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst LICENSE-MIT *.py 2 | -------------------------------------------------------------------------------- /win_toolchain/DIR_METADATA: -------------------------------------------------------------------------------- 1 | monorail: { 2 | component: "Build" 3 | } 4 | -------------------------------------------------------------------------------- /cipd_client_version: -------------------------------------------------------------------------------- 1 | git_revision:200dbdf0e967e81388359d3f85f095d39b35db67 2 | -------------------------------------------------------------------------------- /metadata/tests/data/LICENSE: -------------------------------------------------------------------------------- 1 | This is a dummy license file, for testing purposes. -------------------------------------------------------------------------------- /tests/gstools/download_test_data/rootfolder_text.txt: -------------------------------------------------------------------------------- 1 | This is a test file. 2 | -------------------------------------------------------------------------------- /man/src/.gitignore: -------------------------------------------------------------------------------- 1 | git 2 | asciidoc 3 | demo_repo 4 | ansi2html 5 | __*.txt 6 | -------------------------------------------------------------------------------- /man/src/_git-cl_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Interact with code reviews on Gerrit and Rietveld 2 | -------------------------------------------------------------------------------- /man/src/_git-retry_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Bootstrap function to retry a git command. 2 | 3 | -------------------------------------------------------------------------------- /man/src/_git-thaw_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Un-freeze all changes on a frozen branch. 2 | 3 | -------------------------------------------------------------------------------- /man/src/git-map.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | run git map 4 | -------------------------------------------------------------------------------- /infra/config/README.md: -------------------------------------------------------------------------------- 1 | This directory contains configuration files for infra services. 2 | -------------------------------------------------------------------------------- /metadata/tests/data/src/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This is a dummy license file, for testing purposes, still. -------------------------------------------------------------------------------- /man/src/_git-freeze_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Freeze all changes on a branch (indexed and unindexed). 2 | -------------------------------------------------------------------------------- /man/src/_git-reparent-branch_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Alter the parentage (upstream) for the current branch. 2 | -------------------------------------------------------------------------------- /recipes/.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = pep8 3 | indent_width = 2 4 | column_limit = 80 5 | -------------------------------------------------------------------------------- /recipes/recipe_modules/OWNERS: -------------------------------------------------------------------------------- 1 | recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com 2 | -------------------------------------------------------------------------------- /tests/gstools/download_test_data/rootfolder_text.txt.sha1: -------------------------------------------------------------------------------- 1 | e6c4fbd4fe7607f3e6ebf68b2ea4ef694da7b4fe 2 | -------------------------------------------------------------------------------- /man/src/_git-footers_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Extract meta-information expressed as footers in a commit message. 2 | -------------------------------------------------------------------------------- /man/src/_git-mark-merge-base_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Manually interact with depot_tools' merge-base markers. 2 | -------------------------------------------------------------------------------- /man/src/_git-upstream-diff_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Print a diff of the current branch, compared to its upstream. 2 | -------------------------------------------------------------------------------- /man/src/_helper_prefix.txt: -------------------------------------------------------------------------------- 1 | A tutorial for these tools can be found at linkgit:depot_tools_tutorial[7]. 2 | -------------------------------------------------------------------------------- /tests/gstools/download_test_data/uploaded_lorem_ipsum.txt.sha1: -------------------------------------------------------------------------------- 1 | 7871c8e24da15bad8b0be2c36edc9dc77e37727f 2 | -------------------------------------------------------------------------------- /man/src/_git-nav-downstream_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Checkout a downstream branch of the currently checked out branch. 2 | -------------------------------------------------------------------------------- /man/src/_git-nav-upstream_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Checkout the upstream branch of the currently checked out branch. 2 | -------------------------------------------------------------------------------- /man/src/_git-new-branch_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Create and switch to a new branch with correct tracking information. 2 | -------------------------------------------------------------------------------- /tests/gstools/download_test_data/subfolder/subfolder_text.txt.sha1: -------------------------------------------------------------------------------- 1 | b5415aa0b64006a95c0c409182e628881d6d6463 2 | -------------------------------------------------------------------------------- /man/src/_git-hyper-blame_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Like git blame, but with the ability to ignore or bypass certain commits. 2 | -------------------------------------------------------------------------------- /man/src/_git-rebase-update_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Updates all branches to have the latest changes from their upstreams. 2 | -------------------------------------------------------------------------------- /man/src/_git-rename-branch_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Rename a branch and correctly preserve all downstream relationships. 2 | -------------------------------------------------------------------------------- /man/src/_git-squash-branch_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Takes all commits in a single branch and replaces them with a single commit. 2 | -------------------------------------------------------------------------------- /man/src/git-hyper-blame.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . git-hyper-blame.demo.common.sh 3 | run git blame ipsum.txt 4 | -------------------------------------------------------------------------------- /tests/gstools/download_test_data/subfolder/subfolder_text.txt: -------------------------------------------------------------------------------- 1 | This is a test file. 2 | This file exists in a subfolder 3 | -------------------------------------------------------------------------------- /man/src/_git-map_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Display history of all branches in a colorized terminal format. 2 | 3 | // vim: ft=asciidoc: 4 | -------------------------------------------------------------------------------- /third_party/schema/setup.cfg: -------------------------------------------------------------------------------- 1 | [wheel] 2 | universal = 1 3 | 4 | [semantic_release] 5 | version_variable = schema.py:__version__ 6 | -------------------------------------------------------------------------------- /infra/config/OWNERS: -------------------------------------------------------------------------------- 1 | iannucci@chromium.org 2 | 3 | per-file recipes.cfg=recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com 4 | -------------------------------------------------------------------------------- /third_party/repo/README.chromium: -------------------------------------------------------------------------------- 1 | Third party files from the repo tool. 2 | 3 | See the project homepage at: 4 | http://code.google.com/p/git-repo/ 5 | -------------------------------------------------------------------------------- /man/src/_aliases.txt: -------------------------------------------------------------------------------- 1 | SUGGESTED ALIASES 2 | ----------------- 3 | 4 | Some common short-hand aliases. Feel free to add these to your '~/.gitconfig' 5 | file. 6 | -------------------------------------------------------------------------------- /BUILD_OWNERS: -------------------------------------------------------------------------------- 1 | jwata@google.com 2 | philwo@google.com 3 | richardwa@google.com 4 | tikuta@chromium.org 5 | tikuta@google.com 6 | ukai@chromium.org 7 | ukai@google.com 8 | -------------------------------------------------------------------------------- /metadata/OWNERS: -------------------------------------------------------------------------------- 1 | # Software Supply Chain Integrity/SBOM 2 | aredulla@google.com 3 | dlf@google.com 4 | jsca@google.com 5 | renewitt@google.com 6 | sumakasa@google.com 7 | -------------------------------------------------------------------------------- /recipes/OWNERS: -------------------------------------------------------------------------------- 1 | iannucci@google.com 2 | 3 | per-file README.recipes.md=* 4 | per-file recipes.py=recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com 5 | -------------------------------------------------------------------------------- /recipes/recipe_modules/osx_sdk/OWNERS: -------------------------------------------------------------------------------- 1 | jeffyoon@google.com 2 | lindsayw@google.com 3 | 4 | # Backup 5 | gatong@google.com 6 | estaab@google.com 7 | gbeaty@google.com 8 | -------------------------------------------------------------------------------- /CROS_OWNERS: -------------------------------------------------------------------------------- 1 | # Chrome OS developers looking over Chrome OS related files. 2 | include chromiumos/owners:v1:/infra/OWNERS.ci 3 | include chromiumos/owners:v1:/infra/OWNERS.build 4 | -------------------------------------------------------------------------------- /man/src/_git-map-branches_desc.helper.txt: -------------------------------------------------------------------------------- 1 | Helper script to display all local git branches with ‘upstream’ hierarchy in 2 | colorized terminal format. 3 | 4 | // vim: ft=asciidoc: 5 | -------------------------------------------------------------------------------- /man/src/git-hyper-blame.demo.2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . git-hyper-blame.demo.common.sh 3 | IGNORE=$(git rev-parse HEAD^) 4 | run git hyper-blame -i ${IGNORE:0:8} ipsum.txt 5 | -------------------------------------------------------------------------------- /man/src/git-map-branches.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | silent git branch no_upstream HEAD~ 5 | 6 | run git map-branches 7 | run git map-branches -v 8 | 9 | -------------------------------------------------------------------------------- /man/push_to_gs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | MY_DIR=$(dirname "$(readlink "$0")") 4 | gsutil cp -r -z html -a public-read "$MY_DIR/html" gs://chrome-infra-docs/flat/depot_tools/docs/ 5 | -------------------------------------------------------------------------------- /man/src/asciidoc-override.css: -------------------------------------------------------------------------------- 1 | div.listingblock > div.content { 2 | background: rgb(28, 28, 28); 3 | } 4 | 5 | div.listingblock > div > pre > code { 6 | color: rgb(187, 187, 187); 7 | } 8 | -------------------------------------------------------------------------------- /bootstrap/git.template.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | if not defined EDITOR set EDITOR=notepad 4 | set PATH=%~dp0${GIT_BIN_RELDIR}\cmd;%~dp0;%PATH% 5 | "%~dp0${GIT_BIN_RELDIR}\${GIT_PROGRAM}" %* 6 | -------------------------------------------------------------------------------- /recipes/recipe_modules/git_cl/__init__.py: -------------------------------------------------------------------------------- 1 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 2 | 3 | DEPS = [ 4 | 'recipe_engine/context', 5 | 'recipe_engine/raw_io', 6 | 'recipe_engine/step', 7 | ] 8 | -------------------------------------------------------------------------------- /zsh-goodies/README: -------------------------------------------------------------------------------- 1 | Various utilities for zsh. 2 | 3 | _gclient: 4 | completion for gclient command. 5 | To install add a path to zsh-goodies into your fpath variable, e.g.: 6 | fpath=(/zsh-goodies $fpath) 7 | -------------------------------------------------------------------------------- /git-cache: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-map: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /metadata/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | """File to enable importing from this folder.""" 5 | -------------------------------------------------------------------------------- /git-cl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-drover: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2015 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-footers: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-new-branch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-number: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2013 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-find-releases: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-hyper-blame: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-map-branches: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-mark-merge-base: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-nav-downstream: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-rebase-update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-rename-branch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-reparent-branch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /git-squash-branch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /metadata/fields/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | """File to enable importing from this folder.""" 5 | -------------------------------------------------------------------------------- /metadata/fields/custom/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | """File to enable importing from this folder.""" 5 | -------------------------------------------------------------------------------- /third_party/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | """File to enable importing from third_party.""" 6 | -------------------------------------------------------------------------------- /git-migrate-default-branch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | . "$(type -P python_runner.sh)" 7 | -------------------------------------------------------------------------------- /LUCI_OWNERS: -------------------------------------------------------------------------------- 1 | chanli@chromium.org 2 | ddoman@chromium.org 3 | iannucci@chromium.org 4 | vadimsh@chromium.org 5 | jonahhooper@google.com 6 | randymaldonado@google.com 7 | yuanjunh@google.com 8 | yiwzhang@google.com 9 | fancl@chromium.org 10 | bryner@google.com 11 | -------------------------------------------------------------------------------- /git-nav-upstream: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | git checkout "$(git rev-parse --abbrev-ref "@{u}")" 7 | -------------------------------------------------------------------------------- /zsh-goodies/_gclient: -------------------------------------------------------------------------------- 1 | #compdef gclient 2 | 3 | _values commands \ 4 | cleanup \ 5 | config \ 6 | diff \ 7 | help \ 8 | pack \ 9 | status \ 10 | sync \ 11 | update \ 12 | revert \ 13 | runhooks\ 14 | revinfo 15 | -------------------------------------------------------------------------------- /man/src/git-nav-upstream.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | silent git checkout subfeature 5 | 6 | run git map-branches 7 | run git nav-upstream 2>&1 8 | run git map-branches 9 | callout 3 10 | run git nav-upstream 2>&1 11 | run git map-branches 12 | 13 | -------------------------------------------------------------------------------- /git-freeze: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | SCRIPT=git_freezer.py 7 | set -- freeze "$@" 8 | . "$(type -P python_runner.sh)" 9 | -------------------------------------------------------------------------------- /git-retry: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | SCRIPT=git_retry.py 7 | set -- retry "$@" 8 | . "$(type -P python_runner.sh)" 9 | -------------------------------------------------------------------------------- /testing_support/cipd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2018 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Defer control. 8 | python3 "%~dp0fake_cipd.py" %* 9 | -------------------------------------------------------------------------------- /third_party/colorama/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from .initialise import init, deinit, reinit, colorama_text 3 | from .ansi import Fore, Back, Style, Cursor 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | __version__ = '0.4.1' 7 | -------------------------------------------------------------------------------- /siso: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2023 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | base_dir=$(dirname "$0") 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/siso.py" "$@" 9 | -------------------------------------------------------------------------------- /vpython3.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2019 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 7 | "%~dp0\.cipd_bin\vpython3.exe" %* 8 | -------------------------------------------------------------------------------- /ninja: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | base_dir=$(dirname "$0") 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/ninja.py" "$@" 9 | -------------------------------------------------------------------------------- /testing_support/cipd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2018 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | exec python3 "$base_dir/fake_cipd.py" "$@" 9 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gitiles/resources/gerrit_client.py.vpython3: -------------------------------------------------------------------------------- 1 | python_version: "3.8" 2 | 3 | wheel: < 4 | name: "infra/python/wheels/httplib2-py3" 5 | version: "version:0.13.1" 6 | > 7 | 8 | wheel: < 9 | name: "infra/python/wheels/six-py2_py3" 10 | version: "version:1.10.0" 11 | > 12 | -------------------------------------------------------------------------------- /reclient_metrics: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2023 The Chromium Authors 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | base_dir=$(dirname "$0") 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/reclient_metrics.py" "$@" 9 | -------------------------------------------------------------------------------- /codereview.settings: -------------------------------------------------------------------------------- 1 | # This file is used by git cl to get repository specific information. 2 | CC_LIST: chromium-reviews@chromium.org 3 | CODE_REVIEW_SERVER: chromium-review.googlesource.com 4 | GERRIT_HOST: True 5 | PROJECT: depot_tools 6 | VIEW_VC: https://chromium.googlesource.com/chromium/tools/depot_tools/+/ 7 | -------------------------------------------------------------------------------- /cipd_manifest_cros_python2.versions: -------------------------------------------------------------------------------- 1 | # This file is auto-generated by 'cipd ensure-file-resolve'. 2 | # Do not modify manually. All changes will be overwritten. 3 | 4 | infra/tools/luci/vpython2.7/linux-amd64 5 | git_revision:cc21a500756c924a48f46f4755d3857133d8caa0 6 | h462OEG6RTHkokEKNA5Nhpxd5Z98ZqjJ3xkP5X56LI0C 7 | -------------------------------------------------------------------------------- /man/src/git-nav-downstream.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | silent git checkout origin/main 5 | 6 | run git map-branches 7 | pcommand git nav-downstream 8 | git nav-downstream --pick 0 2>&1 9 | run git map-branches 10 | run git nav-downstream 2>&1 11 | run git map-branches 12 | 13 | -------------------------------------------------------------------------------- /clang-format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/clang_format.py" "$@" 9 | -------------------------------------------------------------------------------- /profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /reclientreport: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2023 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | base_dir=$(dirname "$0") 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/reclientreport.py" "$@" -------------------------------------------------------------------------------- /swift-format: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2022 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/swift_format.py" "$@" 9 | -------------------------------------------------------------------------------- /cipd_bin_setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2017 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | "%~dp0\cipd.bat" ensure -log-level warning -ensure-file "%~dp0\cipd_manifest.txt" -root "%~dp0\.cipd_bin" 7 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gerrit/__init__.py: -------------------------------------------------------------------------------- 1 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 2 | 3 | DEPS = [ 4 | 'recipe_engine/context', 5 | 'recipe_engine/file', 6 | 'recipe_engine/json', 7 | 'recipe_engine/path', 8 | 'recipe_engine/raw_io', 9 | 'recipe_engine/step', 10 | 'recipe_engine/time', 11 | ] 12 | -------------------------------------------------------------------------------- /bb.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2019 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\bb.exe" %* 10 | -------------------------------------------------------------------------------- /infra_to_superproject: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2023 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/infra_to_superproject.py" "$@" 9 | -------------------------------------------------------------------------------- /compile_single_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2017 The Chromium Authors. All rights reserved. 3 | # # Use of this source code is governed by a BSD-style license that can be 4 | # # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | PYTHONDONTWRITEBYTECODE=1 exec vpython3 -u "$base_dir/compile_single_file.py" "$@" 9 | -------------------------------------------------------------------------------- /man/src/_footer.txt: -------------------------------------------------------------------------------- 1 | CHROMIUM DEPOT_TOOLS 2 | -------------------- 3 | 4 | Part of the chromium linkgit:depot_tools[7] suite. These tools are meant to 5 | assist with the development of chromium and related projects. Download the tools 6 | by checking out the link:{sys3:git config remote.origin.url}[git repository]. 7 | 8 | // vim: ft=asciidoc: 9 | -------------------------------------------------------------------------------- /rdb.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2020 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\rdb.exe" %* 10 | -------------------------------------------------------------------------------- /dirmd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2020 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\dirmd.exe" %* 10 | -------------------------------------------------------------------------------- /prpc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2018 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\prpc.exe" %* 10 | 11 | -------------------------------------------------------------------------------- /download_from_google_storage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2009 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/download_from_google_storage.py" "$@" 9 | -------------------------------------------------------------------------------- /led.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2017 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\led.exe" %* 10 | -------------------------------------------------------------------------------- /pinpoint.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2021 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\pinpoint.exe" %* 10 | -------------------------------------------------------------------------------- /luci-auth.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2018 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\luci-auth.exe" %* 10 | 11 | -------------------------------------------------------------------------------- /lucicfg.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2019 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 9 | "%~dp0\.cipd_bin\lucicfg.exe" %* 10 | -------------------------------------------------------------------------------- /man/src/git-squash-branch.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | run git map 5 | echo 6 | 7 | # since these are all empty commits, pretend there's something there 8 | pcommand git squash-branch -m "cool squash demo" 9 | git squash-branch -m "cool squash demo" > /dev/null 2> /dev/null 10 | c "cool squash demo" 11 | 12 | run git map 13 | -------------------------------------------------------------------------------- /git-upstream-diff: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # git_upstream_diff.py -- Provide the diff between the current branch and its 7 | # upstream. 8 | 9 | . "$(type -P python_runner.sh)" 10 | -------------------------------------------------------------------------------- /recipes/recipe_modules/osx_sdk/examples/full.expected/win.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "gn", 5 | "gen", 6 | "out/Release" 7 | ], 8 | "name": "gn" 9 | }, 10 | { 11 | "cmd": [ 12 | "ninja", 13 | "-C", 14 | "out/Release" 15 | ], 16 | "name": "ninja" 17 | }, 18 | { 19 | "name": "$result" 20 | } 21 | ] -------------------------------------------------------------------------------- /recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "failure": { 4 | "humanReason": "invalid (host, project) pair in buildbucket.build.input.gitiles_commit: (unrecognized, repo) does not match any of configured gclient solutions and not present in gclient_config.repo_path_map" 5 | }, 6 | "name": "$result" 7 | } 8 | ] -------------------------------------------------------------------------------- /recipes/recipe_modules/git/__init__.py: -------------------------------------------------------------------------------- 1 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 2 | 3 | DEPS = [ 4 | 'depot_tools', 5 | 'recipe_engine/buildbucket', 6 | 'recipe_engine/context', 7 | 'recipe_engine/runtime', 8 | 'recipe_engine/path', 9 | 'recipe_engine/platform', 10 | 'recipe_engine/properties', 11 | 'recipe_engine/raw_io', 12 | 'recipe_engine/step', 13 | ] 14 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gsutil/__init__.py: -------------------------------------------------------------------------------- 1 | from PB.recipe_modules.depot_tools.gsutil import properties 2 | 3 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 4 | 5 | DEPS = [ 6 | 'recipe_engine/context', 7 | 'recipe_engine/file', 8 | 'recipe_engine/path', 9 | 'recipe_engine/platform', 10 | 'recipe_engine/step', 11 | ] 12 | 13 | ENV_PROPERTIES = properties.EnvProperties 14 | -------------------------------------------------------------------------------- /recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "gn", 5 | "gen", 6 | "out/Release" 7 | ], 8 | "name": "gn" 9 | }, 10 | { 11 | "cmd": [ 12 | "ninja", 13 | "-C", 14 | "out/Release" 15 | ], 16 | "name": "ninja" 17 | }, 18 | { 19 | "name": "$result" 20 | } 21 | ] -------------------------------------------------------------------------------- /third_party/schema/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig file: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 4 space indentation 12 | [*.py] 13 | indent_style = space 14 | indent_size = 4 15 | trim_trailing_whitespace = true 16 | -------------------------------------------------------------------------------- /mac_toolchain: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2017 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 8 | 9 | source "$MYPATH/cipd_bin_setup.sh" 10 | cipd_bin_setup &> /dev/null 11 | 12 | exec "$MYPATH/.cipd_bin/mac_toolchain" "$@" 13 | -------------------------------------------------------------------------------- /python-bin/python3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DEPOT_TOOLS=$(dirname "$0")/.. 4 | 5 | if [ "$OSTYPE" = "msys" ] 6 | then 7 | PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(sed -e 's-\\-/-g' $DEPOT_TOOLS/python3_bin_reldir.txt)" 8 | else 9 | PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(<"$DEPOT_TOOLS/python3_bin_reldir.txt")" 10 | fi 11 | PATH="$PYTHON3_BIN_DIR":"$PYTHON3_BIN_DIR/Scripts":"$PATH" 12 | "$PYTHON3_BIN_DIR/python3" "$@" 13 | -------------------------------------------------------------------------------- /recipes/recipe_modules/depot_tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'recipe_engine/cipd', 9 | 'recipe_engine/context', 10 | 'recipe_engine/platform', 11 | 'recipe_engine/runtime', 12 | ] 13 | -------------------------------------------------------------------------------- /bb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2019 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/bb" "$@" 15 | -------------------------------------------------------------------------------- /led: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2017 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/led" "$@" 15 | -------------------------------------------------------------------------------- /rdb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2020 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/rdb" "$@" 15 | -------------------------------------------------------------------------------- /dirmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2020 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/dirmd" "$@" 15 | -------------------------------------------------------------------------------- /lucicfg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2019 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/lucicfg" "$@" 15 | -------------------------------------------------------------------------------- /pinpoint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2021 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/pinpoint" "$@" 15 | -------------------------------------------------------------------------------- /prpc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2018 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/prpc" "$@" 15 | 16 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gitiles/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'recipe_engine/json', 9 | 'recipe_engine/path', 10 | 'recipe_engine/raw_io', 11 | 'recipe_engine/step', 12 | 'recipe_engine/url', 13 | ] 14 | -------------------------------------------------------------------------------- /cpplint.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2016 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | python3 "%~dp0cpplint.py" %* 12 | -------------------------------------------------------------------------------- /goma_auth.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2019 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | set scriptdir=%~dp0 9 | 10 | @call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 11 | @call %scriptdir%python-bin\python3.bat %~dp0\.cipd_bin\goma_auth.py %* 12 | exit /b %ERRORLEVEL% 13 | -------------------------------------------------------------------------------- /tests/OWNERS: -------------------------------------------------------------------------------- 1 | per-file autoninja_test.py=brucedawson@chromium.org 2 | per-file autoninja_test.py=tikuta@chromium.org 3 | per-file bazel_test.py=file://CROS_OWNERS 4 | per-file ninjalog_uploader_test.py=tikuta@chromium.org 5 | per-file ninja_reclient_test.py=file://BUILD_OWNERS 6 | per-file ninja_reclient_test.py=file://RECLIENT_OWNERS 7 | per-file reclient_metrics_test.py=file://BUILD_OWNERS 8 | per-file reclient_metrics_test.py=file://RECLIENT_OWNERS 9 | -------------------------------------------------------------------------------- /crosjobs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2018 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/buildjobs" "$@" 15 | 16 | -------------------------------------------------------------------------------- /luci-auth: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2018 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 10 | 11 | source "$MYPATH/cipd_bin_setup.sh" 12 | cipd_bin_setup &> /dev/null 13 | 14 | exec "$MYPATH/.cipd_bin/luci-auth" "$@" 15 | 16 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gclient/resources/cleanup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os, sys 4 | 5 | build_path = sys.argv[1] 6 | if os.path.exists(build_path): 7 | for (path, dir, files) in os.walk(build_path): 8 | for cur_file in files: 9 | if cur_file.endswith('index.lock'): 10 | path_to_file = os.path.join(path, cur_file) 11 | print('deleting %s' % path_to_file) 12 | os.remove(path_to_file) 13 | 14 | -------------------------------------------------------------------------------- /siso.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2023 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\siso.py" "%*" 13 | -------------------------------------------------------------------------------- /gn.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2013 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\gn.py" %* 13 | -------------------------------------------------------------------------------- /reclient_metrics.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2023 The Chromium Authors 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\reclient_metrics.py" "%*" 13 | -------------------------------------------------------------------------------- /compile_single_file.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2017 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | vpython3 -u "%~dp0compile_single_file.py" %* 12 | -------------------------------------------------------------------------------- /pylint-2.17.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2021 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | vpython3 "%~dp0\pylint-2.17" %* 13 | -------------------------------------------------------------------------------- /third_party/schema/README.chromium: -------------------------------------------------------------------------------- 1 | Name: schema 2 | URL: https://github.com/keleshev/schema 3 | Version: 0.6.6 4 | License: MIT 5 | License File: LICENSE-MIT 6 | Shipped: no 7 | 8 | Description: 9 | schema is a library for validating Python data structures, such as those 10 | obtained from config-files, forms, external services or command-line parsing, 11 | converted from JSON/YAML (or something else) to Python data-types. 12 | 13 | Modifications: 14 | None. 15 | -------------------------------------------------------------------------------- /gn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2013 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | # In git bash on Windows, invoke the batch file. 9 | if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then 10 | gn.bat "$@" 11 | exit 12 | fi 13 | 14 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/gn.py" "$@" 15 | -------------------------------------------------------------------------------- /ninja.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2022 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\ninja.py" "%*" 13 | -------------------------------------------------------------------------------- /reclientreport.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2023 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\reclientreport.py" %* -------------------------------------------------------------------------------- /yapf.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2015 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | vpython3 "%~dp0\yapf" %* 13 | -------------------------------------------------------------------------------- /bootstrap/git-bash.template.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export EDITOR=${EDITOR:=notepad} 3 | WIN_BASE=`dirname $0` 4 | UNIX_BASE=`cygpath "$WIN_BASE"` 5 | export PATH="$PATH:$UNIX_BASE/${PYTHON3_BIN_RELDIR_UNIX}:$UNIX_BASE/${PYTHON3_BIN_RELDIR_UNIX}/Scripts" 6 | export PYTHON_DIRECT=1 7 | export PYTHONUNBUFFERED=1 8 | if [[ $# > 0 ]]; then 9 | $UNIX_BASE/${GIT_BIN_RELDIR_UNIX}/bin/bash.exe "$@" 10 | else 11 | $UNIX_BASE/${GIT_BIN_RELDIR_UNIX}/git-bash.exe & 12 | fi 13 | -------------------------------------------------------------------------------- /pylint-2.6.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2021 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | vpython3 "%~dp0\pylint-2.6" %* 13 | -------------------------------------------------------------------------------- /pylint-2.7.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2021 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | vpython3 "%~dp0\pylint-2.7" %* 13 | -------------------------------------------------------------------------------- /clang-format.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2014 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\clang_format.py" %* 13 | -------------------------------------------------------------------------------- /autosiso: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2023 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | echo "Error: 'autosiso' is deprecated and will be removed soon." >&2 8 | echo "" >&2 9 | echo "You can just run 'autoninja' instead, which will delegate either to Ninja" >&2 10 | echo "or to Siso based on the value of the 'use_siso' GN arg." >&2 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /roll-dep.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | call vpython3 "%~dp0\roll_dep.py" %* 13 | -------------------------------------------------------------------------------- /infra_to_superproject.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2023 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\infra_to_superproject.py" %* 13 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gsutil/properties.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The LUCI Authors. All rights reserved. 2 | // Use of this source code is governed under the Apache License, Version 2.0 3 | // that can be found in the LICENSE file. 4 | syntax = "proto3"; 5 | 6 | package recipe_modules.depot_tools.gsutil; 7 | 8 | message EnvProperties { 9 | // Env vars that gsutil uses for both authentication and configuration. 10 | string BOTO_CONFIG = 1; 11 | string BOTO_PATH = 2; 12 | } 13 | -------------------------------------------------------------------------------- /tests/gstools/lorem_ipsum.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 2 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 3 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 4 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 5 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 6 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 7 | -------------------------------------------------------------------------------- /fetch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | # Ensure that "depot_tools" is somewhere in PATH so this tool can be used 9 | # standalone, but allow other PATH manipulations to take priority. 10 | PATH=$PATH:$base_dir 11 | 12 | PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@" 13 | -------------------------------------------------------------------------------- /python-bin/python3.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2021 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | setlocal 7 | 8 | for %%d in (%~dp0..) do set PARENT_DIR=%%~fd 9 | for /f %%i in (%PARENT_DIR%\python3_bin_reldir.txt) do set PYTHON_BIN_ABSDIR=%PARENT_DIR%\%%i 10 | set PATH=%PYTHON_BIN_ABSDIR%;%PYTHON_BIN_ABSDIR%\Scripts;%PATH% 11 | "%PYTHON_BIN_ABSDIR%\python3.exe" %* -------------------------------------------------------------------------------- /python2-bin/python2.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2021 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | setlocal 7 | 8 | for %%d in (%~dp0..) do set PARENT_DIR=%%~fd 9 | for /f %%i in (%PARENT_DIR%\python_bin_reldir.txt) do set PYTHON_BIN_ABSDIR=%PARENT_DIR%\%%i 10 | set PATH=%PYTHON_BIN_ABSDIR%;%PYTHON_BIN_ABSDIR%\Scripts;%PATH% 11 | "%PYTHON_BIN_ABSDIR%\python.exe" %* -------------------------------------------------------------------------------- /recipes/recipe_modules/gclient/__init__.py: -------------------------------------------------------------------------------- 1 | DEPS = [ 2 | 'git', 3 | 'gitiles', 4 | 'recipe_engine/buildbucket', 5 | 'recipe_engine/context', 6 | 'recipe_engine/file', 7 | 'recipe_engine/json', 8 | 'recipe_engine/path', 9 | 'recipe_engine/platform', 10 | 'recipe_engine/properties', 11 | 'recipe_engine/raw_io', 12 | 'recipe_engine/step', 13 | 'tryserver', 14 | ] 15 | 16 | from .config import config_ctx as CONFIG_CTX 17 | 18 | __all__ = ['CONFIG_CTX'] 19 | -------------------------------------------------------------------------------- /roll-dep: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2009 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | # Ensure that "depot_tools" is somewhere in PATH so this tool can be used 9 | # standalone, but allow other PATH manipulations to take priority. 10 | PATH=$PATH:$base_dir 11 | 12 | PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@" 13 | -------------------------------------------------------------------------------- /download_from_google_storage.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 8 | :: standalone, but allow other PATH manipulations to take priority. 9 | set PATH=%PATH%;%~dp0 10 | 11 | :: Defer control. 12 | python3 "%~dp0\download_from_google_storage.py" %* 13 | -------------------------------------------------------------------------------- /metadata/PRESUBMIT.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vpython3 2 | # Copyright (c) 2023 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | PRESUBMIT_VERSION = '2.0.0' 7 | 8 | 9 | def CheckPythonUnitTests(input_api, output_api): 10 | tests = input_api.canned_checks.GetUnitTestsInDirectory( 11 | input_api, output_api, "tests", files_to_check=[r'.+_test\.py$']) 12 | 13 | return input_api.RunTests(tests) 14 | -------------------------------------------------------------------------------- /tests/gstools/lorem_ipsum2.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 2 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 3 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 4 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 5 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 6 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 7 | This is the second file. 8 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gclient/resources/diff_deps.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import subprocess 5 | import sys 6 | 7 | if '@' in os.environ.get('GCLIENT_URL'): 8 | ref = os.environ.get('GCLIENT_URL').split('@')[-1] 9 | else: 10 | sys.exit(0) 11 | 12 | diff = subprocess.check_output("git diff --cached --name-only %s" % ref, shell=True) 13 | 14 | dep_path = os.environ.get('GCLIENT_DEP_PATH', '') 15 | for line in diff.splitlines(): 16 | if line: 17 | print(os.path.join(dep_path, line)) 18 | -------------------------------------------------------------------------------- /recipes/trigger_recipe_roller.txt: -------------------------------------------------------------------------------- 1 | No-op file. Edit this to kick recipes. 2 | 3 | This is a beginning of a story in this silly file. 4 | Once upon a time, a budding web browser dev team needed a CI system. 5 | All they had was one poor machine under a desk, and its name was Batty, 6 | the Build and Test Yeti. 7 | 8 | As the CI needs of the browser grew, Batty, the Build and Test Yeti, got 9 | a new friend, but this information was marked RVG, so it was months before 10 | any details were revealed. 11 | 12 | The End! 13 | -------------------------------------------------------------------------------- /third_party/colorama/README.chromium: -------------------------------------------------------------------------------- 1 | Name: colorama 2 | URL: https://github.com/tartley/colorama 3 | Version: b71bec90d4770d4124ad95d70cc6a4c9289bbadf (0.4.1) 4 | Revision: b71bec90d4770d4124ad95d70cc6a4c9289bbadf 5 | License: BSD 6 | License File: LICENSE.txt 7 | Shipped: no 8 | 9 | Description: 10 | Provides a simple cross-platform API to print colored terminal text from Python 11 | applications. 12 | 13 | Additional changes: 14 | - Kept colorama/ but removed colorama/tests/. 15 | - Copied LICENSE.txt and README.rst. 16 | -------------------------------------------------------------------------------- /breakpad.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | """This file remains here because of multiple find_depot_tools.py scripts 5 | that attempt to import it as a way to find depot_tools. 6 | 7 | See also: 8 | * http://crbug.com/585837 9 | * Example of find_depot_tools in build repo: 10 | https://chromium.googlesource.com/chromium/tools/build/+/2680bd4/scripts/common/find_depot_tools.py 11 | """ 12 | -------------------------------------------------------------------------------- /man/src/git-footers.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | add deleted_file 5 | add unstaged_deleted_file 6 | add modified_file 7 | c 'I committed this and am proud of it. 8 | 9 | Cr-Commit-Position: refs/heads/main@{#292272} 10 | Tech-Debt-Introduced: 17 microMSOffices 11 | Tech-Debt-Introduced: -4 microMSOffices' 12 | 13 | run git footers HEAD 14 | run git footers --key Tech-Debt-Introduced HEAD 15 | run git footers --position HEAD 16 | run git footers --position-num HEAD 17 | run git footers --position-ref HEAD 18 | -------------------------------------------------------------------------------- /python2-bin/python2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DEPOT_TOOLS=$(dirname "$0")/.. 4 | 5 | if [ "$OSTYPE" = "msys" ] 6 | then 7 | # msys is `git bash` on windows, so python_bin_reldir contains backslashes; 8 | # this converts them to the forward slashes a unix environment expects. 9 | PYTHON_BIN_DIR="$DEPOT_TOOLS/$(sed -e 's-\\-/-g' $DEPOT_TOOLS/python_bin_reldir.txt)" 10 | else 11 | PYTHON_BIN_DIR="$DEPOT_TOOLS/$(<"$DEPOT_TOOLS/python_bin_reldir.txt")" 12 | fi 13 | PATH="$PYTHON_BIN_DIR":"$PATH" 14 | "$PYTHON_BIN_DIR/python" "$@" 15 | -------------------------------------------------------------------------------- /recipes/recipe_modules/presubmit/examples/full.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'presubmit', 9 | 'recipe_engine/json' 10 | ] 11 | 12 | 13 | def RunSteps(api): 14 | api.presubmit() 15 | 16 | 17 | def GenTests(api): 18 | yield ( 19 | api.test('basic') + 20 | api.step_data('presubmit', api.json.output({})) 21 | ) 22 | -------------------------------------------------------------------------------- /git-thaw: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # git_freezer.py thaw -- a git-command to reverse the effect of the 'git freeze' 7 | # command. Any changes suspended on this branch with the freeze command will be 8 | # restored to the state they were in immediately prior to running the freeze 9 | # command. 10 | 11 | SCRIPT=git_freezer.py 12 | set -- thaw "$@" 13 | . "$(type -P python_runner.sh)" 14 | -------------------------------------------------------------------------------- /man/src/git-freeze.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | add deleted_file 5 | add unstaged_deleted_file 6 | add modified_file 7 | c "demo changes" 8 | 9 | add added_file_with_unstaged_changes 10 | echo bob >> added_file_with_unstaged_changes 11 | 12 | add added_file 13 | echo bob >> modified_file 14 | silent git rm deleted_file 15 | rm unstaged_deleted_file 16 | touch unadded_file 17 | 18 | run git status --short 19 | run git freeze 20 | run git status --short 21 | run git log -n 2 --stat 22 | run git thaw 23 | run git status --short 24 | -------------------------------------------------------------------------------- /goma_ctl.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2019 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: See revert instructions in cipd_manifest.txt 7 | 8 | set scriptdir=%~dp0 9 | 10 | @call "%~dp0\cipd_bin_setup.bat" > nul 2>&1 11 | if "%*" == "/?" ( 12 | @call %scriptdir%python-bin\python3.bat %~dp0\.cipd_bin\goma_ctl.py --help 13 | exit /b 14 | ) 15 | @call %scriptdir%python-bin\python3.bat %~dp0\.cipd_bin\goma_ctl.py %* 16 | exit /b %ERRORLEVEL% 17 | -------------------------------------------------------------------------------- /recipes/recipe_modules/presubmit/properties.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | syntax = "proto3"; 6 | package recipe_modules.depot_tools.presubmit; 7 | 8 | message InputProperties { 9 | // Whether gclient hooks should be run when setting up the checkout. 10 | bool runhooks = 1; 11 | // Timeout for presubmit execution, in seconds. 12 | // Defaults to 480s (8 minutes). 13 | int32 timeout_s = 2; 14 | } 15 | -------------------------------------------------------------------------------- /git-gs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | git grep -n -e "$@" -- "*.h" "*.hpp" "*.cpp" "*.c" "*.cc" "*.cpp" "*.inl"\ 6 | "*.grd" "*.grdp" "*.idl" "*.m" "*.mm" "*.py" "*.sh" "*.cfg" "*.tac" "*.go"\ 7 | "*.vcproj" "*.vsprops" "*.make" "*.gyp" "*.gypi" "*.isolate" "*.java"\ 8 | "*.js" "*.ts" "*.html" "*.css" "*.ebuild" "*.pl" "*.pm" "*.yaml" "*.gn"\ 9 | "*.gni" "*.json" "DEPS" "*/DEPS" "*.mojom" "*.proto" "*.rs" "*.star" 10 | -------------------------------------------------------------------------------- /man/README.txt: -------------------------------------------------------------------------------- 1 | = Man pages for Depot_tools 2 | 3 | This document describes how to write documentation for depot_tools and how to 4 | deploy it. 5 | 6 | == Edit 7 | 8 | Only edit files in src/ directories. All other directories (e.g. html, man1) are 9 | autogenerated and should never be edited manaully. 10 | 11 | Once you made modifications to src/ files, run `./make_docs.sh` in src/ 12 | directory to generate html and man pages. 13 | 14 | == Deploy 15 | 16 | Run `./push_to_gs.sh` from this directory. If you not have access, ask someone 17 | from chrome infra to deploy it for you. 18 | -------------------------------------------------------------------------------- /autosiso.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright 2023 The Chromium Authors 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | echo Error: 'autosiso' is deprecated and will be removed soon. 8 | echo. 9 | echo You can just run 'autoninja' instead, which will delegate either to Ninja 10 | echo or to Siso based on the value of the 'use_siso' GN arg. 11 | 12 | :: Return an error code of 1 so that if a developer types: 13 | :: "autosiso chrome && chrome" then the second part won't accidentally be run. 14 | cmd /c exit 1 15 | -------------------------------------------------------------------------------- /metadata/tests/data/README.chromium.test.single-valid: -------------------------------------------------------------------------------- 1 | Name: Test-A README for Chromium metadata 2 | Short Name: metadata-test-valid 3 | URL: https://www.example.com/metadata, 4 | https://www.example.com/parser 5 | Version: 1.0.12 6 | Date: 2020-12-03 7 | License: Apache, 2.0 and MIT 8 | License File: LICENSE 9 | Security Critical: yes 10 | Shipped: yes 11 | CPEPrefix: unknown 12 | This line should be ignored because CPEPrefix is a one-liner field. 13 | Description: 14 | A test metadata file, with a 15 | multi-line description. 16 | 17 | Local Modifications: 18 | None, 19 | EXCEPT: 20 | * nothing. 21 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'gerrit', 9 | 'git', 10 | 'git_cl', 11 | 'recipe_engine/buildbucket', 12 | 'recipe_engine/context', 13 | 'recipe_engine/json', 14 | 'recipe_engine/led', 15 | 'recipe_engine/path', 16 | 'recipe_engine/platform', 17 | 'recipe_engine/properties', 18 | 'recipe_engine/raw_io', 19 | 'recipe_engine/step', 20 | ] 21 | -------------------------------------------------------------------------------- /recipes/recipe_modules/presubmit/examples/full.expected/basic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "vpython3", 5 | "RECIPE_REPO[depot_tools]/presubmit_support.py", 6 | "--json_output", 7 | "/path/to/tmp/json" 8 | ], 9 | "env_suffixes": { 10 | "DEPOT_TOOLS_UPDATE": [ 11 | "0" 12 | ], 13 | "PATH": [ 14 | "RECIPE_REPO[depot_tools]" 15 | ] 16 | }, 17 | "name": "presubmit", 18 | "~followup_annotations": [ 19 | "@@@STEP_LOG_LINE@json.output@{}@@@", 20 | "@@@STEP_LOG_END@json.output@@@" 21 | ] 22 | }, 23 | { 24 | "name": "$result" 25 | } 26 | ] -------------------------------------------------------------------------------- /goma_auth: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2019 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | # In git bash on Windows, invoke the batch file. 10 | if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then 11 | goma_auth.bat "$@" 12 | exit 13 | fi 14 | 15 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 16 | 17 | source "$MYPATH/cipd_bin_setup.sh" 18 | cipd_bin_setup &> /dev/null 19 | 20 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$MYPATH/.cipd_bin/goma_auth.py" "$@" 21 | -------------------------------------------------------------------------------- /man/src/git-thaw.txt: -------------------------------------------------------------------------------- 1 | git-thaw(1) 2 | ============= 3 | 4 | NAME 5 | ---- 6 | git-thaw - 7 | include::_git-thaw_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git thaw' 13 | 14 | DESCRIPTION 15 | ----------- 16 | 17 | `git thaw` takes a frozen branch (as made by linkgit:git-freeze[1]), and returns 18 | it to the status that it was in before it was frozen. 19 | 20 | If you freeze a branch multiple times (i.e. change files, freeze, change files, 21 | freeze), `git thaw` will thaw all of the freezes. 22 | 23 | SEE ALSO 24 | -------- 25 | linkgit:git-freeze[1] 26 | 27 | include::_footer.txt[] 28 | 29 | // vim: ft=asciidoc: 30 | -------------------------------------------------------------------------------- /recipes/recipe_modules/git/test_api.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import recipe_test_api 6 | 7 | class GitTestApi(recipe_test_api.RecipeTestApi): 8 | def count_objects_output(self, value): 9 | return ( 10 | 'count: %s\n' 11 | 'size: %s\n' 12 | 'in_pack: %s\n' 13 | 'packs: %s\n' 14 | 'size-pack: %s\n' 15 | 'prune-packable: %s\n' 16 | 'garbage: %s\n' 17 | 'size-garbage: %s\n' 18 | ) % tuple([value] * 8) 19 | -------------------------------------------------------------------------------- /man/src/git-new-branch.demo.1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | . demo_repo.sh 3 | 4 | run git map-branches -v 5 | run git new-branch independent_cl 6 | run git map-branches -v 7 | praw vi foo \&\& git add -A \&\& git commit -m 'foo' 8 | silent echo 'foo' >foo 9 | silent git add -A 10 | silent git commit -m 'foo' 11 | run git map-branches -v 12 | run git new-branch --upstream subfeature nested_cl 13 | callout 3 14 | run git map-branches -v 15 | run git checkout cool_feature 2>&1 16 | run git new-branch --upstream_current cl_depends_on_cool_feature 17 | run git map-branches -v 18 | run git checkout subfeature 19 | run git new-branch --inject_current injected_cl 20 | run git map-branches -v 21 | -------------------------------------------------------------------------------- /third_party/schema/.travis.yml: -------------------------------------------------------------------------------- 1 | # use new container-based infrastructure 2 | sudo: false 3 | 4 | language: python 5 | 6 | addons: 7 | apt: 8 | sources: 9 | - deadsnakes 10 | packages: 11 | - python3.5 12 | 13 | cache: 14 | pip: true 15 | directories: 16 | - .tox 17 | 18 | install: pip install codecov tox 19 | 20 | env: 21 | - TOX_ENV=py26 22 | - TOX_ENV=py27 23 | - TOX_ENV=py33 24 | - TOX_ENV=py34 25 | - TOX_ENV=py35 26 | - TOX_ENV=pypy 27 | - TOX_ENV=pypy3 28 | - TOX_ENV=coverage 29 | - TOX_ENV=pep8 30 | 31 | script: 32 | - tox -e $TOX_ENV 33 | 34 | # publish coverage only after a successful build 35 | after_success: 36 | - codecov 37 | 38 | -------------------------------------------------------------------------------- /recipes/recipe_modules/presubmit/test_api.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import recipe_test_api 6 | 7 | from PB.recipe_modules.depot_tools.presubmit import properties 8 | 9 | class PresubmitTestApi(recipe_test_api.RecipeTestApi): 10 | 11 | def __call__(self, runhooks=False, timeout_s=480): 12 | return self.m.properties( 13 | **{ 14 | '$depot_tools/presubmit': properties.InputProperties( 15 | runhooks=runhooks, 16 | timeout_s=timeout_s, 17 | ), 18 | } 19 | ) 20 | -------------------------------------------------------------------------------- /man/src/git-rename-branch.txt: -------------------------------------------------------------------------------- 1 | git-rename-branch(1) 2 | ==================== 3 | 4 | NAME 5 | ---- 6 | git-rename-branch - 7 | include::_git-rename-branch_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git rename-branch' 13 | 'git rename-branch' 14 | 15 | DESCRIPTION 16 | ----------- 17 | 18 | Rename the current (or specified) branch, then update all dowstream branches' 19 | tracking information to preserve inter-branch dependencies. 20 | 21 | SEE ALSO 22 | -------- 23 | linkgit:git-rebase-update[1], linkgit:git-reparent-branch[1], 24 | linkgit:git-new-branch[1], linkgit:git-upstream-diff[1] 25 | 26 | include::_footer.txt[] 27 | 28 | // vim: ft=asciidoc: 29 | -------------------------------------------------------------------------------- /bootstrap/profile.d.python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This alias allows invocations of `python` to work as expected under msys bash. 3 | # In particular, it detects if stdout+stdin are both attached to a pseudo-tty, 4 | # and if so, invokes python in interactive mode. If this is not the case, or 5 | # the user passes any arguments, python will be invoked unmodified. 6 | python() { 7 | if [[ $# > 0 ]]; then 8 | python.exe "$@" 9 | else 10 | readlink /proc/$$/fd/0 | grep pty > /dev/null 11 | TTY0=$? 12 | readlink /proc/$$/fd/1 | grep pty > /dev/null 13 | TTY1=$? 14 | if [ $TTY0 == 0 ] && [ $TTY1 == 0 ]; then 15 | python.exe -i 16 | else 17 | python.exe 18 | fi 19 | fi 20 | } 21 | -------------------------------------------------------------------------------- /git-runhooks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | while test "$PWD" != "/"; do 4 | if test -f "$PWD/src/.gitmodules"; then 5 | break 6 | fi 7 | cd .. 8 | done 9 | if ! test -f "$PWD/src/.gitmodules"; then 10 | echo "Could not find the root of your checkout; aborting." 1>&2 11 | exit 1 12 | fi 13 | 14 | gclient_spec="solutions=[{'name':'src','url':None,'deps_file':'.DEPS.git'}]" 15 | kernel_name=$(uname -s) 16 | if [ "${kernel_name:0:5}" = "MINGW" ]; then 17 | dir="${0%\\*}" 18 | cmd "/C ${dir}\\python3.bat ${dir}\\gclient.py runhooks --spec=$gclient_spec" 19 | else 20 | dir="$(dirname $0)" 21 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$dir/gclient.py" runhooks --spec="$gclient_spec" 22 | fi 23 | exit $? 24 | -------------------------------------------------------------------------------- /fetch.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Synchronize the root directory before deferring control back to gclient.py. 8 | call "%~dp0\update_depot_tools.bat" 9 | :: Abort the script if we failed to update depot_tools. 10 | IF %ERRORLEVEL% NEQ 0 ( 11 | exit /b %ERRORLEVEL% 12 | ) 13 | 14 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 15 | :: standalone, but allow other PATH manipulations to take priority. 16 | set PATH=%PATH%;%~dp0 17 | 18 | :: Defer control. 19 | call vpython3 "%~dp0\fetch.py" %* 20 | -------------------------------------------------------------------------------- /tests/recipes_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vpython3 2 | 3 | # Copyright (c) 2015 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | """Runs simulation tests and lint on the recipes.""" 7 | 8 | import os 9 | import subprocess 10 | 11 | ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 12 | 13 | 14 | def recipes_py(*args): 15 | recipes_cfg_path = os.path.join(ROOT_DIR, 'infra', 'config', 'recipes.cfg') 16 | subprocess.check_call([os.path.join(ROOT_DIR, 'recipes', 'recipes.py'), 17 | '--package', recipes_cfg_path] + list(args)) 18 | 19 | 20 | recipes_py('test', 'run') 21 | 22 | recipes_py('lint') 23 | -------------------------------------------------------------------------------- /cipd_bin_setup.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2017 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | function cipd_bin_setup { 6 | local MYPATH="${DEPOT_TOOLS_DIR:-$(dirname "${BASH_SOURCE[0]}")}" 7 | local ENSURE="$MYPATH/cipd_manifest.txt" 8 | local ROOT="$MYPATH/.cipd_bin" 9 | 10 | UNAME="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}" 11 | case $UNAME in 12 | cygwin*) 13 | ENSURE="$(cygpath -w $ENSURE)" 14 | ROOT="$(cygpath -w $ROOT)" 15 | ;; 16 | esac 17 | 18 | ( 19 | source "$MYPATH/cipd" ensure \ 20 | -log-level warning \ 21 | -ensure-file "$ENSURE" \ 22 | -root "$ROOT" 23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /goma_ctl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2019 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # See revert instructions in cipd_manifest.txt 8 | 9 | # In git bash on Windows, invoke the batch file. 10 | if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then 11 | goma_ctl.bat "$@" 12 | exit 13 | fi 14 | 15 | MYPATH=$(dirname "${BASH_SOURCE[0]}") 16 | 17 | source "$MYPATH/cipd_bin_setup.sh" 18 | cipd_bin_setup &> /dev/null 19 | 20 | GOMA="$MYPATH/.cipd_bin/goma_ctl.py" 21 | if [[ -f "$GOMA" ]]; then 22 | PYTHONDONTWRITEBYTECODE=1 exec python3 "$GOMA" "$@" 23 | else 24 | echo "'$GOMA' was not found and may not be supported on this platform!" 25 | fi 26 | -------------------------------------------------------------------------------- /yapf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vpython3 2 | 3 | # [VPYTHON:BEGIN] 4 | # python_version: "3.8" 5 | # wheel: < 6 | # name: "infra/python/wheels/yapf-py3" 7 | # version: "version:0.40.2" 8 | # > 9 | # wheel: < 10 | # name: "infra/python/wheels/platformdirs-py3" 11 | # version: "version:4.1.0" 12 | # > 13 | # wheel: < 14 | # name: "infra/python/wheels/importlib-metadata-py3" 15 | # version: "version:7.0.0" 16 | # > 17 | # wheel: < 18 | # name: "infra/python/wheels/tomli-py3" 19 | # version: "version:2.0.1" 20 | # > 21 | # wheel: < 22 | # name: "infra/python/wheels/zipp-py3" 23 | # version: "version:3.7.0" 24 | # > 25 | # [VPYTHON:END] 26 | 27 | # -*- coding: utf-8 -*- 28 | import sys 29 | 30 | from yapf import run_main 31 | 32 | if __name__ == '__main__': 33 | sys.exit(run_main()) 34 | -------------------------------------------------------------------------------- /gsutil.vpython3: -------------------------------------------------------------------------------- 1 | # vpython VirtualEnv protobuf for "gsutil". 2 | # 3 | # See: 4 | # https://chromium.googlesource.com/infra/luci/luci-go/+/HEAD/vpython/api/vpython/spec.proto 5 | # 6 | # This is a "vpython" VirtualEnv specification applied to invocations of "gsutil" 7 | # by the bootstrap wrapper, "gsutil.py". It ensures that any Python distribution 8 | # has the expected Python packages installed. 9 | # 10 | # This is specifically relevant on Google Compute Engine invocations of 11 | # "gsutil", where a stock system-deployed file in "/etc/" explicitly specifies 12 | # that the "google_compute_engine" and "boto" Python packages are available. 13 | 14 | python_version: "3.8" 15 | 16 | wheel: < 17 | name: "infra/python/wheels/crcmod/${vpython_platform}" 18 | version: "version:1.7.chromium.3" 19 | > 20 | -------------------------------------------------------------------------------- /man/src/git-nav-upstream.txt: -------------------------------------------------------------------------------- 1 | git-nav-upstream(1) 2 | ===================== 3 | 4 | NAME 5 | ---- 6 | git-nav-upstream - 7 | include::_git-nav-upstream_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git nav-upstream' 13 | 14 | DESCRIPTION 15 | ----------- 16 | 17 | 'git-nav-upstream' takes the current branch, finds it\'s upstream branch, and 18 | checks that out. 19 | 20 | EXAMPLE 21 | ------- 22 | demo:1[] 23 | 1. Note that being in a 'detached HEAD' state is OK. You'll just want to create 24 | a linkgit:git-new-branch[1] from here. 25 | 26 | include::_aliases.txt[] 27 | 28 | ---- 29 | [alias] 30 | up = nav-upstream 31 | ---- 32 | 33 | SEE ALSO 34 | -------- 35 | linkgit:git-map-branches[1], linkgit:git-nav-downstream[1] 36 | 37 | include::_footer.txt[] 38 | 39 | // vim: ft=asciidoc: 40 | -------------------------------------------------------------------------------- /metadata/README.md: -------------------------------------------------------------------------------- 1 | # Validation for Chromium's Third Party Metadata Files 2 | 3 | This directory contains the code to validate Chromium third party metadata 4 | files, i.e. `README.chromium` files. 5 | 6 | ## Prerequisites 7 | 1. Have the Chromium source code 8 | [checked out](https://chromium.googlesource.com/chromium/src/+/main/docs/#checking-out-and-building) on disk 9 | 1. Ensure you've run `gclient runhooks` on your source checkout 10 | 11 | ## Run 12 | `metadata/scan.py` can be used to search for and validate all Chromium third 13 | party metadata files within a repository. For example, if your `chromium/src` 14 | checkout is at `~/my/path/to/chromium/src`, run the following command from the 15 | root directory of `depot_tools`: 16 | ``` 17 | vpython3 --vpython-spec=.vpython3 metadata/scan.py ~/my/path/to/chromium/src 18 | ``` 19 | -------------------------------------------------------------------------------- /WATCHLISTS: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # Watchlist Rules 6 | # Refer: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/infra/watchlists.md 7 | 8 | { 9 | 10 | 'WATCHLIST_DEFINITIONS': { 11 | 'this_file': { 12 | 'filepath': '^WATCHLISTS$', 13 | }, 14 | 'depot_tools': { 15 | 'filepath': '.+', 16 | }, 17 | 'build': { 18 | 'filepath': '.*(ninja|reclient|siso).*', 19 | }, 20 | }, 21 | 22 | 'WATCHLISTS': { 23 | 'this_file': [], 24 | 'depot_tools': [ 25 | 'chops-source-team-auto+depot_tools@google.com', 26 | ], 27 | 'build': [ 28 | 'chrome-build-team@google.com', 29 | ], 30 | }, 31 | 32 | } 33 | -------------------------------------------------------------------------------- /gsutil.py.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2018 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Shall skip automatic update? 8 | IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :CALL_GSUTIL 9 | 10 | :: Synchronize the root directory before deferring control back to gsutil.py. 11 | call "%~dp0update_depot_tools.bat" %* 12 | :: Abort the script if we failed to update depot_tools. 13 | IF %ERRORLEVEL% NEQ 0 ( 14 | exit /b %ERRORLEVEL% 15 | ) 16 | 17 | :CALL_GSUTIL 18 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 19 | :: standalone, but allow other PATH manipulations to take priority. 20 | set PATH=%PATH%;%~dp0 21 | 22 | :: Defer control. 23 | python3 "%~dp0gsutil.py" %* 24 | -------------------------------------------------------------------------------- /gclient.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | setlocal 6 | 7 | :: Shall skip automatic update? 8 | IF "%DEPOT_TOOLS_UPDATE%" == "0" GOTO :CALL_GCLIENT 9 | 10 | :: Synchronize the root directory before deferring control back to gclient.py. 11 | call "%~dp0update_depot_tools.bat" %* 12 | :: Abort the script if we failed to update depot_tools. 13 | IF %ERRORLEVEL% NEQ 0 ( 14 | exit /b %ERRORLEVEL% 15 | ) 16 | 17 | :CALL_GCLIENT 18 | :: Ensure that "depot_tools" is somewhere in PATH so this tool can be used 19 | :: standalone, but allow other PATH manipulations to take priority. 20 | set PATH=%PATH%;%~dp0 21 | 22 | :: Defer control. 23 | call vpython3 "%~dp0gclient.py" %* 24 | -------------------------------------------------------------------------------- /infra/config/recipes.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "api_version": 2, 3 | "autoroll_recipe_options": { 4 | "no_cc_authors": true, 5 | "nontrivial": { 6 | "automatic_commit_dry_run": true, 7 | "set_autosubmit": true 8 | }, 9 | "trivial": { 10 | "automatic_commit": true, 11 | "tbr_emails": [ 12 | "iannucci@chromium.org" 13 | ] 14 | } 15 | }, 16 | "canonical_repo_url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git", 17 | "deps": { 18 | "recipe_engine": { 19 | "branch": "refs/heads/main", 20 | "revision": "3b1cb2ea044128062ffa57715df89b1efaaaba38", 21 | "url": "https://chromium.googlesource.com/infra/luci/recipes-py.git" 22 | } 23 | }, 24 | "project_id": "depot_tools", 25 | "py3_only": true, 26 | "recipes_path": "recipes", 27 | "repo_name": "depot_tools" 28 | } 29 | -------------------------------------------------------------------------------- /recipes/recipe_modules/presubmit/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine.config import ConfigGroup, Single 6 | from recipe_engine.recipe_api import Property 7 | 8 | from PB.recipe_modules.depot_tools.presubmit import properties 9 | 10 | 11 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 12 | 13 | DEPS = [ 14 | 'bot_update', 15 | 'depot_tools', 16 | 'gclient', 17 | 'git', 18 | 'recipe_engine/buildbucket', 19 | 'recipe_engine/context', 20 | 'recipe_engine/cq', 21 | 'recipe_engine/json', 22 | 'recipe_engine/path', 23 | 'recipe_engine/properties', 24 | 'recipe_engine/step', 25 | 'recipe_engine/resultdb', 26 | 'tryserver', 27 | ] 28 | 29 | 30 | PROPERTIES = properties.InputProperties 31 | -------------------------------------------------------------------------------- /isort: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vpython3 2 | # Copyright 2022 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Note: We use tags here instead of refs because refs will always hit the 7 | # network to see if there are any updates. 8 | 9 | # [VPYTHON:BEGIN] 10 | # python_version: "3.8" 11 | # 12 | # wheel: < 13 | # name: "infra/python/wheels/isort-py3" 14 | # version: "version:5.10.1" 15 | # > 16 | # 17 | # [VPYTHON:END] 18 | 19 | from pathlib import Path 20 | import sys 21 | 22 | THIS_DIR = Path(__file__).resolve().parent 23 | RC_FILE = THIS_DIR / '.isort.cfg' 24 | 25 | # Set default config options. If a project wants to deviate, they'll have to 26 | # manually override. 27 | sys.argv = sys.argv[:1] + [f'--settings-file={RC_FILE}'] + sys.argv[1:] 28 | 29 | import isort.__main__ 30 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gclient/tests/sync_failure.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | 7 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 8 | 9 | DEPS = [ 10 | 'recipe_engine/path', 11 | 12 | 'gclient', 13 | ] 14 | 15 | def RunSteps(api): 16 | src_cfg = api.gclient.make_config(CACHE_DIR=api.path['cache'].join('git')) 17 | api.gclient.sync(src_cfg) 18 | 19 | def GenTests(api): 20 | yield api.test( 21 | 'no-json', 22 | api.override_step_data('gclient sync', retcode=1), 23 | # Should not fail with uncaught exception 24 | api.post_process(post_process.ResultReasonRE, r'^(?!Uncaught Exception)'), 25 | api.post_process(post_process.DropExpectation), 26 | status="INFRA_FAILURE") 27 | -------------------------------------------------------------------------------- /man/src/git-nav-downstream.txt: -------------------------------------------------------------------------------- 1 | git-nav-downstream(1) 2 | ===================== 3 | 4 | NAME 5 | ---- 6 | git-nav-downstream - 7 | include::_git-nav-downstream_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git nav-downstream' 13 | 14 | DESCRIPTION 15 | ----------- 16 | 17 | 'git-nav-downstream' takes the current branch and discovers all branches 18 | downstream of it. If there is only one branch downstream of the current branch, 19 | the command will check that out. If there\'s more than one downstream branch, the 20 | command will prompt you with a selection of the branches. 21 | 22 | EXAMPLE 23 | ------- 24 | demo:1[] 25 | 26 | include::_aliases.txt[] 27 | 28 | ---- 29 | [alias] 30 | down = nav-downstream 31 | ---- 32 | 33 | 34 | SEE ALSO 35 | -------- 36 | linkgit:git-map-branches[1], linkgit:git-nav-upstream[1] 37 | 38 | include::_footer.txt[] 39 | 40 | // vim: ft=asciidoc: 41 | -------------------------------------------------------------------------------- /man/src/depot_tools.txt: -------------------------------------------------------------------------------- 1 | depot_tools(7) 2 | ============== 3 | 4 | NAME 5 | ---- 6 | depot_tools - A collection of tools for dealing with Chromium development. 7 | 8 | DESCRIPTION 9 | ----------- 10 | 11 | The Chromium depot_tools suite contains many tools to assist/augment the 12 | Chromium development environment. The tools may be downloaded by checking 13 | out the link:{sys3:git config remote.origin.url}[git repository]. 14 | 15 | There are two primary categories of tools. Some of these tools are 'essential' 16 | to the development flow, in the sense that you cannot successfully develop 17 | Chromium without them. 18 | 19 | Other tools are merely 'helper' tools. Not required, but they can substantially 20 | ease the development workflow. 21 | 22 | A listing of both categories of tools follows. 23 | 24 | include::__essential.txt[maxdepth=1] 25 | 26 | include::__helper.txt[maxdepth=1] 27 | 28 | // vim: ft=asciidoc: 29 | -------------------------------------------------------------------------------- /recipes/recipe_modules/windows_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'recipe_engine/cipd', 9 | 'recipe_engine/context', 10 | 'recipe_engine/json', 11 | 'recipe_engine/path', 12 | 'recipe_engine/step', 13 | ] 14 | 15 | from recipe_engine.recipe_api import Property 16 | from recipe_engine.config import ConfigGroup, Single 17 | 18 | PROPERTIES = { 19 | '$depot_tools/windows_sdk': Property( 20 | help='Properties specifically for the infra windows_sdk module.', 21 | param_name='sdk_properties', 22 | kind=ConfigGroup( 23 | # CIPD instance ID, tag or ref for the Windows SDK version. 24 | version=Single(str), 25 | ), default={'version': 'uploaded:2018-06-13'}, 26 | ) 27 | } 28 | -------------------------------------------------------------------------------- /gclient: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2009 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | base_dir=$(dirname "$0") 7 | 8 | if [[ "#grep#fetch#cleanup#diff#help#getdep#root#setdep#recurse#--help#" != *"#$1#"* ]]; then 9 | # Shall skip authomatic update? 10 | if [[ $DEPOT_TOOLS_UPDATE != 0 ]]; then 11 | "$base_dir"/update_depot_tools "$@" 12 | case $? in 13 | 123) 14 | # msys environment was upgraded, need to quit. 15 | exit 0 16 | ;; 17 | 0) 18 | ;; 19 | *) 20 | exit $? 21 | esac 22 | fi 23 | fi 24 | 25 | # Ensure that "depot_tools" is somewhere in PATH so this tool can be used 26 | # standalone, but allow other PATH manipulations to take priority. 27 | PATH=$PATH:$base_dir 28 | 29 | PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@" 30 | -------------------------------------------------------------------------------- /fetch_configs/infra.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Infra(config_util.Config): 13 | """Basic Config class for the Infrastructure repositories.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'infra_superproject', 19 | 'props': [], 20 | }, 21 | } 22 | 23 | @staticmethod 24 | def expected_root(_props): 25 | return '' 26 | 27 | 28 | def main(argv=None): 29 | return Infra().handle_args(argv) 30 | 31 | 32 | if __name__ == '__main__': 33 | sys.exit(main(sys.argv)) 34 | -------------------------------------------------------------------------------- /fetch_configs/webrtc_ios.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class WebRTCIOS(config_util.Config): 13 | """Basic Config alias for iOS -> WebRTC.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'webrtc', 19 | 'props': ['--target_os=ios,mac'], 20 | }, 21 | } 22 | 23 | @staticmethod 24 | def expected_root(_props): 25 | return 'src' 26 | 27 | 28 | def main(argv=None): 29 | return WebRTCIOS().handle_args(argv) 30 | 31 | 32 | if __name__ == '__main__': 33 | sys.exit(main(sys.argv)) 34 | -------------------------------------------------------------------------------- /git_squash_branch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | import argparse 7 | import sys 8 | 9 | import git_common 10 | 11 | 12 | def main(args): 13 | parser = argparse.ArgumentParser() 14 | parser.add_argument( 15 | '-m', 16 | '--message', 17 | metavar='', 18 | default=None, 19 | help='Use the given as the first line of the commit message.') 20 | opts = parser.parse_args(args) 21 | if git_common.is_dirty_git_tree('squash-branch'): 22 | return 1 23 | git_common.squash_current_branch(opts.message) 24 | return 0 25 | 26 | 27 | if __name__ == '__main__': 28 | try: 29 | sys.exit(main(sys.argv[1:])) 30 | except KeyboardInterrupt: 31 | sys.stderr.write('interrupted\n') 32 | sys.exit(1) 33 | -------------------------------------------------------------------------------- /fetch_configs/android.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Android(config_util.Config): 13 | """Basic Config alias for Android -> Chromium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'chromium', 19 | 'props': ['--target_os=android'], 20 | }, 21 | } 22 | 23 | @staticmethod 24 | def expected_root(_props): 25 | return '' 26 | 27 | 28 | def main(argv=None): 29 | return Android().handle_args(argv) 30 | 31 | 32 | if __name__ == '__main__': 33 | sys.exit(main(sys.argv)) 34 | -------------------------------------------------------------------------------- /fetch_configs/ios.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class IOS(config_util.Config): 13 | """Basic Config alias for iOS -> Chromium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'chromium', 19 | 'props': ['--target_os=ios', '--target_os_only=True'], 20 | }, 21 | } 22 | 23 | @staticmethod 24 | def expected_root(_props): 25 | return '' 26 | 27 | 28 | def main(argv=None): 29 | return IOS().handle_args(argv) 30 | 31 | 32 | if __name__ == '__main__': 33 | sys.exit(main(sys.argv)) 34 | -------------------------------------------------------------------------------- /fetch_configs/webrtc_android.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class WebRTCAndroid(config_util.Config): 13 | """Basic Config alias for Android -> WebRTC.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'webrtc', 19 | 'props': ['--target_os=android,unix'], 20 | }, 21 | } 22 | 23 | @staticmethod 24 | def expected_root(_props): 25 | return 'src' 26 | 27 | 28 | def main(argv=None): 29 | return WebRTCAndroid().handle_args(argv) 30 | 31 | 32 | if __name__ == '__main__': 33 | sys.exit(main(sys.argv)) 34 | -------------------------------------------------------------------------------- /ninja_reclient.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2023 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | """This script is a wrapper around the ninja.py script that also 6 | handles the client lifecycle safely. It will automatically start 7 | reproxy before running ninja and stop reproxy when ninja stops 8 | for any reason eg. build completes, keyboard interupt etc.""" 9 | 10 | import sys 11 | 12 | import ninja 13 | import reclient_helper 14 | 15 | 16 | def main(argv): 17 | with reclient_helper.build_context(argv, "ninja_reclient") as ret_code: 18 | if ret_code: 19 | return ret_code 20 | try: 21 | return ninja.main(argv) 22 | except KeyboardInterrupt: 23 | print("Shutting down reproxy...", file=sys.stderr) 24 | return 1 25 | 26 | 27 | if __name__ == "__main__": 28 | sys.exit(main(sys.argv)) 29 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import os 6 | import subprocess 7 | 8 | 9 | def depot_tools_version(): 10 | depot_tools_root = os.path.dirname(os.path.abspath(__file__)) 11 | try: 12 | commit_hash = subprocess.check_output(['git', 'rev-parse', 'HEAD'], 13 | cwd=depot_tools_root).decode( 14 | 'utf-8', 'ignore') 15 | return 'git-%s' % commit_hash 16 | except Exception: 17 | pass 18 | 19 | # git check failed, let's check last modification of frequently checked file 20 | try: 21 | mtime = os.path.getmtime( 22 | os.path.join(depot_tools_root, 'infra', 'config', 'recipes.cfg')) 23 | return 'recipes.cfg-%d' % (mtime) 24 | except Exception: 25 | return 'unknown' 26 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | # 5 | # Config file for the isort python module. 6 | # This is used to enforce import sorting standards. 7 | # 8 | # https://pycqa.github.io/isort/docs/configuration/options.html 9 | 10 | [settings] 11 | # Be compatible with `black` since it also matches what we want. 12 | profile = black 13 | 14 | line_length = 80 15 | length_sort = false 16 | force_single_line = true 17 | lines_after_imports = 2 18 | from_first = false 19 | case_sensitive = false 20 | force_sort_within_sections = true 21 | order_by_type = false 22 | 23 | # Ignore generated files. 24 | extend_skip_glob = *_pb2.py 25 | 26 | # Allow importing multiple classes on a single line from these modules. 27 | # https://google.github.io/styleguide/pyguide#s2.2-imports 28 | single_line_exclusions = 29 | abc, 30 | collections.abc, 31 | typing, 32 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/tests/get_change_description.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine.post_process import (DropExpectation, StatusSuccess, MustRun, 6 | DoesNotRun) 7 | 8 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 9 | 10 | DEPS = [ 11 | 'tryserver', 12 | 'recipe_engine/buildbucket', 13 | 'recipe_engine/step', 14 | ] 15 | 16 | 17 | def RunSteps(api): 18 | api.tryserver.get_change_description() 19 | api.tryserver.get_change_description() 20 | 21 | 22 | def GenTests(api): 23 | yield api.test( 24 | 'basic', 25 | api.buildbucket.try_build(), 26 | api.post_process(MustRun, 'gerrit changes'), 27 | api.post_process(DoesNotRun, 'gerrit changes (2)'), 28 | api.post_process(StatusSuccess), 29 | api.post_process(DropExpectation), 30 | ) 31 | -------------------------------------------------------------------------------- /fetch_configs/chrome.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Chrome(config_util.Config): 13 | """Basic Config alias for Chrome -> Chromium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'chromium', 19 | 'props': [ 20 | '--internal=True', 21 | ], 22 | }, 23 | } 24 | 25 | @staticmethod 26 | def expected_root(_props): 27 | return '' 28 | 29 | 30 | def main(argv=None): 31 | return Chrome().handle_args(argv) 32 | 33 | 34 | if __name__ == '__main__': 35 | sys.exit(main(sys.argv)) 36 | -------------------------------------------------------------------------------- /fetch_configs/android_internal.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class AndroidInternal(config_util.Config): 13 | """Basic Config alias for AndroidInternal -> Chromium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 'chromium', 19 | 'props': ['--target_os=android', '--internal=True'], 20 | }, 21 | } 22 | 23 | @staticmethod 24 | def expected_root(_props): 25 | return '' 26 | 27 | 28 | def main(argv=None): 29 | return AndroidInternal().handle_args(argv) 30 | 31 | 32 | if __name__ == '__main__': 33 | sys.exit(main(sys.argv)) 34 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine.post_process import (DropExpectation, StatusSuccess, 6 | StepCommandContains) 7 | 8 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 9 | 10 | DEPS = [ 11 | 'gerrit', 12 | 'tryserver', 13 | 'recipe_engine/buildbucket', 14 | 'recipe_engine/step', 15 | ] 16 | 17 | 18 | def RunSteps(api): 19 | api.step(name='print owner', 20 | cmd=['echo', str(api.tryserver.gerrit_change_owner)]) 21 | 22 | 23 | def GenTests(api): 24 | yield api.test( 25 | 'basic', 26 | api.buildbucket.try_build(), 27 | api.post_process(StepCommandContains, 'print owner', 28 | ['echo', "{'name': 'John Doe'}"]), 29 | api.post_process(StatusSuccess), 30 | api.post_process(DropExpectation), 31 | ) 32 | -------------------------------------------------------------------------------- /recipes/recipe_modules/bot_update/tests/download_topics.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | 7 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 8 | 9 | DEPS = [ 10 | 'bot_update', 11 | 'gclient', 12 | 'recipe_engine/json', 13 | ] 14 | 15 | 16 | def RunSteps(api): 17 | api.gclient.set_config('depot_tools') 18 | api.bot_update.ensure_checkout() 19 | api.bot_update.ensure_checkout(download_topics=True) 20 | 21 | 22 | def GenTests(api): 23 | yield (api.test('basic') + api.post_process(post_process.StatusSuccess) + 24 | api.post_process(post_process.DropExpectation)) 25 | 26 | yield (api.test('failure', status="INFRA_FAILURE") + api.override_step_data( 27 | 'bot_update', api.json.output({'did_run': True}), retcode=1) + 28 | api.post_process(post_process.StatusAnyFailure) + 29 | api.post_process(post_process.DropExpectation)) 30 | -------------------------------------------------------------------------------- /fetch_configs/infra_internal.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class InfraInternal(config_util.Config): 13 | """Basic Config class for the whole set of Infrastructure repositories.""" 14 | @staticmethod 15 | def fetch_spec(_props): 16 | return { 17 | 'alias': { 18 | 'config': 'infra_superproject', 19 | 'props': [ 20 | '--checkout_internal=True', 21 | ], 22 | }, 23 | } 24 | 25 | @staticmethod 26 | def expected_root(_props): 27 | return '' 28 | 29 | 30 | def main(argv=None): 31 | return InfraInternal().handle_args(argv) 32 | 33 | 34 | if __name__ == '__main__': 35 | sys.exit(main(sys.argv)) 36 | -------------------------------------------------------------------------------- /upload_metrics.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vpython3 2 | # Copyright (c) 2018 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | import http 7 | import sys 8 | import urllib.error 9 | import urllib.request 10 | 11 | import auth 12 | import metrics_utils 13 | 14 | 15 | def main(): 16 | metrics = input() 17 | try: 18 | headers = {} 19 | if 'bot_metrics' in metrics: 20 | token = auth.Authenticator().get_access_token().token 21 | headers = {'Authorization': 'Bearer ' + token} 22 | urllib.request.urlopen( 23 | urllib.request.Request(url=metrics_utils.APP_URL + '/upload', 24 | data=metrics.encode('utf-8'), 25 | headers=headers)) 26 | except (urllib.error.HTTPError, urllib.error.URLError, 27 | http.client.RemoteDisconnected): 28 | pass 29 | 30 | return 0 31 | 32 | 33 | if __name__ == '__main__': 34 | sys.exit(main()) 35 | -------------------------------------------------------------------------------- /bootstrap/manifest.txt: -------------------------------------------------------------------------------- 1 | # CIPD manifest for bootstrapping tools. 2 | # 3 | # We must install anything that we want included on PATH to a different 4 | # subdirectory than Git, as Git's msys bash strips its root directory 5 | # from PATH, hence the subdirs. 6 | # 7 | # If any paths or package layouts change, updates will be required in 8 | # "win_tools.bat", "bootstrap.py" and "../bootstrap_python3" templates. 9 | # 10 | # "win_tools.bat" has a hard requirement that the Python packages contain the 11 | # string "cpython3/" for Python 3, and ends with the CIPD tag "version:VERSION". 12 | # It uses this to extract VERSION. 13 | # 14 | # "bootstrap_python3" has a hard requirement that the Python package contains 15 | # the string "cpython3/" and ends with the CIPD tag "version:VERSION". 16 | # It uses this to extract VERSION. 17 | 18 | $VerifiedPlatform windows-amd64 windows-arm64 linux-amd64 mac-amd64 mac-arm64 19 | 20 | @Subdir python3 21 | infra/3pp/tools/cpython3/${platform} version:2@3.11.6.chromium.30 22 | 23 | @Subdir git 24 | infra/3pp/tools/git/${platform} version:2@2.41.0.chromium.11 25 | -------------------------------------------------------------------------------- /git_freezer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2014 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | import sys 7 | import optparse 8 | 9 | import subcommand 10 | 11 | from git_common import freeze, thaw 12 | 13 | 14 | def CMDfreeze(parser, args): 15 | """Freeze a branch's changes, excluding unstaged gitlinks changes.""" 16 | parser.parse_args(args) 17 | return freeze() 18 | 19 | 20 | def CMDthaw(parser, args): 21 | """Returns a frozen branch to the state before it was frozen.""" 22 | parser.parse_args(args) 23 | return thaw() 24 | 25 | 26 | def main(args): 27 | dispatcher = subcommand.CommandDispatcher(__name__) 28 | ret = dispatcher.execute(optparse.OptionParser(), args) 29 | if ret: 30 | print(ret) 31 | return 0 32 | 33 | 34 | if __name__ == '__main__': 35 | try: 36 | sys.exit(main(sys.argv[1:])) 37 | except KeyboardInterrupt: 38 | sys.stderr.write('interrupted\n') 39 | sys.exit(1) 40 | -------------------------------------------------------------------------------- /tests/git_cl_creds_check_report.txt: -------------------------------------------------------------------------------- 1 | .gitcookies problem report: 2 | 3 | .googlesource.com wildcard record detected: 4 | 5 | Chrome Infrastructure team recommends to list full host names explicitly. 6 | 7 | The following hosts were defined twice: 8 | 9 | dup.googlesource.com 10 | 11 | Credentials should come in pairs for Git and Gerrit hosts. These hosts are missing: 12 | 13 | gpartial-review.googlesource.com but gpartial.googlesource.com defined 14 | partial.googlesource.com but partial-review.googlesource.com defined 15 | 16 | The following Git hosts have differing credentials from their Gerrit counterparts: 17 | 18 | conflict.googlesource.com git-example.google.com vs git-example.chromium.org 19 | 20 | You can manually remove corresponding lines in your ~%(sep)s.gitcookies file and visit the following URLs with correct account to generate correct credential lines: 21 | 22 | https://conflict.googlesource.com/new-password 23 | https://gpartial.googlesource.com/new-password 24 | https://partial.googlesource.com/new-password 25 | -------------------------------------------------------------------------------- /third_party/schema/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | import codecs 4 | import schema 5 | 6 | 7 | setup( 8 | name=schema.__name__, 9 | version=schema.__version__, 10 | author="Vladimir Keleshev", 11 | author_email="vladimir@keleshev.com", 12 | description="Simple data validation library", 13 | license="MIT", 14 | keywords="schema json validation", 15 | url="https://github.com/keleshev/schema", 16 | py_modules=['schema'], 17 | long_description=codecs.open('README.rst', 'r', 'utf-8').read(), 18 | classifiers=[ 19 | "Development Status :: 3 - Alpha", 20 | "Topic :: Utilities", 21 | "Programming Language :: Python :: 2.6", 22 | "Programming Language :: Python :: 2.7", 23 | "Programming Language :: Python :: 3.2", 24 | "Programming Language :: Python :: 3.3", 25 | "Programming Language :: Python :: 3.4", 26 | "Programming Language :: Python :: 3.5", 27 | "Programming Language :: Python :: Implementation :: PyPy", 28 | "License :: OSI Approved :: MIT License", 29 | ], 30 | ) 31 | -------------------------------------------------------------------------------- /third_party/schema/tox.ini: -------------------------------------------------------------------------------- 1 | # Tox (http://tox.testrun.org/) is a tool for running tests in 2 | # multiple virtualenvs. This configuration file will run the 3 | # test suite on all supported python versions. To use it, "pip 4 | # install tox" and then run "tox" from this directory. 5 | 6 | [tox] 7 | envlist = py26, py27, py32, py33, py34, py35, pypy, pypy3, coverage, pep8 8 | 9 | [testenv] 10 | commands = py.test 11 | deps = pytest 12 | 13 | 14 | [testenv:py27] 15 | commands = py.test --doctest-glob=README.rst # test documentation 16 | deps = pytest 17 | 18 | [testenv:pep8] 19 | # pep8 disabled for E701 (multiple statements on one line) and E126 (continuation line over-indented for hanging indent) 20 | commands = flake8 --max-line-length=90 --show-source -v --count --ignore=E701,E126 21 | deps = flake8 22 | 23 | [testenv:coverage] 24 | #TODO: how to force this on py27? 25 | commands = coverage erase 26 | py.test --doctest-glob=README.rst --cov schema 27 | coverage report -m 28 | deps = pytest 29 | pytest-cov 30 | coverage 31 | 32 | [flake8] 33 | exclude=.venv,.git,.tox 34 | -------------------------------------------------------------------------------- /fetch_configs/ios_internal.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class IOSInternal(config_util.Config): 13 | """Basic Config class for Chrome on iOS.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | return { 17 | 'alias': { 18 | 'config': 19 | 'chromium', 20 | 'props': [ 21 | '--internal=True', 22 | '--target_os=ios', 23 | '--target_os_only=True', 24 | ], 25 | }, 26 | } 27 | 28 | @staticmethod 29 | def expected_root(_props): 30 | return '' 31 | 32 | 33 | def main(argv=None): 34 | return IOSInternal().handle_args(argv) 35 | 36 | 37 | if __name__ == '__main__': 38 | sys.exit(main(sys.argv)) 39 | -------------------------------------------------------------------------------- /man/src/demo_repo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . common_demo_functions.sh 4 | 5 | TDIR=$(mktemp --tmpdir -d demo_repo.XXXXXXXXXX) 6 | trap "rm -rf $TDIR" EXIT 7 | 8 | cd $TDIR 9 | silent git clone "$REMOTE" . 10 | silent git reset --hard stage_1 11 | silent git update-ref refs/remotes/origin/main stage_1 12 | silent git tag -d $(git tag -l 'stage_*') 13 | silent git checkout origin/main 14 | silent git branch -d main 15 | silent git config color.ui always 16 | 17 | if [[ ! "$BLANK_DEMO" ]] 18 | then 19 | silent git new-branch cool_feature 20 | 21 | c "Add widget" 22 | c "Refactor spleen" 23 | silent git tag spleen_tag 24 | 25 | c "another improvement" 26 | 27 | silent git new-branch --upstream_current subfeature 28 | c "slick commenting action" 29 | c "integrate with CoolService" 30 | 31 | silent git checkout cool_feature 32 | c "Respond to CL comments" 33 | 34 | silent git new-branch fixit 35 | c "Epic README update" 36 | c "Add neat feature" 37 | 38 | silent git new-branch --upstream_current frozen_branch 39 | c "a deleted file" 40 | c "modfile" 41 | c "FREEZE.unindexed" 42 | fi 43 | 44 | -------------------------------------------------------------------------------- /bootstrap/manifest_bleeding_edge.txt: -------------------------------------------------------------------------------- 1 | # CIPD manifest for bootstrapping tools. 2 | # 3 | # We must install anything that we want included on PATH to a different 4 | # subdirectory than Git, as Git's msys bash strips its root directory 5 | # from PATH, hence the subdirs. 6 | # 7 | # If any paths or package layouts change, updates will be required in 8 | # "win_tools.bat", "bootstrap.py" and "../bootstrap_python3" templates. 9 | # 10 | # "win_tools.bat" has a hard requirement that the Python packages contain the 11 | # string "cpython3/" for Python 3, and ends with the CIPD tag "version:VERSION". 12 | # It uses this to extract VERSION. 13 | # 14 | # "bootstrap_python3" has a hard requirement that the Python package contains 15 | # the string "cpython3/" and ends with the CIPD tag "version:VERSION". 16 | # It uses this to extract VERSION. 17 | 18 | $VerifiedPlatform windows-386 windows-amd64 linux-amd64 mac-amd64 mac-arm64 19 | $VerifiedPlatform windows-arm64 20 | 21 | @Subdir python3 22 | infra/3pp/tools/cpython3/${platform} version:2@3.11.6.chromium.30 23 | 24 | @Subdir git 25 | infra/3pp/tools/git/${platform} version:2@2.41.0.chromium.11 26 | -------------------------------------------------------------------------------- /recipes/recipe_modules/bot_update/__init__.py: -------------------------------------------------------------------------------- 1 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 2 | 3 | DEPS = [ 4 | 'depot_tools', 5 | 'gclient', 6 | 'gerrit', 7 | 'gitiles', 8 | 'gsutil', 9 | 'recipe_engine/archive', 10 | 'recipe_engine/buildbucket', 11 | 'recipe_engine/context', 12 | 'recipe_engine/commit_position', 13 | 'recipe_engine/cq', 14 | 'recipe_engine/json', 15 | 'recipe_engine/led', 16 | 'recipe_engine/milo', 17 | 'recipe_engine/path', 18 | 'recipe_engine/platform', 19 | 'recipe_engine/properties', 20 | 'recipe_engine/raw_io', 21 | 'recipe_engine/runtime', 22 | 'recipe_engine/step', 23 | 'tryserver', 24 | ] 25 | 26 | from recipe_engine.recipe_api import Property 27 | 28 | PROPERTIES = { 29 | # Gerrit patches will have all properties about them prefixed with patch_. 30 | 'deps_revision_overrides': Property(default={}), 31 | 'fail_patch': Property(default=None, kind=str), 32 | 33 | '$depot_tools/bot_update': Property( 34 | help='Properties specific to bot_update module.', 35 | param_name='properties', 36 | default={}, 37 | ), 38 | } 39 | -------------------------------------------------------------------------------- /bootstrap_python3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function bootstrap_python3 { 4 | base_dir=$(dirname "${BASH_SOURCE[0]}") 5 | 6 | cd "${base_dir}" 7 | 8 | if [ -e ".bleeding_edge" ]; then 9 | CIPD_MANIFEST="bootstrap/manifest_bleeding_edge.txt" 10 | else 11 | CIPD_MANIFEST="bootstrap/manifest.txt" 12 | fi 13 | 14 | while IFS= read -r line; do 15 | if [[ $line =~ ^[^#].*cpython3/.*version:(.*)$ ]]; then 16 | PYTHON3_VERSION=${BASH_REMATCH[1]} 17 | PYTHON3_VERSION=${PYTHON3_VERSION//[[:space:]]/} 18 | fi 19 | done < $CIPD_MANIFEST 20 | if [ "X$PYTHON3_VERSION" == "X" ]; then 21 | echo Could not extract Python 3 version from manifest. 22 | return 1 23 | fi 24 | 25 | BOOTSTRAP_PATH="bootstrap-${PYTHON3_VERSION}_bin" 26 | 27 | # Install CIPD packages. The CIPD client self-bootstraps. 28 | "./cipd" ensure -log-level warning -ensure-file "${CIPD_MANIFEST}" \ 29 | -root "$BOOTSTRAP_PATH" 30 | 31 | BOOTSTRAP_PYTHON_BIN="${BOOTSTRAP_PATH}/python3/bin/python3" 32 | "$BOOTSTRAP_PYTHON_BIN" "bootstrap/bootstrap.py" --bootstrap-name "$BOOTSTRAP_PATH" 33 | 34 | cd - > /dev/null 35 | } 36 | -------------------------------------------------------------------------------- /fetch_configs/skia.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Skia(config_util.Config): 13 | """Basic Config class for the Skia repository.""" 14 | @staticmethod 15 | def fetch_spec(_props): 16 | solution = { 17 | 'name': 'skia', 18 | 'url': 'https://skia.googlesource.com/skia.git', 19 | 'deps_file': 'DEPS', 20 | 'managed': False, 21 | } 22 | spec = {'solutions': [solution]} 23 | return { 24 | 'type': 'gclient_git', 25 | 'gclient_git_spec': spec, 26 | } 27 | 28 | @staticmethod 29 | def expected_root(_props): 30 | return 'skia' 31 | 32 | 33 | def main(argv=None): 34 | return Skia().handle_args(argv) 35 | 36 | 37 | if __name__ == '__main__': 38 | sys.exit(main(sys.argv)) 39 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | 7 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 8 | 9 | DEPS = [ 10 | 'gerrit', 11 | 'recipe_engine/buildbucket', 12 | 'recipe_engine/properties', 13 | 'recipe_engine/step', 14 | 'tryserver', 15 | ] 16 | 17 | 18 | def RunSteps(api): 19 | api.step(name=api.tryserver.gerrit_change_target_ref or 'None!', cmd=None) 20 | 21 | 22 | def GenTests(api): 23 | yield api.test( 24 | 'works', 25 | api.buildbucket.try_build( 26 | 'chromium', 27 | 'linux', 28 | git_repo='https://chromium.googlesource.com/chromium/src', 29 | change_number=91827, 30 | patch_set=1), 31 | api.tryserver.gerrit_change_target_ref('refs/branch-heads/custom'), 32 | api.post_check( 33 | lambda check, steps: check('refs/branch-heads/custom' in steps)), 34 | api.post_process(post_process.DropExpectation)) 35 | -------------------------------------------------------------------------------- /fetch_configs/syzygy.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Syzygy(config_util.Config): 13 | """Basic Config class for Syzygy.""" 14 | @staticmethod 15 | def fetch_spec(_props): 16 | return { 17 | 'type': 'gclient_git', 18 | 'gclient_git_spec': { 19 | 'solutions': [{ 20 | 'name': 'src', 21 | 'url': 'https://chromium.googlesource.com/syzygy', 22 | 'deps_file': 'DEPS', 23 | 'managed': False, 24 | }], 25 | }, 26 | } 27 | 28 | @staticmethod 29 | def expected_root(_props): 30 | return 'src' 31 | 32 | 33 | def main(argv=None): 34 | return Syzygy().handle_args(argv) 35 | 36 | 37 | if __name__ == '__main__': 38 | sys.exit(main(sys.argv)) 39 | -------------------------------------------------------------------------------- /fetch_configs/gn.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Gn(config_util.Config): 13 | """Basic Config class for Gn.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://gn.googlesource.com/gn.git' 17 | solution = { 18 | 'name': 'gn', 19 | 'url': url, 20 | 'deps_file': 'DEPS', 21 | 'managed': False, 22 | } 23 | spec = { 24 | 'solutions': [solution], 25 | } 26 | return { 27 | 'type': 'gclient_git', 28 | 'gclient_git_spec': spec, 29 | } 30 | 31 | @staticmethod 32 | def expected_root(_props): 33 | return 'gn' 34 | 35 | 36 | def main(argv=None): 37 | return Gn().handle_args(argv) 38 | 39 | 40 | if __name__ == '__main__': 41 | sys.exit(main(sys.argv)) 42 | -------------------------------------------------------------------------------- /third_party/schema/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Vladimir Keleshev, 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /fetch_configs/skia_buildbot.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class SkiaBuildbot(config_util.Config): 13 | """Basic Config class for the Skia Buildbot repository.""" 14 | @staticmethod 15 | def fetch_spec(_props): 16 | solution = { 17 | 'name': 'buildbot', 18 | 'url': 'https://skia.googlesource.com/buildbot.git', 19 | 'deps_file': 'DEPS', 20 | 'managed': False, 21 | } 22 | spec = {'solutions': [solution]} 23 | return { 24 | 'type': 'gclient_git', 25 | 'gclient_git_spec': spec, 26 | } 27 | 28 | @staticmethod 29 | def expected_root(_props): 30 | return 'buildbot' 31 | 32 | 33 | def main(argv=None): 34 | return SkiaBuildbot().handle_args(argv) 35 | 36 | 37 | if __name__ == '__main__': 38 | sys.exit(main(sys.argv)) 39 | -------------------------------------------------------------------------------- /fetch_configs/inspector_protocol.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class InspectorProtocol(config_util.Config): 13 | @staticmethod 14 | def fetch_spec(props): 15 | url = 'https://chromium.googlesource.com/deps/inspector_protocol.git' 16 | solution = { 17 | 'name': 'src', 18 | 'url': url, 19 | 'managed': False, 20 | 'custom_deps': {}, 21 | } 22 | spec = { 23 | 'solutions': [solution], 24 | } 25 | return { 26 | 'type': 'gclient_git', 27 | 'gclient_git_spec': spec, 28 | } 29 | 30 | @staticmethod 31 | def expected_root(_props): 32 | return 'src' 33 | 34 | 35 | def main(argv=None): 36 | return InspectorProtocol().handle_args(argv) 37 | 38 | 39 | if __name__ == '__main__': 40 | sys.exit(main(sys.argv)) 41 | -------------------------------------------------------------------------------- /fetch_configs/gyp.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Chromium(config_util.Config): 13 | """Basic Config class for Chromium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/external/gyp.git' 17 | solution = { 18 | 'name': 'gyp', 19 | 'url': url, 20 | 'managed': False, 21 | 'custom_deps': {}, 22 | } 23 | spec = { 24 | 'solutions': [solution], 25 | } 26 | return { 27 | 'type': 'gclient_git', 28 | 'gclient_git_spec': spec, 29 | } 30 | 31 | @staticmethod 32 | def expected_root(_props): 33 | return 'gyp' 34 | 35 | 36 | def main(argv=None): 37 | return Chromium().handle_args(argv) 38 | 39 | 40 | if __name__ == '__main__': 41 | sys.exit(main(sys.argv)) 42 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | 7 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 8 | 9 | DEPS = [ 10 | 'gerrit', 11 | 'recipe_engine/buildbucket', 12 | 'recipe_engine/properties', 13 | 'tryserver', 14 | ] 15 | 16 | 17 | def RunSteps(api): 18 | api.tryserver.gerrit_change_fetch_ref 19 | 20 | 21 | def GenTests(api): 22 | yield (api.test('timeout', status="INFRA_FAILURE") + 23 | api.buildbucket.try_build( 24 | 'chromium', 25 | 'linux', 26 | git_repo='https://chromium.googlesource.com/chromium/src', 27 | change_number=91827, 28 | patch_set=1) + 29 | api.tryserver.gerrit_change_target_ref('refs/heads/main') + 30 | api.override_step_data('gerrit fetch current CL info', 31 | times_out_after=1200) + 32 | api.post_process(post_process.StatusException) + 33 | api.post_process(post_process.DropExpectation)) 34 | -------------------------------------------------------------------------------- /fetch_configs/website.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Website(config_util.Config): 13 | """Basic Config class for Chromium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/website.git' 17 | solution = { 18 | 'name': 'website', 19 | 'url': url, 20 | 'managed': False, 21 | 'custom_deps': {}, 22 | } 23 | spec = { 24 | 'solutions': [solution], 25 | } 26 | return { 27 | 'type': 'gclient_git', 28 | 'gclient_git_spec': spec, 29 | } 30 | 31 | @staticmethod 32 | def expected_root(_props): 33 | return 'website' 34 | 35 | 36 | def main(argv=None): 37 | return Website().handle_args(argv) 38 | 39 | 40 | if __name__ == '__main__': 41 | sys.exit(main(sys.argv)) 42 | -------------------------------------------------------------------------------- /fetch_configs/goma_client.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class GomaClient(config_util.Config): 13 | """Basic Config class for Goma client.""" 14 | @staticmethod 15 | def fetch_spec(_props): 16 | return { 17 | 'type': 'gclient_git', 18 | 'gclient_git_spec': { 19 | 'solutions': [{ 20 | 'name': 'client', 21 | 'url': 22 | 'https://chromium.googlesource.com/infra/goma/client.git', 23 | 'deps_file': 'DEPS', 24 | 'managed': False, 25 | }], 26 | }, 27 | } 28 | 29 | @staticmethod 30 | def expected_root(_props): 31 | return 'client' 32 | 33 | 34 | def main(argv=None): 35 | return GomaClient().handle_args(argv) 36 | 37 | 38 | if __name__ == '__main__': 39 | sys.exit(main(sys.argv)) 40 | -------------------------------------------------------------------------------- /fetch_configs/flutter.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Flutter(config_util.Config): 13 | """Basic Config class for the Flutter repository.""" 14 | @staticmethod 15 | def fetch_spec(_props): 16 | solution = { 17 | 'custom_deps': {}, 18 | 'deps_file': 'DEPS', 19 | 'managed': False, 20 | 'name': 'src/flutter', 21 | 'safesync_url': '', 22 | 'url': 'https://github.com/flutter/engine.git', 23 | } 24 | spec = {'solutions': [solution]} 25 | return { 26 | 'type': 'gclient_git', 27 | 'gclient_git_spec': spec, 28 | } 29 | 30 | @staticmethod 31 | def expected_root(_props): 32 | return 'src' 33 | 34 | 35 | def main(argv=None): 36 | return Flutter().handle_args(argv) 37 | 38 | 39 | if __name__ == '__main__': 40 | sys.exit(main(sys.argv)) 41 | -------------------------------------------------------------------------------- /fetch_configs/crashpad.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class CrashpadConfig(config_util.Config): 13 | """Basic Config class for Crashpad.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | spec = { 17 | 'solutions': [ 18 | { 19 | 'name': 'crashpad', 20 | 'url': 21 | 'https://chromium.googlesource.com/crashpad/crashpad.git', 22 | 'managed': False, 23 | }, 24 | ], 25 | } 26 | return { 27 | 'type': 'gclient_git', 28 | 'gclient_git_spec': spec, 29 | } 30 | 31 | @staticmethod 32 | def expected_root(_props): 33 | return 'crashpad' 34 | 35 | 36 | def main(argv=None): 37 | return CrashpadConfig().handle_args(argv) 38 | 39 | 40 | if __name__ == '__main__': 41 | sys.exit(main(sys.argv)) 42 | -------------------------------------------------------------------------------- /fetch_configs/node-ci.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class NodeCI(config_util.Config): 13 | """Basic Config class for node-ci.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/v8/node-ci.git' 17 | return { 18 | 'type': 'gclient_git', 19 | 'gclient_git_spec': { 20 | 'solutions': [{ 21 | 'name': 'node-ci', 22 | 'url': url, 23 | 'deps_file': 'DEPS', 24 | 'managed': False, 25 | 'custom_deps': {}, 26 | }], 27 | }, 28 | } 29 | 30 | @staticmethod 31 | def expected_root(_props): 32 | return 'node-ci' 33 | 34 | 35 | def main(argv=None): 36 | return NodeCI().handle_args(argv) 37 | 38 | 39 | if __name__ == '__main__': 40 | sys.exit(main(sys.argv)) 41 | -------------------------------------------------------------------------------- /recipes/recipe_modules/osx_sdk/examples/full.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'osx_sdk', 9 | 'recipe_engine/platform', 10 | 'recipe_engine/properties', 11 | 'recipe_engine/step', 12 | ] 13 | 14 | 15 | def RunSteps(api): 16 | with api.osx_sdk('mac'): 17 | api.step('gn', ['gn', 'gen', 'out/Release']) 18 | api.step('ninja', ['ninja', '-C', 'out/Release']) 19 | 20 | 21 | def GenTests(api): 22 | for platform in ('linux', 'mac', 'win'): 23 | yield (api.test(platform) + 24 | api.platform.name(platform)) 25 | 26 | yield api.test( 27 | 'explicit_version', 28 | api.platform.name('mac'), 29 | api.properties(**{'$depot_tools/osx_sdk': { 30 | 'sdk_version': 'deadbeef', 31 | }}) 32 | ) 33 | 34 | yield api.test( 35 | 'automatic_version', 36 | api.platform.name('mac'), 37 | api.platform.mac_release('10.15.6'), 38 | ) 39 | 40 | yield api.test( 41 | 'ancient_version', 42 | api.platform.name('mac'), 43 | api.platform.mac_release('10.1.0'), 44 | ) 45 | -------------------------------------------------------------------------------- /fetch_configs/v8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class V8(config_util.Config): 13 | """Basic Config class for V8.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/v8/v8.git' 17 | solution = { 18 | 'name': 'v8', 19 | 'url': url, 20 | 'deps_file': 'DEPS', 21 | 'managed': False, 22 | 'custom_deps': {}, 23 | } 24 | spec = { 25 | 'solutions': [solution], 26 | 'with_branch_heads': True, 27 | } 28 | return { 29 | 'type': 'gclient_git', 30 | 'gclient_git_spec': spec, 31 | } 32 | 33 | @staticmethod 34 | def expected_root(_props): 35 | return 'v8' 36 | 37 | 38 | def main(argv=None): 39 | return V8().handle_args(argv) 40 | 41 | 42 | if __name__ == '__main__': 43 | sys.exit(main(sys.argv)) 44 | -------------------------------------------------------------------------------- /metadata/discover.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import os 6 | from typing import List 7 | 8 | # The base names that are known to be Chromium metadata files. 9 | _METADATA_FILES = { 10 | "README.chromium", 11 | } 12 | 13 | 14 | def is_metadata_file(path: str) -> bool: 15 | """Filter for metadata files.""" 16 | return os.path.basename(path) in _METADATA_FILES 17 | 18 | 19 | def find_metadata_files(root: str) -> List[str]: 20 | """Finds all metadata files within the given root directory, 21 | including subdirectories. 22 | 23 | Args: 24 | root: the absolute path to the root directory within which to 25 | search. 26 | 27 | Returns: the absolute full paths for all the metadata files within 28 | the root directory. 29 | """ 30 | metadata_files = [] 31 | for item in os.listdir(root): 32 | full_path = os.path.join(root, item) 33 | if is_metadata_file(item): 34 | metadata_files.append(full_path) 35 | elif os.path.isdir(full_path): 36 | metadata_files.extend(find_metadata_files(full_path)) 37 | 38 | return metadata_files 39 | -------------------------------------------------------------------------------- /metadata/tests/data/README.chromium.test.multi-valid: -------------------------------------------------------------------------------- 1 | Name: Test-A README for Chromium metadata 2 | Short Name: metadata-test-valid 3 | URL: https://www.example.com/metadata, 4 | https://www.example.com/parser 5 | Version: 1.0.12 6 | Date: 2020-12-03 7 | License: Apache, 2.0 and MIT 8 | License File: LICENSE 9 | Security Critical: yes 10 | Shipped: yes 11 | CPEPrefix: unknown 12 | This line should be ignored because CPEPrefix is a one-liner field. 13 | Description: 14 | A test metadata file, with a 15 | multi-line description. 16 | 17 | Local Modifications: 18 | None, 19 | EXCEPT: 20 | * nothing. 21 | 22 | -------------------- DEPENDENCY DIVIDER -------------------- 23 | 24 | Name: Test-B README for Chromium metadata 25 | Short Name: metadata-test-valid-again 26 | URL: https://www.example.com/metadata 27 | Version: 1.0.12 28 | Date: 2020-12-03 29 | License: Apache, 2.0 and MIT 30 | License File: LICENSE 31 | Security Critical: yes 32 | Shipped: yes 33 | 34 | -------------------- DEPENDENCY DIVIDER -------------------- 35 | 36 | Name: Test-C README for Chromium metadata 37 | Short Name: metadata-test-valid-again 38 | URL: https://www.example.com/metadata 39 | Version: 1.0.12 40 | Date: 2020-12-03 41 | License: Apache, 2.0 and MIT 42 | License File: LICENSE 43 | Security Critical: yes 44 | Shipped in Chromium: yes 45 | -------------------------------------------------------------------------------- /fetch_configs/dart.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Dart(config_util.Config): 13 | """Basic Config class for Dart.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://dart.googlesource.com/sdk.git' 17 | solution = { 18 | 'name': 'sdk', 19 | 'url': url, 20 | 'deps_file': 'DEPS', 21 | 'managed': False, 22 | 'custom_deps': {}, 23 | } 24 | spec = { 25 | 'solutions': [solution], 26 | } 27 | if props.get('target_os'): 28 | spec['target_os'] = props['target_os'].split(',') 29 | return { 30 | 'type': 'gclient_git', 31 | 'gclient_git_spec': spec, 32 | } 33 | 34 | @staticmethod 35 | def expected_root(_props): 36 | return 'sdk' 37 | 38 | 39 | def main(argv=None): 40 | return Dart().handle_args(argv) 41 | 42 | 43 | if __name__ == '__main__': 44 | sys.exit(main(sys.argv)) 45 | -------------------------------------------------------------------------------- /autoninja: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) 2017 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # In git bash on Windows, invoke the batch file. 8 | if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then 9 | autoninja.bat "$@" 10 | exit 11 | fi 12 | 13 | # Set unique build ID if not already set by the user. 14 | AUTONINJA_BUILD_ID="${AUTONINJA_BUILD_ID:=$(python3 -c "import uuid; print(uuid.uuid4())")}" 15 | export AUTONINJA_BUILD_ID 16 | 17 | if [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then 18 | export NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es ] " 19 | fi 20 | 21 | # Execute whatever is printed by autoninja.py. 22 | # Also print it to reassure that the right settings are being used. 23 | vpython3 "$(dirname -- "$0")/autoninja.py" "$@" 24 | retval=$? 25 | 26 | if [ "$retval" == "0" ] && [ "$NINJA_SUMMARIZE_BUILD" == "1" ]; then 27 | python3 "$(dirname -- "$0")/post_build_ninja_summary.py" "$@" 28 | fi 29 | 30 | # Collect ninjalog from googler. 31 | python3 "$(dirname -- "$0")/ninjalog_uploader_wrapper.py" --cmdline "$@" 32 | 33 | # Pass-through autoninja's error code so that if a developer types: 34 | # "autoninja chrome && chrome" then chrome won't run if the build fails. 35 | exit $retval 36 | -------------------------------------------------------------------------------- /fetch_configs/depot_tools.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class DepotTools(config_util.Config): 13 | """Basic Config class for DepotTools.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' 17 | solution = { 18 | 'name': 'depot_tools', 19 | 'url': url, 20 | 'deps_file': 'DEPS', 21 | 'managed': False, 22 | } 23 | spec = { 24 | 'solutions': [solution], 25 | } 26 | checkout_type = 'gclient_git' 27 | spec_type = '%s_spec' % checkout_type 28 | return { 29 | 'type': checkout_type, 30 | spec_type: spec, 31 | } 32 | 33 | @staticmethod 34 | def expected_root(_props): 35 | return 'depot_tools' 36 | 37 | 38 | def main(argv=None): 39 | return DepotTools().handle_args(argv) 40 | 41 | 42 | if __name__ == '__main__': 43 | sys.exit(main(sys.argv)) 44 | -------------------------------------------------------------------------------- /recipes/recipe_modules/osx_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'recipe_engine/cipd', 9 | 'recipe_engine/context', 10 | 'recipe_engine/json', 11 | 'recipe_engine/path', 12 | 'recipe_engine/platform', 13 | 'recipe_engine/step', 14 | 'recipe_engine/version', 15 | ] 16 | 17 | from recipe_engine.recipe_api import Property 18 | from recipe_engine.config import ConfigGroup, Single 19 | 20 | PROPERTIES = { 21 | '$depot_tools/osx_sdk': Property( 22 | help='Properties specifically for the infra osx_sdk module.', 23 | param_name='sdk_properties', 24 | kind=ConfigGroup( # pylint: disable=line-too-long 25 | # XCode build version number. Internally maps to an XCode build id like 26 | # '9c40b'. See 27 | # 28 | # https://chrome-infra-packages.appspot.com/p/infra_internal/ios/xcode/mac/+/ 29 | # 30 | # For an up to date list of the latest SDK builds. 31 | sdk_version=Single(str), 32 | 33 | # The CIPD toolchain tool package and version 34 | toolchain_pkg=Single(str), 35 | toolchain_ver=Single(str), 36 | ), default={}, 37 | ) 38 | } 39 | -------------------------------------------------------------------------------- /recipes/recipe_modules/windows_sdk/examples/full.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'windows_sdk', 9 | 'recipe_engine/json', 10 | 'recipe_engine/platform', 11 | 'recipe_engine/properties', 12 | 'recipe_engine/step', 13 | ] 14 | 15 | 16 | def RunSteps(api): 17 | with api.windows_sdk(enabled=api.platform.is_win): 18 | api.step('gn', ['gn', 'gen', 'out/Release']) 19 | api.step('ninja', ['ninja', '-C', 'out/Release']) 20 | 21 | # bad arch 22 | try: 23 | with api.windows_sdk(target_arch='lolnope'): 24 | assert False, "never here" # pragma: no cover 25 | except ValueError: 26 | pass 27 | 28 | 29 | def GenTests(api): 30 | for platform in ('linux', 'mac', 'win'): 31 | yield api.test(platform) + api.platform.name(platform) 32 | yield api.test('new_sdk') + api.platform.name('win') + api.override_step_data( 33 | "read SetEnv json", 34 | api.json.output({ 35 | 'env': { 36 | 'PATH': [['Windows Kits', '10', 'bin', 'x64']], 37 | 'INCLUDE': 38 | [['Windows Kits', '10', 'Include', '10.0.19041.0', 'um']], 39 | }, 40 | })) 41 | -------------------------------------------------------------------------------- /recipes/recipe_modules/depot_tools/examples/full.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 6 | 7 | DEPS = [ 8 | 'depot_tools', 9 | 'recipe_engine/path', 10 | 'recipe_engine/platform', 11 | 'recipe_engine/runtime', 12 | 'recipe_engine/step', 13 | ] 14 | 15 | 16 | def RunSteps(api): 17 | api.step('root', ['ls', api.depot_tools.root]) 18 | 19 | api.step( 20 | 'download_from_google_storage', 21 | ['ls', api.depot_tools.download_from_google_storage_path]) 22 | 23 | api.step( 24 | 'upload_to_google_storage', 25 | ['ls', api.depot_tools.upload_to_google_storage_path]) 26 | 27 | api.step('cros', ['ls', api.depot_tools.cros_path]) 28 | 29 | api.step( 30 | 'gn_py_path', ['ls', api.depot_tools.gn_py_path]) 31 | 32 | api.step( 33 | 'gsutil_py_path', ['ls', api.depot_tools.gsutil_py_path]) 34 | 35 | api.step( 36 | 'presubmit_support_py_path', 37 | ['ls', api.depot_tools.presubmit_support_py_path]) 38 | 39 | with api.depot_tools.on_path(): 40 | api.step('on_path', ['echo', '$PATH']) 41 | 42 | 43 | def GenTests(api): 44 | yield api.test('basic') 45 | 46 | yield api.test('win') + api.platform('win', 32) 47 | -------------------------------------------------------------------------------- /fetch_configs/devtools-frontend.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class DevToolsFrontend(config_util.Config): 13 | """Basic Config class for DevTools frontend.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/devtools/devtools-frontend.git' 17 | solution = { 18 | 'name': 'devtools-frontend', 19 | 'url': url, 20 | 'deps_file': 'DEPS', 21 | 'managed': False, 22 | 'custom_deps': {}, 23 | } 24 | spec = { 25 | 'solutions': [solution], 26 | 'with_branch_heads': True, 27 | } 28 | return { 29 | 'type': 'gclient_git', 30 | 'gclient_git_spec': spec, 31 | } 32 | 33 | @staticmethod 34 | def expected_root(_props): 35 | return 'devtools-frontend' 36 | 37 | 38 | def main(argv=None): 39 | return DevToolsFrontend().handle_args(argv) 40 | 41 | 42 | if __name__ == '__main__': 43 | sys.exit(main(sys.argv)) 44 | -------------------------------------------------------------------------------- /recipes/recipe_modules/bot_update/tests/ensure_checkout.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | 7 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 8 | 9 | DEPS = [ 10 | 'bot_update', 11 | 'gclient', 12 | 'recipe_engine/json', 13 | ] 14 | 15 | 16 | def RunSteps(api): 17 | api.gclient.set_config('depot_tools') 18 | api.bot_update.ensure_checkout() 19 | api.bot_update.ensure_checkout(no_fetch_tags=True, enforce_fetch=True) 20 | 21 | 22 | def GenTests(api): 23 | yield ( 24 | api.test('basic') + 25 | api.post_process(post_process.StatusSuccess) + 26 | api.post_process(post_process.DropExpectation) 27 | ) 28 | 29 | yield (api.test('failure', status="INFRA_FAILURE") + api.override_step_data( 30 | 'bot_update', api.json.output({'did_run': True}), retcode=1) + 31 | api.post_process(post_process.StatusAnyFailure) + 32 | api.post_process(post_process.DropExpectation)) 33 | 34 | yield (api.test('cancelled', status="INFRA_FAILURE") + api.override_step_data( 35 | 'bot_update', api.json.output({'did_run': True}), cancel=True) + 36 | api.post_process(post_process.StatusAnyFailure) + 37 | api.post_process(post_process.DropExpectation)) 38 | -------------------------------------------------------------------------------- /fetch_configs/breakpad.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Breakpad(config_util.Config): 13 | @staticmethod 14 | def fetch_spec(props): 15 | url = 'https://chromium.googlesource.com/breakpad/breakpad.git' 16 | solution = { 17 | 'name': 'src', 18 | 'url': url, 19 | 'managed': False, 20 | 'custom_deps': {}, 21 | } 22 | spec = { 23 | 'solutions': [solution], 24 | } 25 | if props.get('target_os'): 26 | spec['target_os'] = props['target_os'].split(',') 27 | if props.get('target_os_only'): 28 | spec['target_os_only'] = props['target_os_only'] 29 | return { 30 | 'type': 'gclient_git', 31 | 'gclient_git_spec': spec, 32 | } 33 | 34 | @staticmethod 35 | def expected_root(_props): 36 | return 'src' 37 | 38 | 39 | def main(argv=None): 40 | return Breakpad().handle_args(argv) 41 | 42 | 43 | if __name__ == '__main__': 44 | sys.exit(main(sys.argv)) 45 | -------------------------------------------------------------------------------- /black: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vpython3 2 | # Copyright 2022 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | # Note: We use tags here instead of refs because refs will always hit the 7 | # network to see if there are any updates. 8 | 9 | # [VPYTHON:BEGIN] 10 | # python_version: "3.8" 11 | # 12 | # # Third party dependencies. These are only listed because pylint itself needs 13 | # # them. Feel free to add/remove anything here. 14 | # 15 | # wheel: < 16 | # name: "infra/python/wheels/click-py3" 17 | # version: "version:8.0.3" 18 | # > 19 | # wheel: < 20 | # name: "infra/python/wheels/mypy-extensions-py3" 21 | # version: "version:0.4.3" 22 | # > 23 | # wheel: < 24 | # name: "infra/python/wheels/pathspec-py3" 25 | # version: "version:0.9.0" 26 | # > 27 | # wheel: < 28 | # name: "infra/python/wheels/platformdirs-py3" 29 | # version: "version:2.5.2" 30 | # > 31 | # wheel: < 32 | # name: "infra/python/wheels/tomli-py3" 33 | # version: "version:1.1.0" 34 | # > 35 | # wheel: < 36 | # name: "infra/python/wheels/typing-extensions-py3" 37 | # version: "version:4.0.1" 38 | # > 39 | # 40 | # # Black itself. 41 | # 42 | # wheel: < 43 | # name: "infra/python/wheels/black-py3" 44 | # version: "version:22.3.0" 45 | # > 46 | # 47 | # [VPYTHON:END] 48 | 49 | import black.__main__ 50 | -------------------------------------------------------------------------------- /man/src/git-mark-merge-base.txt: -------------------------------------------------------------------------------- 1 | git-mark-merge-base(1) 2 | ====================== 3 | 4 | NAME 5 | ---- 6 | git-mark-merge-base - 7 | include::_git-mark-merge-base_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git mark-merge-base' 13 | 'git mark-merge-base' 14 | 'git mark-merge-base' [-d | --delete] 15 | 16 | DESCRIPTION 17 | ----------- 18 | 19 | Inspect, set or delete the current merge-base marker for the current branch. 20 | This should not be needed, but is useful if things get into a snarled state. 21 | Pass no arguments to view the current value. If you provide , then 22 | `git mark-merge-base` will attempt to set that as the merge-base value. 23 | 24 | It is invalid to pick a commit which is not an ancestor of the current branch. 25 | 26 | See linkgit:git-rebase-update[1]'s description of the `branch..base` 27 | configuration variable for more info on what the merge base markers are for. 28 | 29 | OPTIONS 30 | ------- 31 | 32 | -d:: 33 | --delete:: 34 | Delete the merge-base marker for the current branch. 35 | 36 | :: 37 | The new value to set for the current branch's merge-base marker. 38 | 39 | SEE ALSO 40 | -------- 41 | linkgit:git-rebase-update[1], linkgit:git-reparent-branch[1], 42 | linkgit:git-rename-branch[1], linkgit:git-upstream-diff[1] 43 | 44 | include::_footer.txt[] 45 | 46 | // vim: ft=asciidoc: 47 | -------------------------------------------------------------------------------- /fetch_configs/devtools-internal.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class DevToolsInternal(config_util.Config): 13 | """Basic Config class for the whole set of DevTools.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = ('https://chrome-internal.googlesource.com/devtools/' 17 | 'devtools-internal.git') 18 | solution = { 19 | 'name': 'devtools-internal', 20 | 'url': url, 21 | 'deps_file': 'DEPS', 22 | 'managed': False, 23 | 'custom_deps': {}, 24 | } 25 | spec = { 26 | 'solutions': [solution], 27 | 'with_branch_heads': True, 28 | } 29 | return { 30 | 'type': 'gclient_git', 31 | 'gclient_git_spec': spec, 32 | } 33 | 34 | @staticmethod 35 | def expected_root(_props): 36 | return 'devtools-internal' 37 | 38 | 39 | def main(argv=None): 40 | return DevToolsInternal().handle_args(argv) 41 | 42 | 43 | if __name__ == '__main__': 44 | sys.exit(main(sys.argv)) 45 | -------------------------------------------------------------------------------- /recipes/recipe_modules/gclient/test_api.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import hashlib 6 | 7 | from recipe_engine import recipe_test_api 8 | 9 | class GclientTestApi(recipe_test_api.RecipeTestApi): 10 | def diff_deps_test_data(self, files): 11 | return self.m.raw_io.stream_output_text( 12 | '\n'.join(['10>%s' % fname for fname in files])) 13 | 14 | def output_json(self, projects): 15 | """Deterministically synthesize json.output test data for gclient's 16 | --output-json option. 17 | 18 | Args: 19 | projects - a list of project paths (e.g. ['src', 'src/dependency']) 20 | """ 21 | # TODO(iannucci): Account for parent_got_revision_mapping. Right now the 22 | # synthesized json output from this method will always use 23 | # gen_revision(project), but if parent_got_revision and its ilk are 24 | # specified, we should use those values instead. 25 | return self.m.json.output({ 26 | 'solutions': dict( 27 | (p+'/', {'revision': self.gen_revision(p)}) 28 | for p in projects 29 | ) 30 | }) 31 | 32 | @staticmethod 33 | def gen_revision(project): 34 | """Hash project to bogus deterministic revision values.""" 35 | h = hashlib.sha1(project.encode('utf-8')) 36 | return h.hexdigest() 37 | -------------------------------------------------------------------------------- /update_depot_tools_toggle.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) 2017 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | """Small utility script to enable/disable `depot_tools` automatic updating.""" 6 | 7 | import argparse 8 | import datetime 9 | import os 10 | import sys 11 | 12 | DEPOT_TOOLS_ROOT = os.path.abspath(os.path.dirname(__file__)) 13 | SENTINEL_PATH = os.path.join(DEPOT_TOOLS_ROOT, '.disable_auto_update') 14 | 15 | 16 | def main(): 17 | parser = argparse.ArgumentParser() 18 | group = parser.add_mutually_exclusive_group(required=True) 19 | group.add_argument('--enable', 20 | action='store_true', 21 | help='Enable auto-updating.') 22 | group.add_argument('--disable', 23 | action='store_true', 24 | help='Disable auto-updating.') 25 | args = parser.parse_args() 26 | 27 | if args.enable: 28 | if os.path.exists(SENTINEL_PATH): 29 | os.unlink(SENTINEL_PATH) 30 | if args.disable: 31 | if not os.path.exists(SENTINEL_PATH): 32 | with open(SENTINEL_PATH, 'w') as fd: 33 | fd.write('Disabled by %s at %s\n' % 34 | (__file__, datetime.datetime.now())) 35 | return 0 36 | 37 | 38 | if __name__ == '__main__': 39 | sys.exit(main()) 40 | -------------------------------------------------------------------------------- /fetch_configs/angle.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import ast 6 | import sys 7 | 8 | import config_util # pylint: disable=import-error 9 | 10 | 11 | # This class doesn't need an __init__ method, so we disable the warning 12 | # pylint: disable=no-init 13 | class ANGLE(config_util.Config): 14 | """Basic Config class for ANGLE.""" 15 | @staticmethod 16 | def fetch_spec(props): 17 | url = 'https://chromium.googlesource.com/angle/angle.git' 18 | solution = { 19 | 'name': '.', 20 | 'url': url, 21 | 'deps_file': 'DEPS', 22 | 'managed': False, 23 | 'custom_vars': {}, 24 | } 25 | spec = {'solutions': [solution]} 26 | if props.get('target_os'): 27 | spec['target_os'] = props['target_os'].split(',') 28 | if ast.literal_eval(props.get('internal', 'False')): 29 | solution['custom_vars']['checkout_angle_internal'] = True 30 | return { 31 | 'type': 'gclient_git', 32 | 'gclient_git_spec': spec, 33 | } 34 | 35 | @staticmethod 36 | def expected_root(_props): 37 | return '' 38 | 39 | 40 | def main(argv=None): 41 | return ANGLE().handle_args(argv) 42 | 43 | 44 | if __name__ == '__main__': 45 | sys.exit(main(sys.argv)) 46 | -------------------------------------------------------------------------------- /recipes/recipe_modules/depot_tools/examples/full.expected/basic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "ls", 5 | "RECIPE_REPO[depot_tools]" 6 | ], 7 | "name": "root" 8 | }, 9 | { 10 | "cmd": [ 11 | "ls", 12 | "RECIPE_REPO[depot_tools]/download_from_google_storage.py" 13 | ], 14 | "name": "download_from_google_storage" 15 | }, 16 | { 17 | "cmd": [ 18 | "ls", 19 | "RECIPE_REPO[depot_tools]/upload_to_google_storage.py" 20 | ], 21 | "name": "upload_to_google_storage" 22 | }, 23 | { 24 | "cmd": [ 25 | "ls", 26 | "RECIPE_REPO[depot_tools]/cros" 27 | ], 28 | "name": "cros" 29 | }, 30 | { 31 | "cmd": [ 32 | "ls", 33 | "RECIPE_REPO[depot_tools]/gn.py" 34 | ], 35 | "name": "gn_py_path" 36 | }, 37 | { 38 | "cmd": [ 39 | "ls", 40 | "RECIPE_REPO[depot_tools]/gsutil.py" 41 | ], 42 | "name": "gsutil_py_path" 43 | }, 44 | { 45 | "cmd": [ 46 | "ls", 47 | "RECIPE_REPO[depot_tools]/presubmit_support.py" 48 | ], 49 | "name": "presubmit_support_py_path" 50 | }, 51 | { 52 | "cmd": [ 53 | "echo", 54 | "$PATH" 55 | ], 56 | "env_suffixes": { 57 | "DEPOT_TOOLS_UPDATE": [ 58 | "0" 59 | ], 60 | "PATH": [ 61 | "RECIPE_REPO[depot_tools]" 62 | ] 63 | }, 64 | "name": "on_path" 65 | }, 66 | { 67 | "name": "$result" 68 | } 69 | ] -------------------------------------------------------------------------------- /recipes/recipe_modules/depot_tools/examples/full.expected/win.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "ls", 5 | "RECIPE_REPO[depot_tools]" 6 | ], 7 | "name": "root" 8 | }, 9 | { 10 | "cmd": [ 11 | "ls", 12 | "RECIPE_REPO[depot_tools]\\download_from_google_storage.py" 13 | ], 14 | "name": "download_from_google_storage" 15 | }, 16 | { 17 | "cmd": [ 18 | "ls", 19 | "RECIPE_REPO[depot_tools]\\upload_to_google_storage.py" 20 | ], 21 | "name": "upload_to_google_storage" 22 | }, 23 | { 24 | "cmd": [ 25 | "ls", 26 | "RECIPE_REPO[depot_tools]\\cros" 27 | ], 28 | "name": "cros" 29 | }, 30 | { 31 | "cmd": [ 32 | "ls", 33 | "RECIPE_REPO[depot_tools]\\gn.py" 34 | ], 35 | "name": "gn_py_path" 36 | }, 37 | { 38 | "cmd": [ 39 | "ls", 40 | "RECIPE_REPO[depot_tools]\\gsutil.py" 41 | ], 42 | "name": "gsutil_py_path" 43 | }, 44 | { 45 | "cmd": [ 46 | "ls", 47 | "RECIPE_REPO[depot_tools]\\presubmit_support.py" 48 | ], 49 | "name": "presubmit_support_py_path" 50 | }, 51 | { 52 | "cmd": [ 53 | "echo", 54 | "$PATH" 55 | ], 56 | "env_suffixes": { 57 | "DEPOT_TOOLS_UPDATE": [ 58 | "0" 59 | ], 60 | "PATH": [ 61 | "RECIPE_REPO[depot_tools]" 62 | ] 63 | }, 64 | "name": "on_path" 65 | }, 66 | { 67 | "name": "$result" 68 | } 69 | ] -------------------------------------------------------------------------------- /fetch_configs/naclports.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Naclports(config_util.Config): 13 | """Basic Config class for naclports.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://chromium.googlesource.com/external/naclports.git' 17 | solution = { 18 | 'name': 'src', 19 | 'url': url, 20 | 'deps_file': 'DEPS', 21 | 'managed': False, 22 | 'custom_deps': {}, 23 | } 24 | spec = { 25 | 'solutions': [solution], 26 | } 27 | if props.get('target_os'): 28 | spec['target_os'] = props['target_os'].split(',') 29 | if props.get('target_os_only'): 30 | spec['target_os_only'] = props['target_os_only'] 31 | return { 32 | 'type': 'gclient_git', 33 | 'gclient_git_spec': spec, 34 | } 35 | 36 | @staticmethod 37 | def expected_root(_props): 38 | return 'src' 39 | 40 | 41 | def main(argv=None): 42 | return Naclports().handle_args(argv) 43 | 44 | 45 | if __name__ == '__main__': 46 | sys.exit(main(sys.argv)) 47 | -------------------------------------------------------------------------------- /fetch_configs/nacl.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class NaCl(config_util.Config): 13 | """Basic Config class for NaCl.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = ('https://chromium.googlesource.com/native_client/' 17 | 'src/native_client.git') 18 | solution = { 19 | 'name': 'native_client', 20 | 'url': url, 21 | 'deps_file': 'DEPS', 22 | 'managed': False, 23 | 'custom_deps': {}, 24 | } 25 | spec = { 26 | 'solutions': [solution], 27 | } 28 | if props.get('target_os'): 29 | spec['target_os'] = props['target_os'].split(',') 30 | if props.get('target_os_only'): 31 | spec['target_os_only'] = props['target_os_only'] 32 | return { 33 | 'type': 'gclient_git', 34 | 'gclient_git_spec': spec, 35 | } 36 | 37 | @staticmethod 38 | def expected_root(_props): 39 | return 'native_client' 40 | 41 | 42 | def main(argv=None): 43 | return NaCl().handle_args(argv) 44 | 45 | 46 | if __name__ == '__main__': 47 | sys.exit(main(sys.argv)) 48 | -------------------------------------------------------------------------------- /fetch_configs/node.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class Node(config_util.Config): 13 | """An alias of node-ci config that build upstream node.""" 14 | 15 | @staticmethod 16 | def fetch_spec(props): 17 | url = 'https://chromium.googlesource.com/v8/node-ci.git' 18 | return { 19 | 'type': 'gclient_git', 20 | 'gclient_git_spec': { 21 | 'solutions': [{ 22 | 'name': 'node', 23 | 'url': url, 24 | 'deps_file': 'DEPS', 25 | 'managed': False, 26 | 'custom_deps': {}, 27 | 'custom_vars': { 28 | 'build_upstream_node': True, 29 | 'node_url': 'https://github.com/nodejs/node.git', 30 | 'node_revision': 'main', 31 | }, 32 | }], 33 | }, 34 | } 35 | 36 | @staticmethod 37 | def expected_root(_props): 38 | return 'node' 39 | 40 | 41 | def main(argv=None): 42 | return Node().handle_args(argv) 43 | 44 | 45 | if __name__ == '__main__': 46 | sys.exit(main(sys.argv)) 47 | -------------------------------------------------------------------------------- /metadata/tests/data/README.chromium.test.multi-invalid: -------------------------------------------------------------------------------- 1 | Name: Test-A README for Chromium metadata (0 errors, 0 warnings) 2 | Short Name: metadata-test-valid 3 | URL: https://www.example.com/metadata, 4 | https://www.example.com/parser 5 | Version: 1.0.12 6 | Date: 2020-12-03 7 | License: Apache, 2.0 and MIT 8 | License File: LICENSE 9 | Security Critical: yes 10 | Shipped: yes 11 | CPEPrefix: unknown 12 | This line should be ignored because CPEPrefix is a one-liner field. 13 | Description: 14 | A test metadata file, with a 15 | multi-line description. 16 | 17 | Local Modifications: 18 | None, 19 | EXCEPT: 20 | * nothing. 21 | 22 | -------------------- DEPENDENCY DIVIDER -------------------- 23 | 24 | Name: Test-B README for Chromium metadata (4 errors, 1 warning) 25 | SHORT NAME: metadata-test-invalid 26 | URL: file://home/drive/chromium/src/metadata 27 | Version:0 28 | Date: 2020-12-03 29 | License: MIT 30 | Security critical: yes 31 | Shipped: Yes 32 | 33 | Description: 34 | 35 | Local Modifications: None. 36 | 37 | -------------------- DEPENDENCY DIVIDER -------------------- 38 | -------------------- DEPENDENCY DIVIDER -------------------- 39 | 40 | Name: Test-C README for Chromium metadata (5 errors, 1 warning) 41 | URL: https://www.example.com/first 42 | URL: https://www.example.com/second 43 | Version: N/A 44 | Date: 2020-12-03 45 | License: Custom license 46 | Security Critical: yes 47 | 48 | Description: 49 | Test metadata with multiple entries for one field, and 50 | missing a mandatory field. -------------------------------------------------------------------------------- /cipd_manifest_cros_python2.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Chromium Authors 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # This file contains version pins of a few infrastructure tools for cros. 6 | # If a tool is broken, revert a recent CL touching this file. 7 | # Note that Chromium has its own depot_tools pin, so if in a rush, revert the 8 | # depot_tools roll as well: https://chromium-review.googlesource.com/q/project:chromium/src+file:DEPS+depot_tools 9 | # or just wait for the autoroller to auto-roll your revert to Chromium. 10 | 11 | # Pin resolved versions in the repo, to reduce trust in the CIPD backend. 12 | # 13 | # Most of these tools are generated via builders at 14 | # https://ci.chromium.org/p/infra/g/infra/console 15 | # 16 | # For these, the git revision is the one of 17 | # https://chromium.googlesource.com/infra/infra.git. 18 | # 19 | # For goma client, generated via builders at 20 | # https://ci.chromium.org/p/infra-internal/g/goma-client/console 21 | # the git revision is the one of 22 | # https://chromium.googlesource.com/infra/goma/client.git 23 | # 24 | # To regenerate them (after modifying this file): 25 | # cipd ensure-file-resolve -ensure-file cipd_manifest_cros_python2.txt 26 | $ResolvedVersions cipd_manifest_cros_python2.versions 27 | 28 | # Fully supported platforms. 29 | $VerifiedPlatform linux-amd64 30 | 31 | # vpython2.7 32 | infra/tools/luci/vpython2.7/${platform} git_revision:cc21a500756c924a48f46f4755d3857133d8caa0 33 | -------------------------------------------------------------------------------- /git_cl_completion.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | 6 | # This adds completion to bash shells for git cl commands. It is 7 | # meant for developers and not needed for inclusion by any automated 8 | # processes that will, of course, specify the full command, not rely 9 | # on or benefit from tab-completion. 10 | # 11 | # Requires: 12 | # Installed git bash completion. 13 | # 14 | # Usage: 15 | # Put something like the following in your .bashrc: 16 | # . $PATH_TO_DEPOT_TOOLS/git cl_completion.sh 17 | # 18 | 19 | 20 | # Parses commands from git cl -h. 21 | __git_cl_commands () { 22 | git cl -h 2> /dev/null | sed -n 's/^\s*\x1b\[32m\(\S\+\)\s*\x1b\[39m.*$/\1/p' 23 | } 24 | 25 | # Caches variables in __git_cl_all_commands. 26 | __git_cl_compute_all_commands () { 27 | test -n "$__git_cl_all_commands" || 28 | __git_cl_all_commands="$(__git_cl_commands)" 29 | } 30 | 31 | _git_cl () { 32 | __git_cl_compute_all_commands 33 | local subcommands=$(echo "$__git_cl_all_commands" | xargs) 34 | local subcommand=$(__git_find_on_cmdline "$subcommands") 35 | if [[ -z "$subcommand" ]]; then 36 | __gitcomp "$subcommands" 37 | return 38 | fi 39 | 40 | case "$subcommand,$cur" in 41 | upload,--*) 42 | __gitcomp_builtin cl_upload 43 | ;; 44 | "",*) 45 | __gitcomp_nl "${__git_cl_all_commands}" 46 | ;; 47 | esac 48 | } 49 | -------------------------------------------------------------------------------- /recipes/recipe_modules/git_cl/examples/full.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2016 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | DEPS = [ 7 | 'git_cl', 8 | 'recipe_engine/path', 9 | 'recipe_engine/raw_io', 10 | 'recipe_engine/step', 11 | ] 12 | 13 | 14 | def RunSteps(api): 15 | api.git_cl.upload("Do the thing foobar\nNow with emoji: 😄") 16 | api.git_cl.issue() 17 | result = api.git_cl.get_description( 18 | patch_url='https://code.review/123', 19 | suffix='build') 20 | api.git_cl.set_description( 21 | 'bammmm', patch_url='https://code.review/123') 22 | api.step('echo', ['echo', result.stdout.decode('utf-8')]) 23 | 24 | api.git_cl.set_default_repo_location(api.path.mkdtemp('fakerepo')) 25 | 26 | api.step( 27 | 'echo', ['echo', api.git_cl.get_description().stdout.decode('utf-8')]) 28 | 29 | api.git_cl.set_description('new description woo') 30 | 31 | api.step( 32 | 'echo', ['echo', api.git_cl.get_description().stdout.decode('utf-8')]) 33 | 34 | def GenTests(api): 35 | yield ( 36 | api.test('basic') + 37 | api.override_step_data( 38 | 'git_cl description (build)', stdout=api.raw_io.output('hi')) + 39 | api.override_step_data( 40 | 'git_cl description', stdout=api.raw_io.output('hey')) + 41 | api.override_step_data( 42 | 'git_cl description (2)', stdout=api.raw_io.output( 43 | 'new description woo')) 44 | ) 45 | -------------------------------------------------------------------------------- /cros_python2.vpython: -------------------------------------------------------------------------------- 1 | # vpython spec used by the cros script to run commands using vpython2.7. 2 | python_version: "2.7" 3 | wheel: < 4 | name: "infra/python/wheels/httplib2-py2_py3" 5 | version: "version:0.10.3" 6 | > 7 | wheel: < 8 | name: "infra/python/wheels/oauth2client-py2_py3" 9 | version: "version:1.5.2" 10 | > 11 | wheel: < 12 | name: "infra/python/wheels/pyasn1-py2_py3" 13 | version: "version:0.2.3" 14 | > 15 | wheel: < 16 | name: "infra/python/wheels/pyasn1_modules-py2_py3" 17 | version: "version:0.0.8" 18 | > 19 | wheel: < 20 | name: "infra/python/wheels/rsa-py2_py3" 21 | version: "version:3.4.2" 22 | > 23 | wheel: < 24 | name: "infra/python/wheels/six-py2_py3" 25 | version: "version:1.15.0" 26 | > 27 | wheel: < 28 | name: "infra/python/wheels/psutil/${vpython_platform}" 29 | version: "version:5.8.0" 30 | > 31 | wheel: < 32 | name: "infra/python/wheels/backports_functools_lru_cache-py2" 33 | version: "version:1.5" 34 | > 35 | wheel: < 36 | name: "infra/python/wheels/cheroot-py2" 37 | version: "version:6.2.4" 38 | > 39 | wheel: < 40 | name: "infra/python/wheels/cherrypy-py2" 41 | version: "version:14.2.0" 42 | > 43 | wheel: < 44 | name: "infra/python/wheels/more-itertools-py2_py3" 45 | version: "version:4.1.0" 46 | > 47 | wheel: < 48 | name: "infra/python/wheels/portend-py2" 49 | version: "version:2.2" 50 | > 51 | wheel: < 52 | name: "infra/python/wheels/pytz-py2_py3" 53 | version: "version:2021.1" 54 | > 55 | wheel: < 56 | name: "infra/python/wheels/tempora-py2" 57 | version: "version:1.11" 58 | > 59 | -------------------------------------------------------------------------------- /recipes/recipe_modules/bot_update/tests/do_not_retry_patch_failures_in_cq.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | 7 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 8 | 9 | DEPS = [ 10 | 'bot_update', 11 | 'gclient', 12 | 'recipe_engine/buildbucket', 13 | 'recipe_engine/cq', 14 | 'recipe_engine/properties', 15 | 'recipe_engine/step', 16 | ] 17 | 18 | 19 | def RunSteps(api): 20 | src_cfg = api.gclient.make_config() 21 | soln = src_cfg.solutions.add() 22 | soln.name = 'src' 23 | soln.url = 'https://chromium.googlesource.com/chromium/src.git' 24 | try: 25 | bot_update_step = api.bot_update.ensure_checkout( 26 | patch=True, gclient_config=src_cfg) 27 | except api.step.StepFailure: 28 | api.step( 29 | name='cq will not retry this' 30 | if api.cq.do_not_retry_build else 'will retry', 31 | cmd=None) 32 | 33 | 34 | def GenTests(api): 35 | 36 | yield (api.test('works as intended') + api.buildbucket.try_build( 37 | 'chromium/src', 38 | 'try', 39 | 'linux', 40 | git_repo='https://chromium.googlesource.com/chromium/src') + 41 | api.properties(fail_patch='apply') + api.step_data( 42 | 'bot_update', retcode=88) + api.post_check( 43 | lambda check, steps: check('cq will not retry this' in steps)) 44 | + api.post_process(post_process.DropExpectation)) 45 | -------------------------------------------------------------------------------- /fetch_configs/webrtc.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class WebRTC(config_util.Config): 13 | """Basic Config class for WebRTC.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://webrtc.googlesource.com/src.git' 17 | spec = { 18 | 'solutions': [ 19 | { 20 | 'name': 'src', 21 | 'url': url, 22 | 'deps_file': 'DEPS', 23 | 'managed': False, 24 | 'custom_deps': {}, 25 | }, 26 | ], 27 | 'with_branch_heads': 28 | True, 29 | } 30 | 31 | if props.get('target_os'): 32 | spec['target_os'] = props['target_os'].split(',') 33 | 34 | if props.get('cache_dir'): 35 | spec['cache_dir'] = props['cache_dir'] 36 | 37 | return { 38 | 'type': 'gclient_git', 39 | 'gclient_git_spec': spec, 40 | } 41 | 42 | @staticmethod 43 | def expected_root(_props): 44 | return 'src' 45 | 46 | 47 | def main(argv=None): 48 | return WebRTC().handle_args(argv) 49 | 50 | 51 | if __name__ == '__main__': 52 | sys.exit(main(sys.argv)) 53 | -------------------------------------------------------------------------------- /fetch_configs/infra_superproject.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | import ast 7 | 8 | import config_util # pylint: disable=import-error 9 | 10 | 11 | # This class doesn't need an __init__ method, so we disable the warning 12 | # pylint: disable=no-init 13 | class InfraSuperproject(config_util.Config): 14 | """Basic Config class for the whole set of Infrastructure repositories.""" 15 | @staticmethod 16 | def fetch_spec(props): 17 | def url(host, repo): 18 | return 'https://%s.googlesource.com/%s.git' % (host, repo) 19 | 20 | spec = { 21 | 'solutions': [ 22 | { 23 | 'name': '.', 24 | 'url': url('chromium', 'infra/infra_superproject'), 25 | 'managed': True, 26 | 'custom_vars': {}, 27 | }, 28 | ], 29 | } 30 | if ast.literal_eval(props.get('checkout_internal', 'False')): 31 | spec['solutions'][0]['custom_vars']['checkout_internal'] = True 32 | return { 33 | 'type': 'gclient_git', 34 | 'gclient_git_spec': spec, 35 | } 36 | 37 | @staticmethod 38 | def expected_root(_props): 39 | return '.' 40 | 41 | 42 | def main(argv=None): 43 | return InfraSuperproject().handle_args(argv) 44 | 45 | 46 | if __name__ == '__main__': 47 | sys.exit(main(sys.argv)) 48 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "python3", 5 | "RECIPE_REPO[depot_tools]/git_footers.py", 6 | "--json", 7 | "/path/to/tmp/json" 8 | ], 9 | "name": "parse description", 10 | "stdin": "hihihi\nfoo:bar\nbam:baz", 11 | "~followup_annotations": [ 12 | "@@@STEP_LOG_LINE@json.output@{@@@", 13 | "@@@STEP_LOG_LINE@json.output@ \"Foo\": [@@@", 14 | "@@@STEP_LOG_LINE@json.output@ \"bar\"@@@", 15 | "@@@STEP_LOG_LINE@json.output@ ]@@@", 16 | "@@@STEP_LOG_LINE@json.output@}@@@", 17 | "@@@STEP_LOG_END@json.output@@@" 18 | ] 19 | }, 20 | { 21 | "cmd": [ 22 | "echo", 23 | "{'Foo': ['bar']}" 24 | ], 25 | "name": "patch_text test" 26 | }, 27 | { 28 | "cmd": [ 29 | "python3", 30 | "RECIPE_REPO[depot_tools]/git_footers.py", 31 | "--json", 32 | "/path/to/tmp/json" 33 | ], 34 | "name": "parse description (2)", 35 | "stdin": "hihihi\nfoo:bar\nbam:baz", 36 | "~followup_annotations": [ 37 | "@@@STEP_LOG_LINE@json.output@{@@@", 38 | "@@@STEP_LOG_LINE@json.output@ \"Foo\": [@@@", 39 | "@@@STEP_LOG_LINE@json.output@ \"bar\"@@@", 40 | "@@@STEP_LOG_LINE@json.output@ ]@@@", 41 | "@@@STEP_LOG_LINE@json.output@}@@@", 42 | "@@@STEP_LOG_END@json.output@@@" 43 | ] 44 | }, 45 | { 46 | "cmd": [ 47 | "echo", 48 | "['bar']" 49 | ], 50 | "name": "patch_text test (2)" 51 | }, 52 | { 53 | "name": "$result" 54 | } 55 | ] -------------------------------------------------------------------------------- /recipes/recipe_modules/presubmit/tests/prepare.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | from recipe_engine import post_process 6 | from recipe_engine import recipe_api 7 | 8 | 9 | PYTHON_VERSION_COMPATIBILITY = 'PY3' 10 | 11 | DEPS = [ 12 | 'gclient', 13 | 'presubmit', 14 | 'recipe_engine/buildbucket', 15 | 'recipe_engine/context', 16 | 'recipe_engine/path', 17 | 'recipe_engine/properties', 18 | 'recipe_engine/runtime', 19 | ] 20 | 21 | 22 | PROPERTIES = { 23 | 'patch_project': recipe_api.Property(None), 24 | 'patch_repository_url': recipe_api.Property(None), 25 | } 26 | 27 | 28 | def RunSteps(api, patch_project, patch_repository_url): 29 | api.gclient.set_config('infra') 30 | with api.context(cwd=api.path['cache'].join('builder')): 31 | bot_update_step = api.presubmit.prepare() 32 | 33 | 34 | def GenTests(api): 35 | yield (api.test('basic') + api.runtime(is_experimental=False) + 36 | api.buildbucket.try_build(project='infra') + 37 | api.post_process(post_process.StatusSuccess) + 38 | api.post_process(post_process.DropExpectation)) 39 | 40 | yield (api.test('runhooks') + api.runtime(is_experimental=False) + 41 | api.buildbucket.try_build(project='infra') + 42 | api.presubmit(runhooks=True) + 43 | api.post_process(post_process.MustRun, 'gclient runhooks') + 44 | api.post_process(post_process.StatusSuccess) + 45 | api.post_process(post_process.DropExpectation)) 46 | -------------------------------------------------------------------------------- /fetch_configs/pdfium.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | import config_util # pylint: disable=import-error 8 | 9 | 10 | # This class doesn't need an __init__ method, so we disable the warning 11 | # pylint: disable=no-init 12 | class PdfiumConfig(config_util.Config): 13 | """Basic Config class for pdfium.""" 14 | @staticmethod 15 | def fetch_spec(props): 16 | url = 'https://pdfium.googlesource.com/pdfium.git' 17 | solution = { 18 | 'name': 'pdfium', 19 | 'url': url, 20 | 'managed': False, 21 | 'custom_vars': {}, 22 | } 23 | if props.get('checkout_configuration'): 24 | solution['custom_vars']['checkout_configuration'] = props[ 25 | 'checkout_configuration'] 26 | spec = { 27 | 'solutions': [solution], 28 | } 29 | if props.get('target_os'): 30 | spec['target_os'] = props['target_os'].split(',') 31 | if props.get('target_os_only'): 32 | spec['target_os_only'] = props['target_os_only'] 33 | 34 | return { 35 | 'type': 'gclient_git', 36 | 'gclient_git_spec': spec, 37 | } 38 | 39 | @staticmethod 40 | def expected_root(_props): 41 | return 'pdfium' 42 | 43 | 44 | def main(argv=None): 45 | return PdfiumConfig().handle_args(argv) 46 | 47 | 48 | if __name__ == '__main__': 49 | sys.exit(main(sys.argv)) 50 | -------------------------------------------------------------------------------- /third_party/colorama/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Jonathan Hartley 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the copyright holders, nor those of its contributors 15 | may be used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /man/src/git-reparent-branch.txt: -------------------------------------------------------------------------------- 1 | git-reparent-branch(1) 2 | ===================== 3 | 4 | NAME 5 | ---- 6 | git-reparent-branch - 7 | include::_git-reparent-branch_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git reparent-branch' 13 | 'git reparent-branch' --lkgr 14 | 'git reparent-branch' --root 15 | 16 | DESCRIPTION 17 | ----------- 18 | 19 | Change the 'upstream' of the current branch, and then run 20 | linkgit:git-rebase-update[1] to move the commits in the current branch, as well 21 | as the commits in all descendant branches, onto the new parent. 22 | 23 | `` may be either a local branch, remote branch, OR a tag (such as 24 | `lkgr`). 25 | 26 | This is particularly useful to reparent an independent CL to become dependent on 27 | another CL, or vice versa. This could happen if you started both on the 28 | assumption that they were independent, but later realized that this was not the 29 | case. 30 | 31 | 32 | OPTIONS 33 | ------- 34 | 35 | :: 36 | The new parent to set as the upstream for this branch. May be a branch ref or 37 | a tag. 38 | 39 | --lkgr:: 40 | Reparent to track lkgr. 41 | 42 | --root:: 43 | Reparent to track the 'root' branch. Defaults to 'origin/main'. See 44 | linkgit:git-new-branch[1]'s CONFIGURATION VARIABLES section.. 45 | 46 | 47 | include::_aliases.txt[] 48 | 49 | ---- 50 | [alias] 51 | rp = reparent-branch 52 | ---- 53 | 54 | SEE ALSO 55 | -------- 56 | linkgit:git-rebase-update[1], linkgit:git-rename-branch[1], 57 | linkgit:git-new-branch[1], linkgit:git-upstream-diff[1] 58 | 59 | include::_footer.txt[] 60 | 61 | // vim: ft=asciidoc: 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vpython3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright 2019 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | if [[ $VPYTHON_BYPASS == "manually managed python not supported by chrome operations" ]] 8 | then 9 | NEWARGS=() 10 | while [[ $# -gt 0 ]] 11 | do 12 | case "$1" in 13 | -vpython-tool*) # these tools all do something vpython related and quit 14 | exit 0 15 | ;; 16 | -vpython*=*) # delete any vpython-specific flag (w/ attached argument) 17 | shift 18 | ;; 19 | -vpython*) # delete any vpython-specific flag (w/ separate argument) 20 | shift 21 | shift 22 | ;; 23 | --) # stop parsing 24 | NEWARGS+=( "$@" ) 25 | break 26 | ;; 27 | *) # regular arg 28 | NEWARGS+=( "$1" ) 29 | shift 30 | ;; 31 | esac 32 | done 33 | exec "python3" "${NEWARGS[@]}" 34 | fi 35 | 36 | # Export for other depot_tools scripts to re-use. 37 | export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "$0")}" 38 | export DEPOT_TOOLS_UNAME_S="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}" 39 | 40 | source "${DEPOT_TOOLS_DIR}/cipd_bin_setup.sh" 41 | cipd_bin_setup &> /dev/null 42 | 43 | # Don't pass this to the Python script as it might turn around and run commands 44 | # in other depot_tools dirs. 45 | base_dir="${DEPOT_TOOLS_DIR}" 46 | unset DEPOT_TOOLS_DIR 47 | case "${DEPOT_TOOLS_UNAME_S}" in 48 | mingw*|cygwin*) 49 | cmd.exe //c $0.bat "$@" 50 | ;; 51 | *) 52 | exec "${base_dir}/.cipd_bin/vpython3" "$@" 53 | ;; 54 | esac 55 | -------------------------------------------------------------------------------- /recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "gn", 5 | "gen", 6 | "out/Release" 7 | ], 8 | "name": "gn" 9 | }, 10 | { 11 | "cmd": [ 12 | "ninja", 13 | "-C", 14 | "out/Release" 15 | ], 16 | "name": "ninja" 17 | }, 18 | { 19 | "cmd": [ 20 | "cipd", 21 | "ensure", 22 | "-root", 23 | "[CACHE]/windows_sdk", 24 | "-ensure-file", 25 | "chrome_internal/third_party/sdk/windows uploaded:2018-06-13", 26 | "-max-threads", 27 | "0", 28 | "-json-output", 29 | "/path/to/tmp/json" 30 | ], 31 | "infra_step": true, 32 | "name": "ensure_installed", 33 | "~followup_annotations": [ 34 | "@@@STEP_LOG_LINE@json.output@{@@@", 35 | "@@@STEP_LOG_LINE@json.output@ \"result\": {@@@", 36 | "@@@STEP_LOG_LINE@json.output@ \"\": [@@@", 37 | "@@@STEP_LOG_LINE@json.output@ {@@@", 38 | "@@@STEP_LOG_LINE@json.output@ \"instance_id\": \"resolved-instance_id-of-uploaded:2018-06\",@@@", 39 | "@@@STEP_LOG_LINE@json.output@ \"package\": \"chrome_internal/third_party/sdk/windows\"@@@", 40 | "@@@STEP_LOG_LINE@json.output@ }@@@", 41 | "@@@STEP_LOG_LINE@json.output@ ]@@@", 42 | "@@@STEP_LOG_LINE@json.output@ }@@@", 43 | "@@@STEP_LOG_LINE@json.output@}@@@", 44 | "@@@STEP_LOG_END@json.output@@@" 45 | ] 46 | }, 47 | { 48 | "cmd": [ 49 | "taskkill.exe", 50 | "/f", 51 | "/t", 52 | "/im", 53 | "mspdbsrv.exe" 54 | ], 55 | "name": "taskkill mspdbsrv" 56 | }, 57 | { 58 | "name": "$result" 59 | } 60 | ] -------------------------------------------------------------------------------- /recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "gn", 5 | "gen", 6 | "out/Release" 7 | ], 8 | "name": "gn" 9 | }, 10 | { 11 | "cmd": [ 12 | "ninja", 13 | "-C", 14 | "out/Release" 15 | ], 16 | "name": "ninja" 17 | }, 18 | { 19 | "cmd": [ 20 | "cipd", 21 | "ensure", 22 | "-root", 23 | "[CACHE]/windows_sdk", 24 | "-ensure-file", 25 | "chrome_internal/third_party/sdk/windows uploaded:2018-06-13", 26 | "-max-threads", 27 | "0", 28 | "-json-output", 29 | "/path/to/tmp/json" 30 | ], 31 | "infra_step": true, 32 | "name": "ensure_installed", 33 | "~followup_annotations": [ 34 | "@@@STEP_LOG_LINE@json.output@{@@@", 35 | "@@@STEP_LOG_LINE@json.output@ \"result\": {@@@", 36 | "@@@STEP_LOG_LINE@json.output@ \"\": [@@@", 37 | "@@@STEP_LOG_LINE@json.output@ {@@@", 38 | "@@@STEP_LOG_LINE@json.output@ \"instance_id\": \"resolved-instance_id-of-uploaded:2018-06\",@@@", 39 | "@@@STEP_LOG_LINE@json.output@ \"package\": \"chrome_internal/third_party/sdk/windows\"@@@", 40 | "@@@STEP_LOG_LINE@json.output@ }@@@", 41 | "@@@STEP_LOG_LINE@json.output@ ]@@@", 42 | "@@@STEP_LOG_LINE@json.output@ }@@@", 43 | "@@@STEP_LOG_LINE@json.output@}@@@", 44 | "@@@STEP_LOG_END@json.output@@@" 45 | ] 46 | }, 47 | { 48 | "cmd": [ 49 | "taskkill.exe", 50 | "/f", 51 | "/t", 52 | "/im", 53 | "mspdbsrv.exe" 54 | ], 55 | "name": "taskkill mspdbsrv" 56 | }, 57 | { 58 | "name": "$result" 59 | } 60 | ] -------------------------------------------------------------------------------- /man/src/git-freeze.txt: -------------------------------------------------------------------------------- 1 | git-freeze(1) 2 | ============= 3 | 4 | NAME 5 | ---- 6 | git-freeze - 7 | include::_git-freeze_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git freeze' 13 | 14 | DESCRIPTION 15 | ----------- 16 | 17 | `git freeze` works a lot like `git stash`, in that it stores the current changes 18 | in your working copy and index 'somewhere'. Unlike `git stash`, `git freeze` 19 | stores those changes on your current branch. This effectively allows you to 20 | 'pause' development of a branch, work on something else, and then come back to 21 | exactly the same working state later (by running `git thaw`). 22 | 23 | `git freeze` will make up to 2 commits on your branch. A commit with the message 24 | `FREEZE.indexed` will contain all changes which you’ve added to your index (like 25 | with 'git add', 'git mv', 'git rm', etc.). A commit with the message 26 | `FREEZE.unindexed` will contain all changes which were not in your index at the 27 | time you ran git freeze (freshly modified files, new files, etc.). 28 | 29 | By default `git freeze` will only freeze up to 100MB of untracked files. See 30 | 'CONFIGURATION VARIABLES' for more details. 31 | 32 | 33 | EXAMPLE 34 | ------- 35 | demo:1[] 36 | 37 | 38 | CONFIGURATION VARIABLES 39 | ----------------------- 40 | 41 | depot-tools.freeze-size-limit 42 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | This sets the size limit as an integer number of megabytes of untracked files 44 | that git-freeze will be willing to put in suspended animation. A 0 or negative 45 | limit disables the size-limit check entirely. *100* by default. 46 | 47 | 48 | SEE ALSO 49 | -------- 50 | linkgit:git-thaw[1] 51 | 52 | include::_footer.txt[] 53 | 54 | // vim: ft=asciidoc: 55 | -------------------------------------------------------------------------------- /recipes/recipe_modules/git/resources/git_setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright 2013 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | """This script ensures that a given directory is an initialized git repo.""" 7 | 8 | import argparse 9 | import os 10 | import subprocess 11 | import sys 12 | 13 | # Import "git_common" from "depot_tools" root. 14 | DEPOT_TOOLS_ROOT = os.path.abspath(os.path.join( 15 | os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir)) 16 | sys.path.insert(0, DEPOT_TOOLS_ROOT) 17 | import git_common 18 | 19 | 20 | def run_git(*cmd, **kwargs): 21 | kwargs['stdout'] = sys.stdout 22 | kwargs['stderr'] = sys.stderr 23 | git_common.run(*cmd, **kwargs) 24 | 25 | 26 | def main(): 27 | parser = argparse.ArgumentParser() 28 | parser.add_argument('--path', help='Path to prospective git repo.', 29 | required=True) 30 | parser.add_argument('--url', help='URL of remote to make origin.', 31 | required=True) 32 | parser.add_argument('--remote', help='Name of the git remote.', 33 | default='origin') 34 | opts = parser.parse_args() 35 | 36 | path = opts.path 37 | remote = opts.remote 38 | url = opts.url 39 | 40 | if not os.path.exists(path): 41 | os.makedirs(path) 42 | 43 | if os.path.exists(os.path.join(path, '.git')): 44 | run_git('config', '--remove-section', 'remote.%s' % remote, cwd=path) 45 | else: 46 | run_git('init', cwd=path) 47 | run_git('remote', 'add', remote, url, cwd=path) 48 | return 0 49 | 50 | 51 | if __name__ == '__main__': 52 | sys.exit(main()) 53 | -------------------------------------------------------------------------------- /man/src/git-map-branches.txt: -------------------------------------------------------------------------------- 1 | git-map-branches(1) 2 | =================== 3 | 4 | NAME 5 | ---- 6 | git-map-branches - 7 | include::_git-map-branches_desc.helper.txt[] 8 | 9 | SYNOPSIS 10 | -------- 11 | [verse] 12 | 'git map-branches' 13 | 14 | DESCRIPTION 15 | ----------- 16 | 17 | Git map-branches displays all local branches such that: 18 | 19 | * Current branch is [aqua]#cyan#. 20 | ** The branch which will be modified with git-commit is denoted with an asterisk 21 | (`*`) after the name. 22 | * Local branches are [green]#green#. 23 | * Remote branches are [red]#red# (usually, the root of all other branches). 24 | * 'branch-heads' branches are [blue]#blue#. 25 | * `{NO UPSTREAM}` is a special placeholder in [fuchsia]#magenta#. 26 | ** Branches which have this as their parent are usually misconfigured, and 27 | should be assigned a parent by checking out the branch and running git branch 28 | --set-upstream-to=. 29 | 30 | NOTE: If multiple branches are on the same commit, they will all be cyan. 31 | 32 | OPTIONS 33 | ------- 34 | 35 | --no-color:: 36 | Turn off colors. 37 | 38 | -v:: 39 | Be more verbose. Pass once to show tracking info, twice for hash and review 40 | URL, thrice for review status. 41 | 42 | EXAMPLE 43 | ------- 44 | 45 | Given the hypothetical demo repo in linkgit:git-map[1]\'s EXAMPLE section, and 46 | assuming that the `frozen_changes` branch was currently checked out, running 47 | 'git map-branches' would result in an output like: 48 | 49 | demo:1[] 50 | 51 | include::_aliases.txt[] 52 | 53 | ---- 54 | [alias] 55 | bmap = map-branches 56 | ---- 57 | 58 | SEE ALSO 59 | -------- 60 | linkgit:git-map[1] 61 | 62 | include::_footer.txt[] 63 | 64 | // vim: ft=asciidoc: 65 | -------------------------------------------------------------------------------- /fetch_configs/chromium.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import ast 6 | import sys 7 | 8 | import config_util # pylint: disable=import-error 9 | 10 | 11 | # This class doesn't need an __init__ method, so we disable the warning 12 | # pylint: disable=no-init 13 | class Chromium(config_util.Config): 14 | """Basic Config class for Chromium.""" 15 | @staticmethod 16 | def fetch_spec(props): 17 | url = 'https://chromium.googlesource.com/chromium/src.git' 18 | solution = { 19 | 'name': 'src', 20 | 'url': url, 21 | 'managed': False, 22 | 'custom_deps': {}, 23 | 'custom_vars': {}, 24 | } 25 | if props.get('webkit_revision', '') == 'ToT': 26 | solution['custom_vars']['webkit_revision'] = '' 27 | if ast.literal_eval(props.get('internal', 'False')): 28 | solution['custom_vars']['checkout_src_internal'] = True 29 | spec = { 30 | 'solutions': [solution], 31 | } 32 | if props.get('target_os'): 33 | spec['target_os'] = props['target_os'].split(',') 34 | if props.get('target_os_only'): 35 | spec['target_os_only'] = props['target_os_only'] 36 | 37 | return { 38 | 'type': 'gclient_git', 39 | 'gclient_git_spec': spec, 40 | } 41 | 42 | @staticmethod 43 | def expected_root(_props): 44 | return 'src' 45 | 46 | 47 | def main(argv=None): 48 | return Chromium().handle_args(argv) 49 | 50 | 51 | if __name__ == '__main__': 52 | sys.exit(main(sys.argv)) 53 | -------------------------------------------------------------------------------- /recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "cmd": [ 4 | "vpython3", 5 | "RECIPE_REPO[depot_tools]\\gerrit_client.py", 6 | "changes", 7 | "--verbose", 8 | "--host", 9 | "https://chromium-review.googlesource.com", 10 | "--json_file", 11 | "/path/to/tmp/json", 12 | "--limit", 13 | "1", 14 | "-p", 15 | "change=1234567", 16 | "-o", 17 | "ALL_REVISIONS", 18 | "-o", 19 | "DOWNLOAD_COMMANDS" 20 | ], 21 | "env": { 22 | "PATH": ";RECIPE_REPO[depot_tools]" 23 | }, 24 | "infra_step": true, 25 | "name": "gerrit fetch current CL info", 26 | "timeout": 480, 27 | "~followup_annotations": [ 28 | "@@@STEP_LOG_LINE@json.output@[@@@", 29 | "@@@STEP_LOG_LINE@json.output@ {@@@", 30 | "@@@STEP_LOG_LINE@json.output@ \"branch\": \"main\",@@@", 31 | "@@@STEP_LOG_LINE@json.output@ \"owner\": {@@@", 32 | "@@@STEP_LOG_LINE@json.output@ \"name\": \"John Doe\"@@@", 33 | "@@@STEP_LOG_LINE@json.output@ },@@@", 34 | "@@@STEP_LOG_LINE@json.output@ \"revisions\": {@@@", 35 | "@@@STEP_LOG_LINE@json.output@ \"184ebe53805e102605d11f6b143486d15c23a09c\": {@@@", 36 | "@@@STEP_LOG_LINE@json.output@ \"_number\": \"1\",@@@", 37 | "@@@STEP_LOG_LINE@json.output@ \"ref\": \"refs/changes/67/1234567/1\"@@@", 38 | "@@@STEP_LOG_LINE@json.output@ }@@@", 39 | "@@@STEP_LOG_LINE@json.output@ }@@@", 40 | "@@@STEP_LOG_LINE@json.output@ }@@@", 41 | "@@@STEP_LOG_LINE@json.output@]@@@", 42 | "@@@STEP_LOG_END@json.output@@@" 43 | ] 44 | }, 45 | { 46 | "name": "$result" 47 | } 48 | ] --------------------------------------------------------------------------------