aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Bayles <jophba@chromium.org>2019-02-22 15:16:44 -0800
committerCommit Bot <commit-bot@chromium.org>2019-02-25 20:41:28 +0000
commitb5c9ece710109e9619fee8bb75ee98d98f3781e3 (patch)
treef140cd61acedad9e79d1fedddb852946ac4679d2
parent16330a3d570f6551c1080e52d40a7c0d35421d57 (diff)
downloadopenscreen-b5c9ece710109e9619fee8bb75ee98d98f3781e3.tar.gz
Move to DEPS file and using gclient
This patch removes our dependency on submodules, in favor of using Chromium's gclient tool for managing depedencies. Although this is less standard, the value add is that it will make integrating with Chromium easier. See also: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1484793 Change-Id: Ib6999768c0164c952d5dc139adb391a29ee70b3d Reviewed-on: https://chromium-review.googlesource.com/c/1484794 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Brandon Tolsch <btolsch@chromium.org>
-rw-r--r--.gitmodules20
-rw-r--r--DEPS44
-rw-r--r--README.md36
-rw-r--r--third_party/.gitignore6
-rw-r--r--third_party/README.md32
m---------third_party/abseil/src0
m---------third_party/chromium_quic/src/base0
m---------third_party/chromium_quic/src/third_party/boringssl/src0
m---------third_party/googletest/src0
m---------third_party/mDNSResponder/src0
m---------third_party/tinycbor/src0
11 files changed, 92 insertions, 46 deletions
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 984ed1fa..00000000
--- a/.gitmodules
+++ /dev/null
@@ -1,20 +0,0 @@
-[submodule "third_party/googletest/src"]
- path = third_party/googletest/src
- url = https://github.com/google/googletest.git
-[submodule "third_party/mDNSResponder/src"]
- path = third_party/mDNSResponder/src
- url = https://github.com/jevinskie/mDNSResponder.git
-# These two submodules are necessary for third_party/chromium_quic, but aren't
-# used in the rest of the OSP library.
-[submodule "third_party/chromium_quic/src/base"]
- path = third_party/chromium_quic/src/base
- url = https://chromium.googlesource.com/chromium/src/base
-[submodule "third_party/chromium_quic/src/third_party/boringssl/src"]
- path = third_party/chromium_quic/src/third_party/boringssl/src
- url = https://boringssl.googlesource.com/boringssl.git
-[submodule "third_party/tinycbor/src"]
- path = third_party/tinycbor/src
- url = https://github.com/intel/tinycbor.git
-[submodule "third_party/abseil/src"]
- path = third_party/abseil/src
- url = https://github.com/abseil/abseil-cpp.git
diff --git a/DEPS b/DEPS
new file mode 100644
index 00000000..cbc1063a
--- /dev/null
+++ b/DEPS
@@ -0,0 +1,44 @@
+# This file is used to manage the dependencies of the Open Screen repo. It is
+# used by gclient to determine what version of each dependency to check out.
+#
+# For more information, please refer to the official documentation:
+# https://sites.google.com/a/chromium.org/dev/developers/how-tos/get-the-code
+#
+# When adding a new dependency, please update the top-level .gitignore file
+# to list the dependency's destination directory.
+
+vars = {
+ 'boringssl_git': 'https://boringssl.googlesource.com',
+ 'chromium_git': 'https://chromium.googlesource.com',
+
+ # TODO(jophba): move to googlesource external for github repos.
+ 'github': "https://github.com",
+ 'third_party_dir': 'openscreen/third_party'
+}
+
+deps = {
+ Var('third_party_dir') + '/googletest/src':
+ Var('chromium_git') + '/external/github.com/google/googletest.git' +
+ '@' + 'dfa853b63d17c787914b663b50c2095a0c5b706e',
+
+ Var('third_party_dir') + '/mDNSResponder/src':
+ Var('github') + '/jevinskie/mDNSResponder.git' +
+ '@' + '2942dde61f920fbbf96ff9a3840567ebbe7cb1b6',
+
+ Var('third_party_dir') + '/chromium_quic/src/base':
+ Var('chromium_git') + '/chromium/src/base' +
+ '@' + '6abc23a6273fa803f6f633ad0c77358998db0489',
+
+ Var('third_party_dir') + '/chromium_quic/src/third_party/boringssl/src':
+ Var('boringssl_git') + '/boringssl.git' +
+ '@' + '6410e18e9190b6b0c71955119fbf3cae1b9eedb7',
+
+ Var('third_party_dir') + '/tinycbor/src':
+ Var('github') + '/intel/tinycbor.git' +
+ '@' + 'bfc40dcf909f1998d7760c2bc0e1409979d3c8cb',
+
+ Var('third_party_dir') + '/abseil/src':
+ Var('chromium_git') +
+ '/external/github.com/abseil/abseil-cpp.git' +
+ '@' + '5eea0f713c14ac17788b83e496f11903f8e2bbb0',
+}
diff --git a/README.md b/README.md
index 0f315d7a..df1b5093 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,34 @@ This library implements the Open Screen Protocol. Information about the
protocol can be found in the Open Screen [GitHub
repository](https://github.com/webscreens/openscreenprotocol).
+## Getting the code
+
+### Depot Tools
+
+Openscreen dependencies are managed using gclient, from the depot_tools repo.
+To get gclient, run the following command in your terminal:
+```bash
+ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
+```
+Then add the depot_tools folder to your PATH environment variable.
+
+For more setup information on depot_tools, see:
+https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
+
+### Checking out
+
+From the parent directory of where you want the openscreen checkout (typically
+/usr/local/src), configure gclient and check out openscreen with the
+following commands:
+
+```bash
+ gclient config https://chromium.googlesource.com/openscreen
+ gclient sync
+```
+
+Now, you should have openscreen checked out, with all module dependencies
+checked out to the appropriate revision.
+
## Continuous Build
Open Screen uses [LUCI builders](https://ci.chromium.org/p/openscreen/builders)
@@ -47,14 +75,6 @@ Note that g++ must be installed.
## Building an example with GN and 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:
-
-``` bash
- git submodule init
- git submodule update
-```
The following commands will build the current example executable and run it.
``` bash
diff --git a/third_party/.gitignore b/third_party/.gitignore
new file mode 100644
index 00000000..6310a406
--- /dev/null
+++ b/third_party/.gitignore
@@ -0,0 +1,6 @@
+abseil/src/
+chromium_quic/src/base/
+chromium_quic/src/third_party/boringssl/src/
+googletest/src/
+mDNSResponder/src/
+tinycbor/src/
diff --git a/third_party/README.md b/third_party/README.md
index 5efd9772..eeabc954 100644
--- a/third_party/README.md
+++ b/third_party/README.md
@@ -1,6 +1,6 @@
# Third-Party Dependencies
-The Open Screen library includes its dependencies as submodules in the source
+The Open Screen library includes its dependencies as DEPS in the source
tree under the `//third_party/` directory. They are structured as follows:
```
@@ -13,33 +13,29 @@ tree under the `//third_party/` directory. They are structured as follows:
## Adding a new dependency
-When adding a new dependency to the project, you should first create a submodule
-under `//third_party/` with its source. For example, let's say we want to add a
-new library called `alpha`.
+When adding a new dependency to the project, you should first add an entry
+to the DEPS file. For example, let's say we want to add a
+new library called `alpha`. Opening up DEPS, you would add
-``` bash
- git submodule add https://repo.com/path/to/alpha.git third_party/alpha/src
- git commit
+``` python
+ deps = {
+ ...
+ 'src/third_party/alpha/src': 'https://repo.com/path/to/alpha.git'
+ + '@' + '<revision>'
```
Then you need to add a BUILD.gn file for it under `//third_party/alpha`,
assuming it doesn't already provide its own BUILD.gn.
+Finally, add a new entry for the "src" directory of your dependency to
+the //third_party/.gitignore.
+
## Roll a dependency to a new version
Rolling a dependency forward (or to any different version really) consists of
two steps:
- 1. Put HEAD of the submodule repository at the desired commit (make sure this
- public before pushing the version-bump change).
- 1. `git add` the submodule path and commit.
-
-Once again, assume we have a dependency called `alpha` which we want to update:
-``` bash
- cd third_party/alpha/src
- # pull new changes e.g. git pull origin master
- git add third_party/alpha/src
- git commit
-```
+ 1. Update the revision string for the dependency in the DEPS file.
+ 1. `git add` the DEPS file and commit, then run gclient sync.
Of course, you should also make sure that the new change is still compatible
with the rest of the project, including any adapter files under
diff --git a/third_party/abseil/src b/third_party/abseil/src
deleted file mode 160000
-Subproject 5eea0f713c14ac17788b83e496f11903f8e2bbb
diff --git a/third_party/chromium_quic/src/base b/third_party/chromium_quic/src/base
deleted file mode 160000
-Subproject 6abc23a6273fa803f6f633ad0c77358998db048
diff --git a/third_party/chromium_quic/src/third_party/boringssl/src b/third_party/chromium_quic/src/third_party/boringssl/src
deleted file mode 160000
-Subproject 6410e18e9190b6b0c71955119fbf3cae1b9eedb
diff --git a/third_party/googletest/src b/third_party/googletest/src
deleted file mode 160000
-Subproject dfa853b63d17c787914b663b50c2095a0c5b706
diff --git a/third_party/mDNSResponder/src b/third_party/mDNSResponder/src
deleted file mode 160000
-Subproject 2942dde61f920fbbf96ff9a3840567ebbe7cb1b
diff --git a/third_party/tinycbor/src b/third_party/tinycbor/src
deleted file mode 160000
-Subproject bfc40dcf909f1998d7760c2bc0e1409979d3c8c