Better Android builds #130

Closed
opened 2024-06-03 18:11:45 +00:00 by SakulFlee · 0 comments
SakulFlee commented 2024-06-03 18:11:45 +00:00 (Migrated from github.com)

We have decided earlier that we won't use any CLI tool to generate Android projects on the fly.
This was mainly due to cargo-apk being deprecated and xbuild, it's replacement, being seemingly unmaintained and underdeveloped.
We do use cargo-ndk though to quickly compile our Rust code to the correct architectures + the Gradle plugin cargo-ndk-android-gradle to invoke this command automatically on Android builds.

The issue now is quality assurance and especially redudancy.
Currently, we need a seperate Android project for each Example we define.
It's already a lot to maintain all the Examples, but maintaining the Android project too is getting seemingly more difficult.
Especially if upgrades are needed...

We have found so far that each Android project is basically the same.
The only things that change are:

  • JNI Libraries (different example == different libraries)
  • App Name (ususally the example name)
  • NDK Build command + which example to build. However, this is basically the same as the first point.

This means, we could define one template project and make a system that copies this template, changes the template fields and then builds the Android project.

The question now becomes how to do this.
Using a build.rs isn't too efficient here, as we don't always want to build for Android and the Android builds take a significant amount of time.
A build script would be much more efficient here in my opinion.
Buuuut... which language should this be in? Bash?

We have decided earlier that we won't use any CLI tool to generate Android projects on the fly. This was mainly due to [cargo-apk](https://github.com/rust-mobile/cargo-apk) being deprecated and [xbuild](https://github.com/rust-mobile/xbuild), **it's replacement**, being seemingly unmaintained and underdeveloped. We do use [cargo-ndk](https://github.com/bbqsrc/cargo-ndk) though to quickly compile our Rust code to the correct architectures + the Gradle plugin [cargo-ndk-android-gradle](https://github.com/willir/cargo-ndk-android-gradle) to invoke this command automatically on Android builds. The issue now is quality assurance and especially redudancy. Currently, we need a seperate Android project for each Example we define. It's already a lot to maintain all the Examples, but maintaining the Android project too is getting seemingly more difficult. Especially if upgrades are needed... We have found so far that each Android project is basically the same. The only things that change are: - JNI Libraries (different example == different libraries) - App Name (ususally the example name) - NDK Build command + which example to build. _However, this is basically the same as the first point._ This means, we could define one template project and make a system that copies this template, changes the template fields and then builds the Android project. The question now becomes how to do this. Using a `build.rs` isn't too efficient here, as we don't always want to build for Android and the Android builds take a significant amount of time. A build script would be much more efficient here in my opinion. Buuuut... which language should this be in? Bash? <!-- Edit the body of your new issue then click the ✓ "Create Issue" button in the top right of the editor. The first line will be the issue title. Assignees and Labels follow after a blank line. Leave an empty line before beginning the body of the issue. -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SakulFlee/Orbital#130
No description provided.