From aa71400706094ff432dd5f15aeb8b771afdbad4c Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Fri, 1 May 2026 07:33:19 -0500 Subject: [PATCH] refactor(build): update AboutLibraries generation process for rb (#5316) --- .github/workflows/scheduled-updates.yml | 10 ++------- .../kotlin/AboutLibrariesConventionPlugin.kt | 22 +++++-------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/.github/workflows/scheduled-updates.yml b/.github/workflows/scheduled-updates.yml index c5b044f5c..b41808a31 100644 --- a/.github/workflows/scheduled-updates.yml +++ b/.github/workflows/scheduled-updates.yml @@ -91,16 +91,13 @@ jobs: run: ./gradlew graphUpdate continue-on-error: true - - name: Update AboutLibraries metadata - run: ./gradlew :app:exportLibraryDefinitions - continue-on-error: true - name: Create Pull Request if changes occurred uses: peter-evans/create-pull-request@v8 with: token: ${{ secrets.CROWDIN_GITHUB_TOKEN }} commit-message: | - chore: Scheduled updates (Firmware, Hardware, Translations, Graphs, Licenses) + chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) Automated updates for: - Firmware releases list @@ -108,8 +105,7 @@ jobs: - Crowdin source string uploads - Crowdin translation downloads - Module dependency graphs - - AboutLibraries license metadata - title: 'chore: Scheduled updates (Firmware, Hardware, Translations, Graphs, Licenses)' + title: 'chore: Scheduled updates (Firmware, Hardware, Translations, Graphs)' body: | This PR includes automated updates from the scheduled workflow: @@ -118,7 +114,6 @@ jobs: - Source strings were uploaded to Crowdin. - Latest translations were downloaded from Crowdin (if available). - Updated module dependency graphs in README.md files (if changed). - - Updated `aboutlibraries.json` license metadata (if dependencies changed). Please review the changes. branch: 'scheduled-updates' @@ -127,7 +122,6 @@ jobs: add-paths: | app/src/main/assets/firmware_releases.json app/src/main/assets/device_hardware.json - app/src/main/resources/aboutlibraries.json fastlane/metadata/android/** **/strings.xml **/README.md diff --git a/build-logic/convention/src/main/kotlin/AboutLibrariesConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AboutLibrariesConventionPlugin.kt index 0b2b1465a..08cfb8082 100644 --- a/build-logic/convention/src/main/kotlin/AboutLibrariesConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AboutLibrariesConventionPlugin.kt @@ -55,30 +55,18 @@ class AboutLibrariesConventionPlugin : Plugin { } } - // Ensure aboutlibraries.json is always up-to-date during the build. - // This is required since AboutLibraries v11+ no longer auto-exports. - // For fdroid builds, skip re-export to preserve reproducible builds (RB) — - // the committed aboutlibraries.json is used as-is. + // Ensure aboutlibraries.json is generated before resource processing. + // The file is gitignored and must be generated fresh each build. + // offlineMode is already true when aboutLibraries.release is not passed, + // ensuring deterministic output for fdroid/reproducible builds. // See: https://github.com/meshtastic/Meshtastic-Android/issues/3231 tasks .matching { it.name.startsWith("process") && - (it.name.endsWith("Resources") || it.name.endsWith("JavaRes")) && - !it.name.contains("Fdroid", ignoreCase = true) + (it.name.endsWith("Resources") || it.name.endsWith("JavaRes")) } .configureEach { dependsOn("exportLibraryDefinitions") } - // Gradle 9.5 strict task-dependency validation: fdroid variants read from - // src/main/resources/ (where exportLibraryDefinitions writes). Even though - // fdroid uses the committed file as-is, we must declare ordering to satisfy - // the implicit dependency checker. - tasks - .matching { - it.name.startsWith("process") && - it.name.endsWith("JavaRes") && - it.name.contains("Fdroid", ignoreCase = true) - } - .configureEach { mustRunAfter("exportLibraryDefinitions") } } } }