Skip to content

Commit 3f5cf03

Browse files
Enable Spotless verification for Android Port and consolidate reporting
- Added `spotless-maven-plugin` to `maven/android/pom.xml` configured for `Ports/Android/src`. - Updated `scripts/build-android-port.sh` to run `spotless:check` with verbose logging and capture results to a report file. - Modified `scripts/lib/cn1ss.sh` and `scripts/run-android-instrumentation-tests.sh` to append the Spotless report to the main Android status comment. - Updated `scripts/run-android-instrumentation-tests.sh` to fail the build if Spotless checks failed, after reporting is complete. - Updated `.github/workflows/scripts-android.yml` and reporting scripts to suppress noisy "missing report" warnings and correctly collect test artifacts.
1 parent 601318f commit 3f5cf03

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

scripts/build-android-port.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,22 @@ mkdir -p "$ARTIFACTS_DIR" || true
139139
SPOTLESS_REPORT="$ARTIFACTS_DIR/spotless-report.md"
140140
SPOTLESS_LOG="$ARTIFACTS_DIR/spotless.log"
141141

142-
if JAVA_HOME="$JAVA17_HOME" run_maven -e -f maven/pom.xml -pl android -Dcn1.binaries="$CN1_BINARIES" -P !download-cn1-binaries -Djava.awt.headless=true com.diffplug.spotless:spotless-maven-plugin:check > "$SPOTLESS_LOG" 2>&1; then
143-
echo "✅ **Spotless:** Passed" > "$SPOTLESS_REPORT"
142+
log "Running Spotless verification with JAVA_HOME=$JAVA17_HOME"
143+
if JAVA_HOME="$JAVA17_HOME" run_maven -X -f maven/pom.xml -pl android -Dcn1.binaries="$CN1_BINARIES" -P !download-cn1-binaries -Djava.awt.headless=true com.diffplug.spotless:spotless-maven-plugin:check > "$SPOTLESS_LOG" 2>&1; then
144+
{
145+
echo "✅ **Spotless:** Passed"
146+
echo ""
147+
echo "Files checked:"
148+
grep "Spotless checks" "$SPOTLESS_LOG" || echo "Count not found in log"
149+
echo ""
150+
echo "<details><summary>Full Spotless Log (Success)</summary>"
151+
echo ""
152+
echo "\`\`\`"
153+
cat "$SPOTLESS_LOG"
154+
echo "\`\`\`"
155+
echo ""
156+
echo "</details>"
157+
} > "$SPOTLESS_REPORT"
144158
else
145159
log "Spotless check failed. See artifacts/spotless.log"
146160
{

0 commit comments

Comments
 (0)