aboutsummaryrefslogtreecommitdiff
path: root/third_party/README.md
blob: 5efd977266de4163fb003df500c0e2c6a63fd2fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Third-Party Dependencies

The Open Screen library includes its dependencies as submodules in the source
tree under the `//third_party/` directory.  They are structured as follows:

```
  //third_party/<library>
   BUILD.gn
   ...other necessary adapter files...
   src/
     <library>'s source
```

## 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`.

``` bash
  git submodule add https://repo.com/path/to/alpha.git third_party/alpha/src
  git commit
```

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.

## 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
```

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
`//third_party/<library>` (e.g. BUILD.gn).  Any necessary updates to make the
rest of the project work with the new dependency version should happen in the
same change.