diff options
-rw-r--r-- | AUTHORS | 4 | ||||
-rw-r--r-- | DEPS | 4 | ||||
-rwxr-xr-x | PRESUBMIT.py | 18 | ||||
-rwxr-xr-x | PRESUBMIT.sh | 8 | ||||
-rw-r--r-- | README.md | 17 | ||||
-rw-r--r-- | cast/common/certificate/DEPS | 2 | ||||
-rw-r--r-- | docs/advanced_gerrit.md (renamed from advanced_gerrit.md) | 0 | ||||
-rw-r--r-- | osp/demo/DEPS | 7 | ||||
-rw-r--r-- | osp/impl/discovery/mdns/DEPS | 7 | ||||
-rw-r--r-- | osp/impl/quic/testing/DEPS | 7 | ||||
-rw-r--r-- | platform/api/DEPS | 4 | ||||
-rw-r--r-- | platform/impl/DEPS | 2 | ||||
-rw-r--r-- | streaming/cast/DEPS | 2 | ||||
-rw-r--r-- | streaming/cast/receiver_demo/DEPS | 7 | ||||
-rwxr-xr-x | tools/install-build-tools.sh | 19 | ||||
-rw-r--r-- | util/DEPS | 2 | ||||
-rw-r--r-- | util/crypto/DEPS | 2 | ||||
-rw-r--r-- | util/json/DEPS | 2 |
18 files changed, 77 insertions, 37 deletions
@@ -1,3 +1,7 @@ Mark A. Foltz <mfoltz@chromium.org> Brandon Tolsch <btolsch@chromium.org> Yuri Wiitala <miu@chromium.org> +Peter Thatcher <pthatcher@chromium.org> +Jordan Bayles <jophba@chromium.org> +Max Yakimakha <yakimakha@chromium.org> +Ryan Keane <rwkeane@google.com> @@ -127,7 +127,9 @@ recursedeps = [ include_rules = [ '+util', - '+platform', + '+platform/api', + '+platform/base', + '+platform/test', '+third_party', # Don't include abseil from the root so the path can change via include_dirs diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 3721d614..c7a54cc1 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -16,21 +16,11 @@ def _CheckDeps(input_api, output_api): finally: sys.path = original_sys_path - added_includes = [] - for f in input_api.AffectedFiles(): - if CppChecker.IsCppFile(f.LocalPath()): - changed_lines = [line for _, line in f.ChangedContents()] - added_includes.append([f.AbsoluteLocalPath(), changed_lines]) - deps_checker = checkdeps.DepsChecker(input_api.PresubmitLocalPath()) - violations = deps_checker.CheckAddedCppIncludes(added_includes) - for path, rule_type, rule_description in violations: - relpath = input_api.os_path.relpath(path, input_api.PresubmitLocalPath()) - error_description = '%s\n %s' % (relpath, rule_description) - if rule_type == Rule.DISALLOW: - results.append(output_api.PresubmitError(error_description)) - else: - results.append(output_api.PresubmitPromptWarning(error_description)) + deps_checker.CheckDirectory(input_api.PresubmitLocalPath()) + deps_results = deps_checker.results_formatter.GetResults() + for violation in deps_results: + results.append(output_api.PresubmitError(violation)) return results diff --git a/PRESUBMIT.sh b/PRESUBMIT.sh index 9b911ab3..6c4e9009 100755 --- a/PRESUBMIT.sh +++ b/PRESUBMIT.sh @@ -10,7 +10,9 @@ fail=0 function check_clang_format() { - if ! cmp -s <(./clang-format -style=file "$1") "$1"; then + if ! which clang-format &>/dev/null; then + echo "Please add clang-format to your PATH or manually check $1 for format errors." + elif ! cmp -s <(clang-format -style=file "$1") "$1"; then echo "Needs format: $1" fail=1 fi @@ -57,10 +59,6 @@ if [[ "$invoker" != 'python' ]]; then echo "This shouldn't be invoked directly, please use \`git cl presubmit\`." fi -if [[ ! -e ./clang-format ]]; then - tools/install-build-tools.sh -fi - for f in $(git diff --name-only --diff-filter=d origin/master); do # Skip third party files, except our custom BUILD.gns if [[ $f =~ third_party/[^\/]*/src ]]; then @@ -1,7 +1,9 @@ # Open Screen Library -The openscreen library implements the Open Screen Protocol. Information about -the protocol and its specification can be found [on +The openscreen library implements the Open Screen Protocol and the Chromecast +protocols (both control and streaming). + +Information about the protocol and its specification can be found [on GitHub](https://github.com/webscreens/openscreenprotocol). ## Getting the code @@ -57,11 +59,13 @@ The following tools are required for building: - Code formatter (optional): `clang-format` - Builder: `ninja` ([GitHub releases](https://github.com/ninja-build/ninja/releases)) +`clang-format` and `ninja` can be downloaded to `buildtools/<platform>` root by +running `./tools/install-build-tools.sh`. + `clang-format` is only used for presubmit checks and optionally used on -generated code from the CDDL tool. A copy of `clang-format` can be downloaded -to the repository root by running `./tools/install-build-tools.sh`. +generated code from the CDDL tool. -`gn` will be installed in `//buildtools/<platform>/` automatically by DEPS. +`gn` will be installed in `buildtools/<platform>/` automatically by DEPS. You also need to ensure that you have the compiler toolchain dependencies. Currently, both Linux and Mac OS X build configurations use clang by default. @@ -80,7 +84,8 @@ instance of it. On Debian flavors, you can run: ### Mac -On Mac OS X, the build will use the clang provided by XCode, which must be +On Mac OS X, the build will use the clang provided by +[XCode](https://apps.apple.com/us/app/xcode/id497799835?mt=12), which must be installed. ### gcc support diff --git a/cast/common/certificate/DEPS b/cast/common/certificate/DEPS index d6b038c4..e1f738d6 100644 --- a/cast/common/certificate/DEPS +++ b/cast/common/certificate/DEPS @@ -1,4 +1,4 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/advanced_gerrit.md b/docs/advanced_gerrit.md index 790ee359..790ee359 100644 --- a/advanced_gerrit.md +++ b/docs/advanced_gerrit.md diff --git a/osp/demo/DEPS b/osp/demo/DEPS new file mode 100644 index 00000000..98b921ed --- /dev/null +++ b/osp/demo/DEPS @@ -0,0 +1,7 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +include_rules = [ + '+platform/impl', # The OSP demo uses the default platform impl. +] diff --git a/osp/impl/discovery/mdns/DEPS b/osp/impl/discovery/mdns/DEPS new file mode 100644 index 00000000..96a7209c --- /dev/null +++ b/osp/impl/discovery/mdns/DEPS @@ -0,0 +1,7 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +include_rules = [ + '+platform/impl', # Needed by embedder_demo.cc +] diff --git a/osp/impl/quic/testing/DEPS b/osp/impl/quic/testing/DEPS new file mode 100644 index 00000000..5b7e995c --- /dev/null +++ b/osp/impl/quic/testing/DEPS @@ -0,0 +1,7 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +include_rules = [ + '+platform/impl', # Needed by quic_test_support.h +] diff --git a/platform/api/DEPS b/platform/api/DEPS index afab6918..f0fc67f2 100644 --- a/platform/api/DEPS +++ b/platform/api/DEPS @@ -1,7 +1,9 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. include_rules = [ '+platform/base', + '-util', + '-third_party', ] diff --git a/platform/impl/DEPS b/platform/impl/DEPS index 441e4d80..9f492914 100644 --- a/platform/impl/DEPS +++ b/platform/impl/DEPS @@ -1,4 +1,4 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/streaming/cast/DEPS b/streaming/cast/DEPS index 7ad15785..d6952724 100644 --- a/streaming/cast/DEPS +++ b/streaming/cast/DEPS @@ -1,4 +1,4 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/streaming/cast/receiver_demo/DEPS b/streaming/cast/receiver_demo/DEPS new file mode 100644 index 00000000..5419c015 --- /dev/null +++ b/streaming/cast/receiver_demo/DEPS @@ -0,0 +1,7 @@ +# Copyright 2019 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +include_rules = [ + '+platform/impl', +] diff --git a/tools/install-build-tools.sh b/tools/install-build-tools.sh index 6f9b1217..b9256761 100755 --- a/tools/install-build-tools.sh +++ b/tools/install-build-tools.sh @@ -11,16 +11,27 @@ esac echo "Assuming we are running in $env..." +ninja_version="v1.9.0" +ninja_zipfile="" +case "$env" in + linux64) ninja_zipfile="ninja-linux.zip";; + mac) ninja_zipfile="ninja-mac.zip";; +esac + BUILDTOOLS_REPO_URL="https://chromium.googlesource.com/chromium/src/buildtools" GOOGLE_STORAGE_URL="https://storage.googleapis.com" +BUILDTOOLS_ROOT=$(git rev-parse --show-toplevel)/buildtools/$env +if [ ! -d $BUILDTOOLS_ROOT ]; then + mkdir -p $BUILDTOOLS_ROOT +fi -GIT_ROOT=$(git rev-parse --show-toplevel) - -pushd $GIT_ROOT +pushd $BUILDTOOLS_ROOT set -x # echo on sha1=$(curl "$BUILDTOOLS_REPO_URL/+/master/$env/clang-format.sha1?format=TEXT" | base64 --decode) curl -Lo clang-format "$GOOGLE_STORAGE_URL/chromium-clang-format/$sha1" chmod +x clang-format +curl -L "https://github.com/ninja-build/ninja/releases/download/${ninja_version}/${ninja_zipfile}" | funzip > ninja +chmod +x ninja set +x # echo off - popd + @@ -1,4 +1,4 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/util/crypto/DEPS b/util/crypto/DEPS index 7ad15785..d6952724 100644 --- a/util/crypto/DEPS +++ b/util/crypto/DEPS @@ -1,4 +1,4 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/util/json/DEPS b/util/json/DEPS index 62071224..a522cd21 100644 --- a/util/json/DEPS +++ b/util/json/DEPS @@ -1,4 +1,4 @@ -# Copyright 2019 The Chromium Authors. All rights reserved. +# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. |