Adopt the cc.tiredsysadmin namespace and a Makefile entrypoint (v0.22.0)

Brings the project in line with CLAUDE.md:

- Application id / namespace is now cc.tiredsysadmin.android.sizzle
  (cc.tiredsysadmin.<os>.<application>), including the two JNI symbols in
  native_audio.cpp — JNI resolves by mangled package path, so renaming the
  package alone would fail at runtime, not at build time.
- Versions move to versions.properties at the repo root, read by both Gradle
  and the Makefile, with slots for the other platforms. The release APK name
  now derives from applicationId instead of being spelled out.
- Makefile becomes the build/publish entrypoint: atomic targets with real
  dependencies (deps, check, staging, release, install, dist, bump-*), and a
  manual-only publish split into publish-apk / publish-metadata, which also
  regenerates the F-Droid metadata from versions.properties.
- Annotate the two lint errors in MainActivity that this surfaced
  (ComponentActivity.dispatchKeyEvent's LIBRARY_GROUP_PREFIX restriction,
  media3's UnstableApi) so `make check` is green rather than advisory.
- Document identity, versioning, build types and publishing in the handover
  doc; point the README at make.

NOTE: the id change makes this a different app to Android and to F-Droid.
Installs of space.rcmd.android.sizzle will not be upgraded by it and will sit
side by side with the new one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-03 16:54:48 +01:00
co-authored by Claude Opus 5
parent 924b84a4d5
commit fdee7853e5
85 changed files with 734 additions and 385 deletions
+102 -14
View File
@@ -24,23 +24,111 @@ The UI has four tabs:
---
## 2. How to build & run
## 2. How to build, version & publish
Requirements: **Android Studio** (Koala / 2024.1 or newer) which bundles a
JDK 17 and the Android SDK.
### 2.1 The Makefile is the entrypoint
1. Open the project root in Android Studio. It will detect the Gradle build.
2. Let it download the SDK for `compileSdk 34`.
3. Pick a device/emulator running **Android 8.0 (API 26)** or newer and press
**Run**.
`make` — not `./gradlew`, not the Android Studio Run button — is how this
project is built and shipped. Every target is atomic and declares its own
dependencies, so any one of them can be invoked on a clean tree and will pull
in exactly what it needs and nothing else:
> The Gradle wrapper (`gradle/wrapper/gradle-wrapper.jar`) **is committed**
> (Gradle's recommended practice), so `./gradlew assembleDebug` works on a fresh
> clone with no extra setup. A `staging` build type (`./gradlew assembleStaging`)
> gives release-like performance while still using the debug signing key.
| Target | What it does |
|--------|--------------|
| `make help` | lists every target and prints the current version |
| `make deps` | fails loudly if the JDK or the Android SDK is missing |
| `make check` | unit tests + lint — the gate before a commit |
| `make staging` | non-debuggable build, release-like performance, debug key |
| `make install` | `adb install -r` of the staging APK (keeps projects/presets) |
| `make release` | **unsigned** release APK, named for F-Droid |
| `make dist` | stages the release APK + F-Droid metadata under `dist/` |
| `make publish` | uploads `dist/` to the private F-Droid repo — **manual only** |
| `make bump-minor` | feature bump: `x.(y+1).0`, versionCode +1 |
Key versions live in **one file**: `gradle/libs.versions.toml` (the "version
catalog"). Change a number there and the whole project follows.
Android Studio still works for day-to-day editing and debugging; it is just not
the source of truth for what a build *is*.
`make deps` exports `ANDROID_HOME` from the default macOS SDK location when the
environment does not already set it, because Gradle only consults
`ANDROID_HOME` / `ANDROID_SDK_ROOT` / `local.properties` and a fresh checkout
usually has none of them.
Library versions live in **one file**: `gradle/libs.versions.toml` (the "version
catalog"). Change a number there and the whole project follows. The Gradle
wrapper jar **is committed** (Gradle's recommended practice), so a fresh clone
builds with no extra setup.
### 2.2 Identity and versioning
The application id and namespace are **`cc.tiredsysadmin.android.sizzle`** —
`cc.tiredsysadmin.<operating_system>.<application>`, so a future desktop port
sits beside this one instead of colliding with it. The same string appears in
the JNI symbol names in `app/src/main/cpp/native_audio.cpp`
(`Java_cc_tiredsysadmin_android_sizzle_audio_NativeAudioBridge_*`); JNI resolves
symbols by mangled package path, so renaming the package without renaming those
two functions produces an `UnsatisfiedLinkError` at runtime, not a build error.
App versions live in **`versions.properties`** at the repo root, not in
`app/build.gradle.kts` — Gradle reads them from there, and so does the Makefile
when it names the published APK. One source means the artifact name and the
manifest can never disagree.
```properties
android.versionName = 0.22.0
android.versionCode = 49
```
The file also carries `macos` / `linux` / `bsd` / `windows` slots, set to `-`
until such a port exists, so a port starts from a tracked version instead of
inventing one.
Semantic versioning, applied on every change: **minor** for a feature, **patch**
for a fix or polish. `android.versionCode` always moves by exactly `+1` — both
F-Droid and the Android package manager order installs by that integer alone,
and a skipped or reused code cannot be taken back once published. `make
bump-minor` / `bump-patch` / `bump-major` does both halves correctly; editing
the numbers by hand is how they drift apart.
### 2.3 Build types
| Type | Debuggable | Signing | Use |
|------|-----------|---------|-----|
| `debug` | yes | debug key | breakpoints, instant-run edits |
| `staging` | **no** | debug key | anything on a real device |
| `release` | no | **unsigned** | publishing only |
`staging` exists because `debug` is misleading: a debuggable build makes ART run
the app un-optimised and Compose several times slower, so UI "snappiness"
measured on it means nothing. `staging` flips debuggability off — the single
biggest performance lever — while reusing the debug signing key so it still
installs without a release keystore. **Use `staging` for every on-device test.**
`release` is deliberately left **unsigned**. The signing key lives only inside
the private F-Droid repo; `fdroid publish` signs what lands in the unsigned
directory. No keystore should ever exist in this checkout.
### 2.4 Publishing
Publishing is **always a manual action, never automatic** — it is not a side
effect of a build, not wired into `check` or `release`, and never run
unattended. `make publish` is the only thing that reaches the network, and the
APK/metadata halves are separate targets so a metadata fix does not re-upload a
20 MB APK:
```
dist/<application_id>_<version_code>.apk -> rcmd@garage.rcmd.space:/var/lib/fdroid/unsigned
dist/<application_id>.yml -> rcmd@garage.rcmd.space:/var/lib/fdroid/metadata
```
`<application_id>_<version_code>.apk` is the naming scheme the unsigned
directory expects; `app/build.gradle.kts` stamps that same name onto the release
output via the legacy variant API (the Kotlin-DSL `android {}` receiver does not
expose output naming), deriving it from `applicationId` so the two cannot drift.
The metadata YAML is regenerated from `versions.properties` on every `make dist`,
so `CurrentVersion` can never lag the APK sitting next to it.
Run `make dist` first and look at what landed in `dist/` before running
`make publish`. Then sign the upload on the repo host.
---
@@ -84,7 +172,7 @@ Three ideas hold it together:
## 4. Package/file map
```
space.rcmd.android.sizzle
cc.tiredsysadmin.android.sizzle
├── SizzleApp.kt Application = tiny DI container (Project, InputRouter, AudioEngine)
├── MainActivity.kt Hosts Compose UI; forwards HW key/motion events; starts MIDI + service
│
+1 -1
View File
@@ -45,7 +45,7 @@ by **touch, a physical keyboard, a gamepad, or MIDI**.
- Audio uses **Oboe** (low‑latency) with an automatic fallback to the standard
path if Oboe can't start on your device.
- Installed as an APK (e.g. from a personal F‑Droid repository). Package id:
`space.rcmd.android.sizzle`.
`cc.tiredsysadmin.android.sizzle`.
---