Commit Graph

30 Commits

Author SHA1 Message Date
dependabot[bot] f44d837bf7 build(deps): bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 21:04:48 +00:00
Robert Bragg 25f4220fef Bump MSRV to 1.85.0 (will be required by jni 0.22)
This re-generates the FFI bindings with `--rust-target '1.85.0'`
2026-02-17 22:19:08 +00:00
Marijn Suijten 019ad634a2 Switch doctests back to native cross-compilation, supported since Rust 1.89
https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#cross-compiled-doctests
2025-08-11 13:57:02 +02:00
Marijn Suijten 87cda3c560 Build-test (documentation) on the host and fix broken doc samples 2025-08-11 13:57:02 +02:00
Robert Bragg db3ea3386f Bump rust-version to 1.73.0
There was a fix for the definition of the `stat` struct on Android in
1.73, and even though it's unlikely to affect many applications it still
seems worthwhile to draw a line under this and ensure that all
android-activity based applications will have that fix.

Rust 1.73 was released October 2023, which is still well over a year old
and very conservative.

This updates `generate-bindings.sh` to pass `--rust-target 1.73.0` so we
avoid generating bindings that require a more recent compiler.

(This doesn't actually regenerate the bindings but does ensure that
future updates will be constrained to generate code that is backwards
compatible with 1.73.)
2025-04-01 15:29:59 +01:00
Marijn Suijten fe171bc532 Fix various codebase rots (stale CI, new Rust lints, broken MSRV checks by transitive dependency upgrades) (#164)
* game_activity/ffi: Drop cfg for inexistant `target_arch = "armv7"`

[Rust 1.80 from July 25th 2024] points out that `armv7` is not a known,
valid value for the `target_arch` cfg variable.  This is confirmed by
the docs not listing it either:
https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch

Hence drop this entirely, and rely purely on `target_arch = "arm"`.

[Rust 1.80 from July 25th 2024]: https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html

* Fix `unexpected-cfgs` by adding `api-level-30` feature and removing `test`

Some code copied from the NDK carried over the respective `feature`
`cfg` guards, without ever adding the feature to the `[features]` list
in `Cargo.toml`.  Now that Rust detects these mishaps, we can fix it
by removing `test` (bindings don't seem to be run-tested) and reexpose
`ConfigurationRef::screen_round()` which was behind a previously
unsettable `feature = "api-level-30"`.

Also remove `unsafe impl Send/Sync for ConfigurationRef` since the
upstream `ndk` already declares `Configuration` to be `Send` and `Sync`,
and `RwLock` and `Arc` carry that through.

* native_activity: Fix clippy lints around `NativeActivityGlue` not `SendSync` and unwritten `redraw_needed` field

* CI: Remove deprecated/unmaintained `actions-rs` toolchain setup

The `actions-rs` containers haven't been maintained and updated for
years and don't need to: GitHub's actions environment already comes
fully loaded with a complete `stable` Rust installation with the
standard tools (in this case `rustfmt`).  Remove the remaining toolchain
setup (which was already replaced with `hecrj/setup-rust-action`
elsewhere) to get rid of ancient Node 12 deprecation warnings.

* Bump dependency patch-versions to fix `-Zminimal-versions` and MSRV check

Use `-Zminimal-versions` in our MSRV check.  This not only ensures
our minimum version bounds are actually solid and tested (even if
they may be a bit conservative at times, i.e. we could allow older
versions except for the crates that are bumped in this patch which were
explicitly build-tested), it also allows us to use this as a base for
the MSRV test, and preempt us from failing it whenever a (transitive!)
dependency bumps its MSRV beyond ours in a *semver-compatible* release.

* Elide redundant `impl` block lifetimes following stricter Rust 1.83 lint

Rust now points out that `impl<'a> (Trait for) Struct<'a>` is
superfluous whenever `'a` is not used anywhere else in the `impl` block.
2025-01-27 17:14:13 +01:00
Robert Bragg e5b8242ff2 Bump MSRV to 1.69.0 considering we can't build cargo ndk with 1.68
cargo ndk will fail to build with 1.68 due to a toml_edit dep.

Technically android-activity itself should still build with 1.68
but it's simpler to synchronize the `rust-version` with the minimum
version that we actually test in CI (where we need to build cargo ndk)
2024-04-26 16:11:36 +01:00
Robert Bragg 4b9b8d754b Force cargo-ndk to only be built with stable toolchain
This fixes CI builds with rust 0.68 because cargo ndk depends on
cargo platform which depends on 0.70.
2024-01-30 12:42:36 +00:00
Marijn Suijten e14d2c1deb README: Fix MSRV badge 2023-11-04 22:40:15 +01:00
dependabot[bot] d16cb79350 build(deps): bump hecrj/setup-rust-action from 1 to 2
Bumps [hecrj/setup-rust-action](https://github.com/hecrj/setup-rust-action) from 1 to 2.
- [Release notes](https://github.com/hecrj/setup-rust-action/releases)
- [Commits](https://github.com/hecrj/setup-rust-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: hecrj/setup-rust-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 22:55:13 +01:00
Marijn Suijten 3d5e479a4e Merge pull request #118 from rust-mobile/dependabot/github_actions/actions/checkout-4
build(deps): bump actions/checkout from 3 to 4
2023-10-04 22:28:53 +02:00
Fredrik Fornwall f2132c4dab Enable CI on all branches 2023-09-26 08:48:19 +02:00
dependabot[bot] 0eefd623ed build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 18:36:49 +00:00
Robert Bragg 942053d88e Bump MSRV to 1.68
- Lets us build with cargo ndk 3+
- Lets us remove suppression for false-negative clippy warning about unsafe
  blocks in unsafe functions

- 1.68.0 notably also builds the standard library with a newer r25 NDK
  toolchain which avoid the need for awkward libgcc workarounds, so it's
  anyway a desirable baseline for Android projects.
2023-09-25 16:50:08 +01:00
Robert Bragg e91176cb08 CI: assume NDK + Java in official Ubuntu images 2023-08-15 21:23:29 +01:00
Robert Bragg 1abb02c820 Revert 'Bump MSRV to 1.68'
This effectively reverts 66cfc68dac
and adds some comments explaining that we're currently blocked by
Winit's MSRV policy + CI from being able to increase our
rust-version.

This is a frustrating conflict that I hope can be addressed by
updating Winit's CI system to allow different platforms to require
more recent versions of Rust (which notably isn't in conflict with
setting a conservative rust-version in Winit for supporting Debian
on Linux)

This re-instates building android-activity with cargo-ndk 2 because
building on Android with 1.64 requires a linker workaround that's
not implemented in newer version of cargo-ndk.

This also reinstates the clippy false-negative warning suppression
for unsafe blocks. Again it's frustrating that we can't have good
things because of how Winit wants to support Debian which shouldn't
be relevant for Android development.

Here is an upstream issue to discuss a potential solution for this:
https://github.com/rust-windowing/winit/issues/3000
2023-08-04 17:49:20 +01:00
Robert Bragg 66cfc68dac Bump MSRV to 1.68
- Lets us build with cargo ndk 3+
- Lets us remove suppression for false-negative clippy warning about unsafe
  blocks in unsafe functions
- Should unblock CI for #102

- 1.68.0 notably also builds the standard library with a newer r25 NDK
  toolchain which avoid the need for awkward libgcc workarounds, so it's
  anyway a desirable baseline for Android projects.
2023-08-03 17:10:53 +01:00
Robert Bragg 4976cbad44 Fix rust_version typo s/0.64/1.64/
Also removes a stale comment about MSVR policy in ci.yml
2023-04-24 11:42:17 +01:00
dependabot[bot] d4a3d5845d build(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-23 15:11:09 +00:00
Robert Bragg 1b44d38822 Bump MSRV to 0.64 and and MSRV policy to README 2023-04-23 15:57:07 +01:00
Robert Bragg 9ac7891664 CI: test with cargo-ndk 2, which compiles with rustc 1.60 2023-04-22 17:37:55 +01:00
Robert Bragg 2e279210a3 Remove most examples
Most of the examples weren't strictly just demonstrating how to use the
android-activity API - rather they demonstrated using other libraries
in conjunction with android-activity.

Most of the examples have now been split into a standalone repository
under: https://github.com/rust-mobile/rust-android-examples

The na-mainloop and agdk-mainloop examples have been kept here since
they can be built against the local/in-tree version of android-activity
and are useful to keep for CI purposes.

This also runs `cargo update` for the na-mainloop and agdk-mainloop.
2022-12-20 19:55:10 +00:00
Robert Bragg 781e1fd658 ci: string in expressions should use single quotes 2022-09-01 14:48:03 +01:00
Robert Bragg 16391c4956 ci: add missing quotes 2022-09-01 14:43:08 +01:00
Robert Bragg da29177b41 Only build examples with stable toolchain
Although we want to ensure android-activity itself builds with the
same MSRV as Winit there's no need to also check that the examples
build with an older toolchain, and in fact in the case of Egui based
examples they don't support being built with 1.60.0.

In addition to adding an `if: rust_version == "stable"` condition
for building agdk-egui, this also adds CI stages to build agdk-mainloop,
na-mainloop and agdk-eframe to cover at least one example based on
`NativeActivity` and cover the key examples that others are most
likely to be interested in.
2022-09-01 14:14:08 +01:00
Robert Bragg b29162d149 Revert "Support building with 1.57.0 compiler"
This reverts the changes from 66e3293f4d
to support the 1.57.0 compiler (leaving the rustdoc fixes).

Making the changes to support 1.57 felt disappointing to require for the
sake of Winit being able to better support Linux distro packaging. Even
with the changes we still wouldn't really support
1.57 without also upstreaming changes to `cargo ndk`.

The new plan is to bank on Winit bumping its own MSRV to at least
1.58 which seems more than reasonable considering that even 1.59
is already >6months old.

Ref: https://github.com/rust-windowing/winit/pull/2453

This updates ci.yml to now build with 1.60, assuming that the above
PR will be accepted.
2022-09-01 12:37:07 +01:00
Robert Bragg 3a2fa5d1fa CI: build docs and ensure support for 1.57.0 compiler 2022-08-31 23:05:24 +01:00
John Kåre Alsaker 8601f28eba Split formatting to a separate job 2022-08-11 01:04:09 +02:00
John Kåre Alsaker 49c877085b Fix indentation 2022-08-11 00:55:04 +02:00
John Kåre Alsaker 9e3d8fd977 Add CI 2022-08-11 00:04:53 +02:00