Skip to content

Modularize and decouple from rust-windowing #372

@rib

Description

@rib

Following up from #365 here is a specific plan for us to modularize this repo

Why?

Several of the crates are very orthogonal from each other:

  • ndk-glue in particular is unlikely to see continued development / maintenance so it would make sense to clearly sign post from here to android-activity and provide an archive for posterity
  • cargo apk may eventually be superseded by something like xbuild and it's also not inherently coupled to the the other ndk components
  • Eventually we may aim to make ndk-context redundant if we can instead encourage crates that support Android to have explicit initialization APIs that may be given a jvm + Context/Activity (and therefore enabling multiple Activities in a single process)
  • None of these crates are inherently rust-windowing specific and there is probably more opportunity to foster collaboration around an organisation that's more broadly related to mobile OSs in general.

Where to?

Since it's anticipated that most people interested in Rust + Android are likely also interested cross-platform mobile support, we have created a general rust-mobile organization, initially owned by the contributors to android-ndk-rs and android-activity.

The idea is that I will also move android-activity here, along with splitting the android-activity/examples out into a new repo.

I believe @dvc94ch was also open to moving xbuild here too

Other Rust utilities and build tools etc catering to supporting Rust development for mobile operating systems would also be welcome to create repos here

How?

These are key repos that would be split out of android-ndk-rs:

  • ndk-glue - A filter of the ndk-glue and ndk-macro subdirectories, updated with a notice to recommend android-activity for new projects and then archived for posterity.
  • cargo-apk - would be a filter of the cargo-apk + ndk-build subdirectories and ndk-examples (renamed to `examples) and outstanding PRs + issues would be transferred to the new repo
  • ndk-context - A filter of the ndk-context subdirectory
  • ndk - After removing all the subdirectories that have been filtered into standalone repos this repo would then be transferred to rust-mobile (so all issues / PRs are preserved)

How to filter the repos:

git clone https://github.com/newren/git-filter-repo

ndk-glue

git clone https://github.com/rust-windowing/android-ndk-rs.git ndk-glue
cd ndk-glue
py ../git-filter-repo/git-filter-repo --path ndk-glue --path ndk-macro --path ndk-examples --path-rename ndk-examples:examples --path LICENSE-APACHE --path LICENSE-MIT --path Cargo.toml --path rustfmt.toml --path .github --path .gitignore

cargo apk

git clone https://github.com/rust-windowing/android-ndk-rs.git cargo-apk
cd cargo-apk
py ../git-filter-repo/git-filter-repo --path cargo-apk --path ndk-build --path ndk-examples --path-rename ndk-examples:examples --path LICENSE-APACHE --path LICENSE-MIT --path Cargo.toml --path rustfmt.toml --path .github --path .gitignore

ndk-context

git clone https://github.com/rust-windowing/android-ndk-rs.git ndk-context
cd ndk-context
py ../git-filter-repo/git-filter-repo --path ndk-context --path ndk-examples --path-rename ndk-examples:examples --path LICENSE-APACHE --path LICENSE-MIT --path Cargo.toml --path rustfmt.toml --path .github --path .gitignore

Coordination

What needs to get done?

ndk-glue

  • Filter out the ndk-glue repo and push to rust-mobile
  • Get CI working for the standalone ndk-glue repo
  • Update repository + homepage URLs in Cargo.toml for the standalone ndk-glue repo
  • Update the README for ndk-glue to recommend that new projects use android-activity
  • Open + merge a PR to remove the ndk-glue and ndk-macro subdirectories from this repo

cargo-apk

  • Filter out the cargo-apk repo and push to rust-mobile
  • Get CI working for the standalone cargo-apk repo (including porting the examples to build against android-activity instead of ndk-glue)
  • Update repository + homepage URLs in Cargo.toml for the standalone cargo-apk repo
  • Open + merge a PR to remove the cargo-apk, ndk-build and ndk-examples subdirectories from this repo

ndk-context

  • Filter out the ndk-context repo and push to rust-mobile
  • Get CI working for the standalone ndk-context repo
  • Update repository + homepage URLs in Cargo.toml for the standalone ndk-context repo
  • Open + merge a PR to remove the ndk-context subdirectory from this repo

removals from this repo

  • Open + merge a PR to remove ndk-glue, ndk-macros, cargo-apk, ndk-build, ndk-examples and ndk-context from this repo

This PR will indicate:

  1. Where the code is moving too
  2. How the repos were filtered
  3. The last commit used as input for filtering

As follow up tasks we will:

  • Mark the ndk-glue repo as "archived" on GitHub for posterity
  • Transfer outstanding cargo-apk issues / PRs from this repo to the standalone repo
  • Transfer this repo to rust-mobile
  • Update repository + homepage URLs in Cargo.toml for this repo
  • Update the README for this repo to reflect the modularization changes

I'm happy to get the ball rolling with re-filtering the repos (since we already did one draft run of this a while ago) as well as getting CI bootstrapped for the standalone repos (I already have a draft for getting the cargo apk CI working and porting the ndk-examples to build against android-activity)

Does this plan sound practical?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions