|
1 |
| -# android-games-sdk-rs |
| 1 | +# android-games-sdk |
2 | 2 |
|
3 |
| -This is a grafted version of [android-games-sdk-rs][agdk]. |
| 3 | +This is an imported copy of the native "prefab" source for `GameActivity` and |
| 4 | +`GameTextInput`, from our fork of Google's |
| 5 | +[android-games-sdk](https://github.com/rust-mobile/android-games-sdk). |
4 | 6 |
|
5 |
| -The purpose of android-games-sdk-rs is to track our patches on top of the Android Game Development Kit (AGDK) so that it is easier to update to new upstream versions. |
| 7 | +We use an external fork to track our integration patches on top of the Android |
| 8 | +Game Development Kit (AGDK) in a way that it is easier to update to new upstream |
| 9 | +versions. It also makes it easier to try and upstream changes when we fix bugs. |
6 | 10 |
|
7 | 11 | ## Updating to new agdk version checklist
|
8 | 12 |
|
9 |
| -This is a basic checklist for things that need to be done before updating to a new agdk version: |
10 |
| - |
11 |
| -- [ ] Ensure all patches applied to the local repo have been backported (see section below on backporting patches) |
12 |
| -- [ ] Rebase patches on top of a new *release* version of agdk. If you're not sure which version you should be rebasing on, open an issue. |
13 |
| -- [ ] If there have been substantial path changes, remove the existing files first so that its a clean graft |
14 |
| -- [ ] Copy any new files over from the new version using the [copy_files](./copy_files) script (see section below on copying files) |
| 13 | +This is a basic checklist for things that need to be done when updating to a new |
| 14 | +agdk version: |
| 15 | + |
| 16 | +- [ ] Create a new integration branch based on our last integrated branch and |
| 17 | + rebase that on the latest *release* branch from Google: |
| 18 | + |
| 19 | + ```bash |
| 20 | + git clone [email protected]:rust-mobile/android-games-sdk.git |
| 21 | + cd android-games-sdk |
| 22 | + git remote add google https://android.googlesource.com/platform/frameworks/opt/gamesdk |
| 23 | + git fetch google |
| 24 | + git checkout -b android-activity-5.0.0 origin/android-activity-4.0.0 |
| 25 | + git rebase --onto google/android-games-sdk-game-activity-release <base> |
| 26 | + # (where <base> is the upstream commit ID below our stack of integration patches) |
| 27 | + ``` |
| 28 | + |
| 29 | +- [ ] Set the `ANDROID_GAMES_SDK` environment variable so you can build |
| 30 | + android-activity against your external games-sdk branch while updating. |
| 31 | +- [ ] Re-generate the `GameActivity` FFI bindings with `./generate-bindings.sh` |
| 32 | + (this can be done with `ANDROID_GAMES_SDK` set in your environment and also |
| 33 | + repeated after importing) |
15 | 34 | - [ ] Update [build.rs](../build.rs) with any new includes and src files
|
16 |
| -- [ ] Regenerate ffi bindings using [generate_bindings.sh](./generate_bindings.sh) |
17 |
| - |
18 |
| -## Backporting patches |
19 |
| - |
20 |
| -Changes made to these files must be backported to [android-games-sdk-rs][agdk], otherwise they will be lost when updating to newer upstream versions. This can be done like so (running from the project root): |
21 |
| - |
22 |
| -```bash |
23 |
| -git format-patch -o ~/agdk-patches last-import.. -- android-activity/android-games-sdk |
24 |
| -``` |
25 |
| - |
26 |
| -When applying on the [android-games-sdk-rs][agdk] side: |
27 |
| - |
28 |
| -```bash |
29 |
| -git checkout android-activity-4.0.0 |
30 |
| -git am -p3 ~/agdk-patches/*.patch |
31 |
| -``` |
32 |
| - |
33 |
| -Once these are applied on top of the current imported agdk version (in this example 4.0.0). Then they can be rebased onto future agdk versions easily. |
34 |
| - |
35 |
| -## Copying files from agdk |
36 |
| - |
37 |
| -When updating to a new version of upstream agdk properly, you can use the [copy_files](./copy_files) script. |
38 |
| - |
39 |
| -This script takes in a list of files from [file_list.txt](./file_list.txt), and grafts those files into the local directory. This ensures that pathes are aligned so that patching is easier. |
40 |
| - |
41 |
| -[agdk]: https://github.com/rust-mobile/android-games-sdk-rs |
| 35 | +- [ ] Update the `src/game-activity` backend as needed |
| 36 | +- [ ] Push a new `android-games-sdk` branch like `android-activity-5.0.0` that |
| 37 | + can be referenced when importing a copy into `android-activity` |
| 38 | +- [ ] Review and run `./import-games-sdk.sh` when ready to copy external AGDK |
| 39 | + code into this repo |
| 40 | +- [ ] Clearly reference the branch name and commit hash from the |
| 41 | + `android-games-sdk` repo in the `android-activity` commit that imports new |
| 42 | + games-sdk source. |
| 43 | +- [ ] Update CHANGELOG.md as required |
0 commit comments