Skip to content

Commit b067c71

Browse files
committed
Merge remote-tracking branch 'origin/main' into release-0.6
2 parents f3e5c13 + 1652ebb commit b067c71

File tree

53 files changed

+9827
-15965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+9827
-15965
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
# See top README for MSRV policy
20-
rust-version: [1.69.0, stable]
20+
rust-version: [1.73.0, stable]
2121
steps:
2222
- uses: actions/checkout@v4
2323

@@ -96,6 +96,16 @@ jobs:
9696
run: >
9797
cargo ndk -t arm64-v8a doc --no-deps
9898
99+
- name: Build doctests
100+
# All doctests are set to no_run, because they require running in the
101+
# context of an Android app.
102+
# Only run on stable because cross-compiling doctests is only supported
103+
# since Rust 1.89.
104+
if: ${{ matrix.rust-version == 'stable' }}
105+
run: |
106+
cargo test --doc -F native-activity --target aarch64-linux-android
107+
cargo ndk -t arm64-v8a -- test --doc -F game-activity
108+
99109
format:
100110
runs-on: ubuntu-latest
101111
steps:

android-activity/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Changed
10+
- input: Replaced custom types with their `ndk` crate equivalent.
11+
> [!NOTE]
12+
> These types existed because the `ndk` crate didn't provide them in an extensible way. Now that they have the `#[non_exhaustive]` flag and contain a `__Unknown(T)` variant to provide lossless conversions, and not to mention use an ABI type that matches how it is being used by most functions (when the original constants were defined in a "typeless" way), the `ndk` types are used and reexported once again.
13+
14+
> [!IMPORTANT]
15+
> **Relevant breaking changes**:
16+
> - `repr()` types for some `enum`s have changed to match the ABI type that is used by most functions that are returning or consuming this wrapper type.
17+
> - `Source::is_xxx_class()` functions are replaced by querying `Source::class()` and comparing against variants from the returned `SourceClass` `bitflags` enum.
18+
> - `SourceFlags::TRACKBALL` (from `Source::is_trackball_class()`) is named `SourceClass::NAVIGATION` in the `ndk`.
19+
20+
- rust-version bumped to 1.73.0 ([#193](https://github.com/rust-mobile/android-activity/pull/193))
921
- The `ndk` and `ndk-sys` crates are now re-exported under `android_activity::ndk` and `android_activity::ndk_sys` ([#194](https://github.com/rust-mobile/android-activity/pull/194))
22+
- GameActivity updated to 4.0.0 (requires the corresponding 4.0.0 `.aar` release from Google) ([#191](https://github.com/rust-mobile/android-activity/pull/191))
1023

1124
## [0.6.0] - 2024-04-26
1225

android-activity/Cargo.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ repository = "https://github.com/rust-mobile/android-activity"
99
documentation = "https://docs.rs/android-activity"
1010
description = "Glue for building Rust applications on Android with NativeActivity or GameActivity"
1111
license = "MIT OR Apache-2.0"
12+
include = [
13+
"/build.rs",
14+
"/android-games-sdk",
15+
"/LICENSE*",
16+
"/src",
17+
]
1218

13-
# 1.69 was when Rust last updated the Android NDK version used to build the
14-
# standard library which avoids needing the -lunwind workaround in build tools.
15-
#
16-
# We depend on cargo-ndk for building which has dropped support for the above
17-
# linker workaround.
18-
rust-version = "1.69.0"
19+
# Even though we could technically still build with 1.69, 1.73 has a fix for the
20+
# definition of the `stat` struct on Android, and so it seems worthwhile drawing
21+
# a line under that to ensure android-activity applications have that fix.
22+
rust-version = "1.73.0"
1923

2024
[features]
2125
# Note: we don't enable any backend by default since features
@@ -28,6 +32,7 @@ default = []
2832
game-activity = []
2933
native-activity = []
3034
api-level-30 = ["ndk/api-level-30"]
35+
api-level-33 = ["api-level-30", "ndk/api-level-33"]
3136

3237
[dependencies]
3338
log = "0.4"

android-activity/LICENSE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
The third-party glue code, under the game-activity-csrc/ directory is covered by
66
the Apache 2.0 license only:
77

8-
Apache License, Version 2.0 (docs/LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
8+
Apache License, Version 2.0 (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
99

1010
## SDK Documentation
1111

1212
Documentation for APIs that are direct bindings of Android platform APIs are covered
1313
by the Apache 2.0 license only:
1414

15-
Apache License, Version 2.0 (docs/LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
15+
Apache License, Version 2.0 (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
1616

1717
## android-activity
1818

1919
All other code is dual-licensed under either
2020

21-
- MIT License (docs/LICENSE-MIT or <http://opensource.org/licenses/MIT>)
22-
- Apache License, Version 2.0 (docs/LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
21+
- MIT License (LICENSE-MIT or <http://opensource.org/licenses/MIT>)
22+
- Apache License, Version 2.0 (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
2323

2424
at your option.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# android-games-sdk
2+
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).
6+
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.
10+
11+
## Updating to new agdk version checklist
12+
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 git@github.com: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)
34+
- [ ] Update [build.rs](../build.rs) with any new includes and src files
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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../include/common/

0 commit comments

Comments
 (0)