Enforce Android SpotBugs and default to API 36#5451
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Updates the Android build and QA pipeline to eliminate a SpotBugs duplicate-branch warning in calendar queries and ensure SpotBugs findings fail Maven verification while still emitting CI-consumable XML reports.
Changes:
- Simplifies Android Calendar Provider filtering to remove a redundant column-selection branch flagged by SpotBugs.
- Tightens SpotBugs enforcement in the Android Maven module by failing verification on non-excluded findings.
- Raises the Android SDK floor used by the Gradle-based Android builder and aligns the developer documentation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| maven/codenameone-maven-plugin/src/main/java/com/codename1/builders/AndroidGradleBuilder.java | Raises the minimum Android platform API used by the builder. |
| maven/android/pom.xml | Makes SpotBugs failures block mvn verify and adds the check goal while keeping XML output. |
| docs/developer-guide/Advanced-Topics-Under-The-Hood.asciidoc | Updates docs to reflect the new Android SDK floor. |
| Ports/Android/src/com/codename1/impl/android/AndroidCalendarSource.java | Removes SpotBugs-triggering duplicate branches by using a single calendar id column constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Compared 151 screenshots: 151 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Cloudflare Preview
|
|
Compared 181 screenshots: 181 matched. |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 149 screenshots: 149 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 144 screenshots: 144 matched. |
|
Compared 143 screenshots: 143 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 148 screenshots: 148 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 217 screenshots: 217 matched. |
Summary
SpotBugs fix
Events.CALENDAR_IDandInstances.CALENDAR_IDresolve to the same Android Calendar Provider column name, so selecting between them produced identical bytecode branches and triggeredDB_DUPLICATE_BRANCHES.The Android module generated SpotBugs reports but did not run the plugin's
checkgoal, so findings outside the exclusion filter did not fail Maven verification. The configuration also makes SpotBugs execution and analysis errors fail the build instead of silently producing an incomplete report.Android API 36
The open-source Gradle 8 builder selects the highest installed Android platform but previously allowed API 33 as its minimum. It now requires API 36 as the default floor while continuing to honor explicit
android.targetSDKVersionoverrides. Generated projects also guarantee thatcompileSdkis never lower thantargetSdk, independently of the selected Build Tools package.Cloud builds receive the matching default in codenameone/BuildDaemon#157.
Validation
verifywith thecompile-androidprofileBugInstance size is 0Error size is 0AndroidGradleBuilderSdkVersionTest: 3 tests passedBUILD SUCCESS