mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-02 06:24:16 +02:00
refactor(build): rename entry modules and remove DESKTOP_ONLY mode (#5476)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@ git submodule update --init
|
||||
./gradlew :core:data:allTests
|
||||
|
||||
# Single module tests (Android-only module like :app)
|
||||
./gradlew :app:testFdroidDebugUnitTest
|
||||
./gradlew :androidApp:testFdroidDebugUnitTest
|
||||
|
||||
# Cross-platform compilation check (no tests)
|
||||
./gradlew kmpSmokeCompile
|
||||
@@ -46,7 +46,7 @@ KMP modules have different task names than pure-Android modules. Using the wrong
|
||||
|
||||
## Quick Reference
|
||||
|
||||
- **Architecture**: KMP project (Android, Desktop, iOS). Business logic in `commonMain`; platform shells (`app/`, `desktop/`) wire DI and host UI. See `AGENTS.md` and `.skills/kmp-architecture/`.
|
||||
- **Architecture**: KMP project (Android, Desktop, iOS). Business logic in `commonMain`; platform shells (`androidApp/`, `desktopApp/`) wire DI and host UI. See `AGENTS.md` and `.skills/kmp-architecture/`.
|
||||
- **Flavors**: `fdroid` (OSS) / `google` (Maps + DataDog). Only one installable at a time (different signing keys).
|
||||
- **Verify before push**: Run `./gradlew spotlessApply detekt assembleDebug test allTests`, then confirm CI with `gh pr checks <PR>`.
|
||||
- **Strings**: `stringResource(Res.string.key)` — run `python3 scripts/sort-strings.py` after adding strings.
|
||||
|
||||
@@ -5,7 +5,7 @@ excludeAgent: "code-review"
|
||||
|
||||
# CI Workflow Rules
|
||||
|
||||
- Prefer explicit Gradle task paths (`app:lintFdroidDebug`) over shorthand (`lintDebug`).
|
||||
- Prefer explicit Gradle task paths (`androidApp:lintFdroidDebug`) over shorthand (`lintDebug`).
|
||||
- CI uses `.github/ci-gradle.properties` — don't assume local `gradle.properties` values.
|
||||
- CI passes `-Pci=true` to enable full processor usage via `maxParallelForks`.
|
||||
- Use `fetch-depth: 0` only where needed (spotless ratcheting, version code). Use `fetch-depth: 1` otherwise.
|
||||
|
||||
@@ -8,10 +8,10 @@ on:
|
||||
- main
|
||||
paths:
|
||||
# Only rebuild docs when source code changes (Dokka generates from KDoc)
|
||||
- 'app/src/**'
|
||||
- 'androidApp/src/**'
|
||||
- 'core/**/src/**'
|
||||
- 'feature/**/src/**'
|
||||
- 'desktop/src/**'
|
||||
- 'desktopApp/src/**'
|
||||
- 'build-logic/**'
|
||||
- 'build.gradle.kts'
|
||||
- 'settings.gradle.kts'
|
||||
|
||||
@@ -30,9 +30,9 @@ jobs:
|
||||
- '.github/workflows/**'
|
||||
- '.github/actions/**'
|
||||
# Product modules validated by reusable-check
|
||||
- 'app/**'
|
||||
- 'androidApp/**'
|
||||
- 'baselineprofile/**'
|
||||
- 'desktop/**'
|
||||
- 'desktopApp/**'
|
||||
- 'core/**'
|
||||
- 'feature/**'
|
||||
- 'screenshot-tests/**'
|
||||
@@ -95,9 +95,9 @@ jobs:
|
||||
PY
|
||||
|
||||
# 2. VALIDATION & BUILD: Delegate to reusable-check.yml
|
||||
# We disable coverage for PRs to keep feedback fast (< 10 mins).
|
||||
# Desktop compilation is covered by :desktop:test in the shard-app test shard.
|
||||
# Native desktop packaging (createDistributable) only runs in release.yml.
|
||||
# We disable coverage and desktop builds for PRs to keep feedback fast
|
||||
# (< 10 mins). Desktop compilation is already covered by the :desktopApp:test
|
||||
# task in the shard-app test shard.
|
||||
validate-and-build:
|
||||
needs: check-changes
|
||||
if: needs.check-changes.outputs.android == 'true'
|
||||
|
||||
@@ -150,9 +150,9 @@ jobs:
|
||||
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
|
||||
GOOGLE_PLAY_JSON_KEY: ${{ secrets.GOOGLE_PLAY_JSON_KEY }}
|
||||
run: |
|
||||
rm -f ./app/google-services.json
|
||||
echo $GSERVICES > ./app/google-services.json
|
||||
echo $KEYSTORE | base64 -di > ./app/$KEYSTORE_FILENAME
|
||||
rm -f ./androidApp/google-services.json
|
||||
echo $GSERVICES > ./androidApp/google-services.json
|
||||
echo $KEYSTORE | base64 -di > ./androidApp/$KEYSTORE_FILENAME
|
||||
echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
|
||||
echo "datadogApplicationId=$DATADOG_APPLICATION_ID" >> ./secrets.properties
|
||||
echo "datadogClientToken=$DATADOG_CLIENT_TOKEN" >> ./secrets.properties
|
||||
@@ -172,14 +172,14 @@ jobs:
|
||||
run: bundle exec fastlane internal
|
||||
|
||||
- name: List outputs
|
||||
run: ls -R app/build/outputs/
|
||||
run: ls -R androidApp/build/outputs/
|
||||
|
||||
- name: Upload Google AAB artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: google-aab
|
||||
path: app/build/outputs/bundle/googleRelease/app-google-release.aab
|
||||
path: androidApp/build/outputs/bundle/googleRelease/androidApp-google-release.aab
|
||||
retention-days: 1
|
||||
|
||||
- name: Upload Google APK artifact
|
||||
@@ -187,20 +187,20 @@ jobs:
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: google-apk
|
||||
path: app/build/outputs/apk/google/release/*.apk
|
||||
path: androidApp/build/outputs/apk/google/release/*.apk
|
||||
retention-days: 1
|
||||
|
||||
- name: Attest Google AAB provenance
|
||||
if: success()
|
||||
uses: actions/attest-build-provenance@v4
|
||||
with:
|
||||
subject-path: app/build/outputs/bundle/googleRelease/app-google-release.aab
|
||||
subject-path: androidApp/build/outputs/bundle/googleRelease/androidApp-google-release.aab
|
||||
|
||||
- name: Attest Google APK provenance
|
||||
if: success()
|
||||
uses: actions/attest-build-provenance@v4
|
||||
with:
|
||||
subject-path: app/build/outputs/apk/google/release/*.apk
|
||||
subject-path: androidApp/build/outputs/apk/google/release/*.apk
|
||||
|
||||
release-fdroid:
|
||||
runs-on: ubuntu-24.04
|
||||
@@ -229,7 +229,7 @@ jobs:
|
||||
KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }}
|
||||
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
||||
run: |
|
||||
echo $KEYSTORE | base64 -di > ./app/$KEYSTORE_FILENAME
|
||||
echo $KEYSTORE | base64 -di > ./androidApp/$KEYSTORE_FILENAME
|
||||
echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
|
||||
|
||||
- name: Setup Fastlane
|
||||
@@ -245,21 +245,21 @@ jobs:
|
||||
run: bundle exec fastlane fdroid_build
|
||||
|
||||
- name: List outputs
|
||||
run: ls -R app/build/outputs/
|
||||
run: ls -R androidApp/build/outputs/
|
||||
|
||||
- name: Upload F-Droid APK artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: fdroid-apk
|
||||
path: app/build/outputs/apk/fdroid/release/*.apk
|
||||
path: androidApp/build/outputs/apk/fdroid/release/*.apk
|
||||
retention-days: 1
|
||||
|
||||
- name: Attest F-Droid APK provenance
|
||||
if: success()
|
||||
uses: actions/attest-build-provenance@v4
|
||||
with:
|
||||
subject-path: app/build/outputs/apk/fdroid/release/*.apk
|
||||
subject-path: androidApp/build/outputs/apk/fdroid/release/*.apk
|
||||
|
||||
release-desktop:
|
||||
if: ${{ inputs.build_desktop }}
|
||||
@@ -307,13 +307,13 @@ jobs:
|
||||
# `-PaboutLibraries.release=true` as member access on `-PaboutLibraries`,
|
||||
# splitting the token and feeding `.release=true` to Gradle as a task name.
|
||||
run: >
|
||||
./gradlew :desktop:packageReleaseDistributionForCurrentOS
|
||||
${{ contains(runner.os, 'macOS') && ':desktop:packageReleaseUberJarForCurrentOS' || '' }}
|
||||
./gradlew :desktopApp:packageReleaseDistributionForCurrentOS
|
||||
${{ contains(runner.os, 'macOS') && ':desktopApp:packageReleaseUberJarForCurrentOS' || '' }}
|
||||
'-PaboutLibraries.release=true' --no-daemon
|
||||
|
||||
- name: List Desktop Binaries
|
||||
if: runner.os == 'Linux' || runner.os == 'macOS'
|
||||
run: ls -R desktop/build/compose/binaries/main-release
|
||||
run: ls -R desktopApp/build/compose/binaries/main-release
|
||||
|
||||
- name: Upload Desktop Artifacts
|
||||
if: always()
|
||||
@@ -321,13 +321,13 @@ jobs:
|
||||
with:
|
||||
name: desktop-${{ runner.os }}-${{ runner.arch }}
|
||||
path: |
|
||||
desktop/build/compose/binaries/main-release/*/*.dmg
|
||||
desktop/build/compose/binaries/main-release/*/*.msi
|
||||
desktop/build/compose/binaries/main-release/*/*.exe
|
||||
desktop/build/compose/binaries/main-release/*/*.deb
|
||||
desktop/build/compose/binaries/main-release/*/*.rpm
|
||||
desktop/build/compose/binaries/main-release/*/*.AppImage
|
||||
desktop/build/compose/jars/*-release.jar
|
||||
desktopApp/build/compose/binaries/main-release/*/*.dmg
|
||||
desktopApp/build/compose/binaries/main-release/*/*.msi
|
||||
desktopApp/build/compose/binaries/main-release/*/*.exe
|
||||
desktopApp/build/compose/binaries/main-release/*/*.deb
|
||||
desktopApp/build/compose/binaries/main-release/*/*.rpm
|
||||
desktopApp/build/compose/binaries/main-release/*/*.AppImage
|
||||
desktopApp/build/compose/jars/*-release.jar
|
||||
retention-days: 1
|
||||
if-no-files-found: ignore
|
||||
|
||||
@@ -336,13 +336,13 @@ jobs:
|
||||
uses: actions/attest-build-provenance@v4
|
||||
with:
|
||||
subject-path: |
|
||||
desktop/build/compose/binaries/main-release/*/*.dmg
|
||||
desktop/build/compose/binaries/main-release/*/*.msi
|
||||
desktop/build/compose/binaries/main-release/*/*.exe
|
||||
desktop/build/compose/binaries/main-release/*/*.deb
|
||||
desktop/build/compose/binaries/main-release/*/*.rpm
|
||||
desktop/build/compose/binaries/main-release/*/*.AppImage
|
||||
desktop/build/compose/jars/*-release.jar
|
||||
desktopApp/build/compose/binaries/main-release/*/*.dmg
|
||||
desktopApp/build/compose/binaries/main-release/*/*.msi
|
||||
desktopApp/build/compose/binaries/main-release/*/*.exe
|
||||
desktopApp/build/compose/binaries/main-release/*/*.deb
|
||||
desktopApp/build/compose/binaries/main-release/*/*.rpm
|
||||
desktopApp/build/compose/binaries/main-release/*/*.AppImage
|
||||
desktopApp/build/compose/jars/*-release.jar
|
||||
|
||||
create-flatpak-src:
|
||||
if: ${{ inputs.build_flatpak_src }}
|
||||
@@ -370,22 +370,7 @@ jobs:
|
||||
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
cache_read_only: 'true'
|
||||
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ast-grep
|
||||
run: pip install ast-grep-cli
|
||||
|
||||
# Remove Android/iOS targets and other non-desktop bits
|
||||
# that would break the flatpakGradleGenerator
|
||||
- name: Prepare Offline Desktop Build
|
||||
run: ./scripts/desktop-only-prep.sh
|
||||
|
||||
- name: Generate Flatpak Sources
|
||||
env:
|
||||
DESKTOP_ONLY: true
|
||||
run: >
|
||||
./gradlew :build-logic:convention:flatpakGradleGenerator flatpakGradleGenerator
|
||||
--no-configuration-cache --refresh-dependencies --no-parallel
|
||||
|
||||
@@ -94,7 +94,7 @@ jobs:
|
||||
|
||||
- name: Lint, Analysis & KMP Smoke Compile
|
||||
if: inputs.run_lint == true
|
||||
run: ./gradlew spotlessCheck detekt app:lintFdroidDebug app:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug core:api:lintDebug kmpSmokeCompile -Pci=true --continue --scan
|
||||
run: ./gradlew spotlessCheck detekt androidApp:lintFdroidDebug androidApp:lintGoogleDebug core:barcode:lintFdroidDebug core:barcode:lintGoogleDebug core:api:lintDebug kmpSmokeCompile -Pci=true --continue --scan
|
||||
|
||||
- name: KMP Smoke Compile (lint skipped)
|
||||
if: inputs.run_lint == false
|
||||
@@ -152,13 +152,13 @@ jobs:
|
||||
# See: https://github.com/meshtastic/Meshtastic-Android/issues/3231
|
||||
|
||||
echo "── Step 1: Verify aboutlibraries.json determinism ──"
|
||||
rm -f app/src/main/resources/aboutlibraries.json
|
||||
./gradlew :app:exportLibraryDefinitions -Pci=true --no-configuration-cache
|
||||
cp app/src/main/resources/aboutlibraries.json /tmp/aboutlibraries-run1.json
|
||||
rm -f androidApp/src/main/resources/aboutlibraries.json
|
||||
./gradlew :androidApp:exportLibraryDefinitions -Pci=true --no-configuration-cache
|
||||
cp androidApp/src/main/resources/aboutlibraries.json /tmp/aboutlibraries-run1.json
|
||||
|
||||
rm -f app/src/main/resources/aboutlibraries.json
|
||||
./gradlew :app:exportLibraryDefinitions -Pci=true --no-configuration-cache --rerun-tasks
|
||||
cp app/src/main/resources/aboutlibraries.json /tmp/aboutlibraries-run2.json
|
||||
rm -f androidApp/src/main/resources/aboutlibraries.json
|
||||
./gradlew :androidApp:exportLibraryDefinitions -Pci=true --no-configuration-cache --rerun-tasks
|
||||
cp androidApp/src/main/resources/aboutlibraries.json /tmp/aboutlibraries-run2.json
|
||||
|
||||
if ! diff -q /tmp/aboutlibraries-run1.json /tmp/aboutlibraries-run2.json; then
|
||||
echo "::error::aboutlibraries.json is NOT deterministic across runs!"
|
||||
@@ -168,9 +168,9 @@ jobs:
|
||||
echo "✅ aboutlibraries.json is deterministic"
|
||||
|
||||
echo "── Step 2: Build fdroid release APK ──"
|
||||
./gradlew :app:assembleFdroidRelease -Pci=true -Pmeshtastic.disableAbiSplits=true --no-configuration-cache
|
||||
./gradlew :androidApp:assembleFdroidRelease -Pci=true -Pmeshtastic.disableAbiSplits=true --no-configuration-cache
|
||||
|
||||
APK=$(find app/build/outputs/apk/fdroid/release -name "*.apk" | head -1)
|
||||
APK=$(find androidApp/build/outputs/apk/fdroid/release -name "*.apk" | head -1)
|
||||
if [ -z "$APK" ]; then
|
||||
echo "::error::No fdroid release APK found"
|
||||
exit 1
|
||||
@@ -295,7 +295,7 @@ jobs:
|
||||
# Tests are split into 3 shards that run in parallel:
|
||||
# shard-core: core:* KMP module tests (allTests)
|
||||
# shard-feature: feature:* KMP module tests (allTests)
|
||||
# shard-app: Pure-Android/JVM tests (app, desktop, core:barcode, etc.)
|
||||
# shard-app: Pure-Android/JVM tests (androidApp, desktopApp, core:barcode, etc.)
|
||||
test-shards:
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
@@ -359,17 +359,17 @@ jobs:
|
||||
:feature:settings:koverXmlReport
|
||||
- name: shard-app
|
||||
tasks: >-
|
||||
:app:testFdroidDebugUnitTest
|
||||
:app:testGoogleDebugUnitTest
|
||||
:desktop:test
|
||||
:androidApp:testFdroidDebugUnitTest
|
||||
:androidApp:testGoogleDebugUnitTest
|
||||
:desktopApp:test
|
||||
:core:barcode:testFdroidDebugUnitTest
|
||||
:core:barcode:testGoogleDebugUnitTest
|
||||
kover: >-
|
||||
:app:koverXmlReportFdroidDebug
|
||||
:app:koverXmlReportGoogleDebug
|
||||
:androidApp:koverXmlReportFdroidDebug
|
||||
:androidApp:koverXmlReportGoogleDebug
|
||||
:core:barcode:koverXmlReportFdroidDebug
|
||||
:core:barcode:koverXmlReportGoogleDebug
|
||||
:desktop:koverXmlReport
|
||||
:desktopApp:koverXmlReport
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -447,14 +447,14 @@ jobs:
|
||||
cache_read_only: ${{ needs.lint-check.outputs.cache_read_only }}
|
||||
|
||||
- name: Build Android APKs
|
||||
run: ./gradlew app:assembleFdroidDebug app:assembleGoogleDebug -Pci=true --parallel --configuration-cache --continue --scan
|
||||
run: ./gradlew androidApp:assembleFdroidDebug androidApp:assembleGoogleDebug -Pci=true --parallel --configuration-cache --continue --scan
|
||||
|
||||
- name: Upload debug artifact
|
||||
if: ${{ inputs.upload_artifacts }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: app-debug-apks
|
||||
path: app/build/outputs/apk/*/debug/*.apk
|
||||
path: androidApp/build/outputs/apk/*/debug/*.apk
|
||||
retention-days: 7
|
||||
|
||||
- name: Report App Size
|
||||
@@ -463,8 +463,47 @@ jobs:
|
||||
echo "### App Size Report" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Artifact | Size |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
|
||||
find app/build/outputs/apk -name "*.apk" -exec du -h {} + | awk '{print "| " $2 " | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
|
||||
find androidApp/build/outputs/apk -name "*.apk" -exec du -h {} + | awk '{print "| " $2 " | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# ── Desktop Build ───────────────────────────────────────────────────
|
||||
build-desktop:
|
||||
name: Build Desktop Debug (${{ matrix.os }})
|
||||
if: inputs.run_desktop_builds == true
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 60
|
||||
needs: lint-check
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm]
|
||||
env:
|
||||
VERSION_CODE: ${{ needs.lint-check.outputs.version_code }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: true
|
||||
|
||||
- name: Gradle Setup
|
||||
uses: ./.github/actions/gradle-setup
|
||||
with:
|
||||
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
cache_read_only: ${{ needs.lint-check.outputs.cache_read_only }}
|
||||
|
||||
- name: Build Desktop
|
||||
run: ./gradlew :desktopApp:createDistributable -Pci=true --scan
|
||||
|
||||
- name: Upload Desktop artifact
|
||||
if: ${{ inputs.upload_artifacts }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: desktop-app-${{ runner.os }}-${{ runner.arch }}
|
||||
path: desktopApp/build/compose/binaries/main/app/
|
||||
retention-days: 7
|
||||
|
||||
# ── Flatpak Sources ───────────────────────────────────────────────────
|
||||
build-flatpak-src:
|
||||
@@ -494,23 +533,8 @@ jobs:
|
||||
with:
|
||||
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
cache_read_only: true
|
||||
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ast-grep
|
||||
run: pip install ast-grep-cli
|
||||
|
||||
# Remove Android/iOS targets and other non-desktop bits
|
||||
# that would break the flatpakGradleGenerator
|
||||
- name: Prepare Offline Desktop Build
|
||||
run: ./scripts/desktop-only-prep.sh
|
||||
|
||||
- name: Generate Flatpak Sources
|
||||
env:
|
||||
DESKTOP_ONLY: true
|
||||
run: >
|
||||
./gradlew :build-logic:convention:flatpakGradleGenerator flatpakGradleGenerator
|
||||
--no-configuration-cache --refresh-dependencies --no-parallel
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
- name: Update firmware releases list
|
||||
id: firmware
|
||||
run: |
|
||||
firmware_file_path="app/src/main/assets/firmware_releases.json"
|
||||
firmware_file_path="androidApp/src/main/assets/firmware_releases.json"
|
||||
temp_firmware_file="/tmp/new_firmware_releases.json"
|
||||
|
||||
echo "Fetching latest firmware releases..."
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
- name: Update hardware list
|
||||
id: hardware
|
||||
run: |
|
||||
hardware_file_path="app/src/main/assets/device_hardware.json"
|
||||
hardware_file_path="androidApp/src/main/assets/device_hardware.json"
|
||||
temp_hardware_file="/tmp/new_device_hardware.json"
|
||||
|
||||
echo "Fetching latest device hardware data..."
|
||||
@@ -172,8 +172,8 @@ jobs:
|
||||
base: 'main'
|
||||
delete-branch: true
|
||||
add-paths: |
|
||||
app/src/main/assets/firmware_releases.json
|
||||
app/src/main/assets/device_hardware.json
|
||||
androidApp/src/main/assets/firmware_releases.json
|
||||
androidApp/src/main/assets/device_hardware.json
|
||||
fastlane/metadata/android/**
|
||||
**/strings.xml
|
||||
**/README.md
|
||||
|
||||
Reference in New Issue
Block a user