Commit Graph

8 Commits (23a358764dd8cd61e7d6efe086fb51c78ae0ac9b)

Author SHA1 Message Date
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.

Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]

Review URL: https://codereview.chromium.org/955993006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
scottmg@chromium.org d05ab35296 Add canned presubmit check for GN formatting
Requires https://codereview.chromium.org/779883002/ to be landed/rolled before it's useful.

R=dpranke@chromium.org
BUG=348474

Review URL: https://codereview.chromium.org/779513005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293269 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
kjellander@chromium.org f7facfab38 Make gn.py support root directories other than 'src'.
In https://codereview.chromium.org/341533006/ a change
was made so that gn.py is not looking for the .gn file
to identify the root of the checkout. This breaks
GN functionality for projects that uses gclient but
have a top directory named something else than 'src'.

This change adds support for arbitrarily named primary (the first)
solutions in the .gclient file.
It also adds a check for the generated GN path so a friendly
error message can be printed if the GN executable cannot be found.


BUG=389883
TESTED=Various cases of Chromium, WebRTC and custom checkouts
with .gclient containing empty solution list, solution missing the
'name' key and so on.

Review URL: https://codereview.chromium.org/538393002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291819 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
brettw@chromium.org cc968feb9a Make gn wrapper use the one in buildtools rather than tools/gn/bin.
This updates some infrastructure to make it easy to get at the platform-specific build tools directories.

Review URL: https://codereview.chromium.org/341533006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@279132 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
dpranke@chromium.org a2a0c576ef Fix the gn wrapper to be aware of the --root argument.
The gn binary itself is capable of being run from outside of a
checkout as long as you pass the --root flag.

However, the gn.py wrapper script needs to *also* know where the the
checkout is, in order to figure out how to find the gn binary itself.

This patch changes the wrapper to be aware of the --root arg :).

R=brettw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/212173004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259998 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nick@chromium.org 3ac1c4e320 Depot tools: use the clang-format binaries that are now included
as part of the Chromium checkout.

This follows the approach used by gn.

Changes include:
 - in-the-PATH clang-format trampoline scripts
 - clang_format.py, which finds clang-format binaries inside of Chrome
 - Hook 'git cl format' to the new binaries and scripts
 - Rearrange some code, for reuse between clang_format.py and gn.py

BUG=240309
TEST=presubmits (one failure on mac, but it fails on a clean checkout too)

Review URL: https://codereview.chromium.org/134313007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@245074 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
brettw@chromium.org 7d6ffa55da Detect cygwin as Win32 for the purposes of running GN and downloading from google storage.
This normalizes sys.platform so people running cygwin are treated like Windows.

Review URL: https://codereview.chromium.org/104763003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@238999 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
brettw@chromium.org 67bb861400 Add a wrapper script for GN to depot_tools
This automatically searches the path for a source root (or takes one from the
command line), and then executes the current platform's GN binary inside that
source tree.

This will allow the user to have a "gn" command on their path, and allow our
scripts to run GN without having to bake-in the logic for finding the correct
platform's GN binary.

Review URL: https://codereview.chromium.org/66013002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@233983 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago