Skip to content

maven: surface real Ant/server error in AntExecutor failures#4911

Open
shai-almog wants to merge 1 commit intomasterfrom
fix-ant-executor-server-error-message
Open

maven: surface real Ant/server error in AntExecutor failures#4911
shai-almog wants to merge 1 commit intomasterfrom
fix-ant-executor-server-error-message

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hardcoded "!!! Unable to restart the IEHS App !!!" RuntimeException in AntExecutor (a stale boilerplate string from the file's borrowed srccodes.com template) with the actual BuildException message so the failure is clear.
  • Tee System.out/System.err during the Ant build and, on failure, scan the captured output for server-error markers (Response message from server is:, Server Detailed Error Message:, Server returned HTTP response code:) and append them to the thrown exception message. This surfaces the JSON body returned by the build server (which the build client prints to stdout but never propagates via the exception chain).
  • Console output is still forwarded to the original streams, so the user-visible build log is unchanged.
  • Add AntExecutorTest covering the marker extraction.

Motivation

A Maven Android build that hit a server-side HTTP 500 on /appsec/7.0/build/upload produced this misleading error:

Failed to execute goal ... !!! Unable to restart the IEHS App !!!

while the relevant detail — {"timestamp":"...","status":500,"error":"Internal Server Error","path":"/appsec/7.0/build/upload"} — was visible only earlier in the log and not in the exception message.

Test plan

  • mvn test -Dtest=AntExecutorTest — passes (3/3).
  • mvn compile for codenameone-maven-plugin — clean.
  • Reproduce with a triggered server build failure and confirm the response JSON shows up in the Maven failure message.

🤖 Generated with Claude Code

The catch-all in AntExecutor threw a hardcoded "Unable to restart the
IEHS App" RuntimeException for every BuildException, masking the actual
cause. When a server build fails (e.g. an HTTP 500 from the build
server) the build client prints the response body and JSON error to
stdout but does not propagate it through the exception chain, so the
maven user only saw the misleading message.

Tee stdout/stderr while the Ant project runs, scan the captured output
for the server-error markers ("Response message from server is:",
"Server Detailed Error Message:", "Server returned HTTP response
code:") and include them in the thrown RuntimeException's message
alongside the underlying BuildException's message. Console output is
still forwarded to the original streams so the user-visible build log
is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

Compared 90 screenshots: 90 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 252 seconds

Build and Run Timing

Metric Duration
Simulator Boot 86000 ms
Simulator Boot (Run) 2000 ms
App Install 16000 ms
App Launch 3000 ms
Test Execution 244000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1203.000 ms
Base64 CN1 encode 1376.000 ms
Base64 encode ratio (CN1/native) 1.144x (14.4% slower)
Base64 native decode 1168.000 ms
Base64 CN1 decode 1425.000 ms
Base64 decode ratio (CN1/native) 1.220x (22.0% slower)
Base64 SIMD encode 589.000 ms
Base64 encode ratio (SIMD/native) 0.490x (51.0% faster)
Base64 encode ratio (SIMD/CN1) 0.428x (57.2% faster)
Base64 SIMD decode 371.000 ms
Base64 decode ratio (SIMD/native) 0.318x (68.2% faster)
Base64 decode ratio (SIMD/CN1) 0.260x (74.0% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 99.000 ms
Image createMask (SIMD on) 9.000 ms
Image createMask ratio (SIMD on/off) 0.091x (90.9% faster)
Image applyMask (SIMD off) 279.000 ms
Image applyMask (SIMD on) 89.000 ms
Image applyMask ratio (SIMD on/off) 0.319x (68.1% faster)
Image modifyAlpha (SIMD off) 192.000 ms
Image modifyAlpha (SIMD on) 61.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.318x (68.2% faster)
Image modifyAlpha removeColor (SIMD off) 186.000 ms
Image modifyAlpha removeColor (SIMD on) 66.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.355x (64.5% faster)
Image PNG encode (SIMD off) 1320.000 ms
Image PNG encode (SIMD on) 865.000 ms
Image PNG encode ratio (SIMD on/off) 0.655x (34.5% faster)
Image JPEG encode 430.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

Compared 90 screenshots: 90 matched.

Native Android coverage

  • 📊 Line coverage: 10.23% (5587/54613 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.04% (27411/340806), branch 3.70% (1207/32660), complexity 4.71% (1473/31285), method 8.27% (1209/14620), class 13.68% (269/1966)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 10.23% (5587/54613 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.04% (27411/340806), branch 3.70% (1207/32660), complexity 4.71% (1473/31285), method 8.27% (1209/14620), class 13.68% (269/1966)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 921.000 ms
Base64 CN1 encode 164.000 ms
Base64 encode ratio (CN1/native) 0.178x (82.2% faster)
Base64 native decode 914.000 ms
Base64 CN1 decode 286.000 ms
Base64 decode ratio (CN1/native) 0.313x (68.7% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

Compared 90 screenshots: 90 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 277 seconds

Build and Run Timing

Metric Duration
Simulator Boot 78000 ms
Simulator Boot (Run) 1000 ms
App Install 13000 ms
App Launch 25000 ms
Test Execution 219000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1295.000 ms
Base64 CN1 encode 1239.000 ms
Base64 encode ratio (CN1/native) 0.957x (4.3% faster)
Base64 native decode 686.000 ms
Base64 CN1 decode 878.000 ms
Base64 decode ratio (CN1/native) 1.280x (28.0% slower)
Base64 SIMD encode 383.000 ms
Base64 encode ratio (SIMD/native) 0.296x (70.4% faster)
Base64 encode ratio (SIMD/CN1) 0.309x (69.1% faster)
Base64 SIMD decode 388.000 ms
Base64 decode ratio (SIMD/native) 0.566x (43.4% faster)
Base64 decode ratio (SIMD/CN1) 0.442x (55.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 57.000 ms
Image createMask (SIMD on) 8.000 ms
Image createMask ratio (SIMD on/off) 0.140x (86.0% faster)
Image applyMask (SIMD off) 117.000 ms
Image applyMask (SIMD on) 50.000 ms
Image applyMask ratio (SIMD on/off) 0.427x (57.3% faster)
Image modifyAlpha (SIMD off) 130.000 ms
Image modifyAlpha (SIMD on) 53.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.408x (59.2% faster)
Image modifyAlpha removeColor (SIMD off) 136.000 ms
Image modifyAlpha removeColor (SIMD on) 60.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.441x (55.9% faster)
Image PNG encode (SIMD off) 1128.000 ms
Image PNG encode (SIMD on) 842.000 ms
Image PNG encode ratio (SIMD on/off) 0.746x (25.4% faster)
Image JPEG encode 496.000 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant