commit | 9eb0974e5dc99d1f1311bb94175e5097d46d459f | [log] [tgz] |
---|---|---|
author | Jordan Bayles <jophba@chromium.org> | Tue Jan 15 22:04:52 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Jan 22 01:57:21 2019 |
tree | 84ffd665cbbff2477c1912f06d88cee7598e602a | |
parent | c11dc3464a5f2fedb09ded9f40a3f3ab7b0bc61d [diff] |
Change pointers to absl::optional where possible This changelist adds a targeted pull of the absl::optional type, replacing raw pointers where feasible, using the rules suggested in the abseil documentation: https://abseil.io/tips/123 There are remaining raw pointers, however I believe that these should be changed to std::unique_ptr or simple references, due to their scope and complexity. These cases include the following: api/impl * internal_services (Singleton) api/impl/quic * quic_connection * quic_connection_factory * quic_service_common * fake_quic_connection_factory * fake_quic_connection api/public * network_service_manager * presentation_controller * presentation_receiver discovery/mdns * mdns_responder*platform tools/cddl * codegen * parse * sema Bug: openscreen:4 Change-Id: Id330a1b6529531b52e9d77f3a6f1b375f5a048d3 Reviewed-on: https://chromium-review.googlesource.com/c/1412262 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org> Reviewed-by: mark a. foltz <mfoltz@chromium.org>
This library implements the Open Screen Protocol. Information about the protocol can be found in the Open Screen GitHub repository.
Open Screen uses LUCI builders to monitor the build and test health of the library.
Coming soon: tryjob and submit queue integration with Gerrit code review.
Open Screen Library code should follow the Open Screen Library Style Guide. In addition, you should also run //PRESUBMIT.sh
before uploading changes for review (which primarily checks formatting).
Run ./tools/install-build-tools.sh
from the root source directory to obtain a copy of the following build tools:
gn
clang-format
You will have to obtain and install these yourself:
Compiler toolchain: Currently, this is gcc
on Linux, and clang
on Mac (from Xcode).
Builder: ninja
After checking out the Open Screen library, make sure to initialize the submodules for the dependencies. The following commands will checkout all the necessary submodules:
git submodule init
git submodule update
The following commands will build the current example executable and run it.
./gn gen out/Default # Creates the build directory and necessary ninja files ninja -C out/Default # Builds the executable with ninja ./out/Default/hello # Runs the executable
The -C
argument to ninja
works just like it does for GNU Make: it specifies the working directory for the build. So the same could be done as follows:
./gn gen out/Default cd out/Default ninja ./hello
After editing a file, only ninja
needs to be rerun, not gn
.
The following sections contain some tips about dealing with Gerrit for code reviews, specifically when pushing patches for review.
There is official Gerrit documentation for this which essentially amounts to:
git push origin HEAD:refs/for/master
You may also wish to install the Change-Id commit-msg hook. This adds a Change-Id
line to each commit message locally, which Gerrit uses to track changes. Once installed, this can be toggled with git config gerrit.createChangeId <true|false>
.
To download the commit-msg hook for the Open Screen repository, use the following command:
curl -Lo .git/hooks/commit-msg https://chromium-review.googlesource.com/tools/hooks/commit-msg
Gerrit keeps track of changes using a Change-Id line in each commit.
When there is no Change-Id
line, Gerrit creates a new Change-Id
for the commit, and therefore a new change. Gerrit's documentation for replacing a change describes this. So if you want to upload a new patchset to an existing review, it should contain the matching Change-Id
line in the commit message.
By default, each commit to your local branch will get its own Gerrit change when pushed, unless it has a Change-Id
corresponding to an existing review.
If you need to modify commits on your local branch to ensure they have the correct Change-Id
, you can do one of two things:
After committing to the local branch, run:
git commit --amend git show
to attach the current Change-Id
to the most recent commit. Check that the correct one was inserted by comparing it with the one shown on chromium-review.googlesource.com
for the existing review.
If you have made multiple local commits, you can squash them all into a single commit with the correct Change-Id:
git rebase -i HEAD~4 git show
where ‘4’ means that you want to squash three additional commits onto an existing commit that has been uploaded for review.