Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This PR introduces a Docker container for CI workflows to standardize the build environment and speed up execution by pre-installing dependencies.

Changes:

  1. Container Creation: Added a Dockerfile in .ci/container that includes:
    • Ubuntu 24.04 base.
    • Java 8 (ZuluFX), 11, 17, 21, and 25 (if available).
    • Android SDK (Command line tools, Platform tools, Build tools, Platforms 31/33/34, NDK).
    • cn1-binaries repo cloned to /opt/cn1-binaries.
    • Common build tools: Ant, Maven, Python 3, clang, etc.
  2. Container Build Workflow: Added build-container.yml to build and push the image to GHCR.
  3. Workflow Updates:
    • Updated pr.yml to run in the container, removing manual JDK setup and cn1-binaries cloning.
    • Updated ant.yml to run in the container.
    • Updated scripts-android.yml to run in the container (privileged mode for KVM).
    • Updated parparvm-tests.yml to run in the container and map environment variables.
  4. Script Updates:
    • Modified scripts/setup-workspace.sh to respect CN1_BINARIES environment variable (set in container) and allow skipping git updates via CN1_SKIP_BINARIES_UPDATE.

Note: The workflows in this PR will fail until the container image is successfully built and pushed to ghcr.io/codenameone/codenameone/ci-container:latest. This requires merging the PR or manually triggering the build workflow if permissions allow.


PR created automatically by Jules for task 8659650574294850933 started by @shai-almog

- Added `.ci/container/Dockerfile` based on Ubuntu 24.04 with Java 8-25, Android SDK, and build tools.
- Added `.github/workflows/build-container.yml` to build and push the container image.
- Updated `.github/workflows/pr.yml`, `ant.yml`, `scripts-android.yml`, `parparvm-tests.yml` to use the new container.
- Updated `scripts/setup-workspace.sh` to respect `CN1_BINARIES` and skip updates if needed.
- Optimized dependencies installation by using pre-installed tools in the container.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

- Added `.ci/container/Dockerfile` based on Ubuntu 24.04 with Java 8-25, Android SDK, and build tools.
- Added `.github/workflows/build-container.yml` to build and push the container image.
- Updated `.github/workflows/pr.yml`, `ant.yml`, `scripts-android.yml`, `parparvm-tests.yml` to use the new container.
- Updated `scripts/setup-workspace.sh` to respect `CN1_BINARIES` and skip updates if needed.
- Optimized dependencies installation by using pre-installed tools in the container.
- Added `.ci/container/Dockerfile` based on Ubuntu 24.04 with Java 8-25, Android SDK, and build tools.
- Added `.github/workflows/build-container.yml` to build and push the container image.
- Updated `.github/workflows/pr.yml`, `ant.yml`, `scripts-android.yml`, `parparvm-tests.yml` to use the new container.
- Updated `scripts/setup-workspace.sh` to respect `CN1_BINARIES` and skip updates if needed.
- Optimized dependencies installation by using pre-installed tools in the container.
@github-actions
Copy link

github-actions bot commented Dec 19, 2025

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

- Changed Android SDK installation location to `/opt/android/sdk` to avoid `AndroidGradleBuilder` path resolution issues which occur when `ANDROID_HOME` name is not "sdk".
- Set `ANDROID_HOME` to `/opt/android/sdk`.
- Updated `.ci/container/Dockerfile` accordingly.
- Added `packages: read` permissions to CI workflows to allow pulling the container image.
- Separated Java 25 installation to allow failure without breaking the entire build.
- Added Java 11 support to workflows.
@shai-almog
Copy link
Collaborator

shai-almog commented Dec 19, 2025

iOS screenshot updates

Compared 30 screenshots: 24 matched, 5 updated, 1 missing reference.

  • BrowserComponent — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    BrowserComponent
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

  • graphics-draw-gradient — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-gradient
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-gradient.png in workflow artifacts.

  • graphics-draw-round-rect — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots/graphics-draw-round-rect.png.

    graphics-draw-round-rect
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 844x1835.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

  • graphics-draw-string — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 422x918.
    Full-resolution PNG saved as graphics-draw-string.png in workflow artifacts.

  • graphics-draw-string-decorated — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    graphics-draw-string-decorated
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 603x1311.
    Full-resolution PNG saved as graphics-draw-string-decorated.png in workflow artifacts.

  • kotlin — updated screenshot. Screenshot differs (1206x2622 px, bit depth 8).

    kotlin
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as kotlin.png in workflow artifacts.

Benchmark Results

  • VM Translation Time: 259 seconds
  • Compilation Time: 48 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 23673 ms
Extract Extensions 15 ms
Google Services Setup 3 ms
Scan Classes 428 ms
Extract Libs 838 ms
Inject Build Hints 30 ms
Generate Unit Tests 2 ms
Generate Stubs 808 ms
Compile Stubs 1842 ms
Generate Icons 784 ms
Prepare ParparVM 102 ms
ParparVM Execution 150872 ms
Post-VM Setup 127 ms
CocoaPods 4005 ms
Finalize 25 ms
Total Time 183555 msMaven Overhead : 76000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot (Run) 42000 ms
App Install 34000 ms
App Launch 10000 ms
Test Execution 140000 ms

google-labs-jules bot and others added 7 commits December 19, 2025 16:26
- Replaced non-ASCII arrow character in `AndroidScreenshotTask.java` with ASCII "->" to fix compilation error.
- Updated `Ports/Android/build.xml` to explicitly use `encoding="UTF-8"` for `javac` tasks.
- Updated `.ci/container/Dockerfile` to generate and enforce `en_US.UTF-8` locale in the build container.
- Replaced non-ASCII arrow character in `AndroidScreenshotTask.java` with ASCII "->" to fix compilation error.
- Updated `Ports/Android/build.xml` to explicitly use `encoding="UTF-8"` for `javac` tasks.
- Updated `.ci/container/Dockerfile` to generate and enforce `en_US.UTF-8` locale in the build container.
Updated `AndroidGradleBuilder.java` to improve SDK path detection. Instead of assuming any `ANDROID_HOME` path that doesn't end in "sdk" must be a parent directory, the builder now validates the directory content (checking for `platform-tools`, `build-tools`, etc.) before modifying the path. This change ensures compatibility with the new CI container layout where `ANDROID_HOME` points directly to the SDK root at `/opt/android-sdk` (or `/opt/android/sdk`) without forcing an incorrect `/sdk` suffix.
Updated CI workflows to use a unified Docker container with pre-installed dependencies. Addressed build failures related to Android SDK tools requiring newer Java versions and fixed Maven plugin dependencies.

- **CI Containerization:**
    - Created `.ci/container/Dockerfile` based on Ubuntu 24.04 with OpenJDK 8-25, Android SDK, Ant, Maven, and Python.
    - Updated `pr.yml`, `ant.yml`, `scripts-android.yml`, and `parparvm-tests.yml` to run inside the container.
    - Added `build-container.yml` workflow to build and push the container image.

- **Fix Android Build:**
    - Modified `AndroidGradleBuilder.java` to set `JAVA_HOME` to Java 17/11 (if available) for spawned processes, ensuring `sdkmanager` runs correctly.
    - Updated `scripts/run-android-instrumentation-tests.sh` to explicitly use `JAVA17_HOME` for `sdkmanager`.
    - Improved `AndroidGradleBuilder` SDK path detection to support standard paths like `/opt/android-sdk`.

- **Fix Maven Plugin:**
    - Added `xalan` and `serializer` dependencies to `maven/codenameone-maven-plugin/pom.xml` to resolve `NoClassDefFoundError` during CSS compilation.

- **Encoding Fixes:**
    - Enforced UTF-8 encoding in `Ports/Android/build.xml` and fixed a non-ASCII character in source code.
- **Android CI:**
  - Updated `.github/workflows/scripts-android.yml` to explicitly set `JAVA_HOME` to Java 17 for the `reactivecircus/android-emulator-runner` step. This resolves `UnsupportedClassVersionError` in `sdkmanager` (which requires Java 17+), ensuring the Android SDK and emulator are correctly initialized within the CI container (where the default `JAVA_HOME` is Java 8).

- **Maven Plugin:**
  - Modified `maven/codenameone-maven-plugin/pom.xml` to move `xalan` and `serializer` dependencies to the top of the dependency list. This prioritizes them on the classpath over `codenameone-designer` (a fat jar), resolving a `NoClassDefFoundError: org/apache/xml/serializer/OutputPropertiesFactory` that occurred during CSS compilation in archetype integration tests.
- **Fix `setup-workspace.sh`:** Updated logic to correctly skip `cn1-binaries` update when `CN1_SKIP_BINARIES_UPDATE=1` is set, preventing accidental deletion of the pre-installed repository in the CI container.
- **Fix Android Workflow:**
    - Explicitly set `CN1_BINARIES` and `MAVEN_HOME` env vars in `scripts-android.yml` to utilize pre-installed tools in the container, saving disk space and time.
    - Added `disk-size: 4096M` to the emulator runner configuration to constrain the userdata partition size, resolving "Not enough space to create userdata partition" errors on standard runners.
@shai-almog
Copy link
Collaborator

shai-almog commented Dec 20, 2025

Android screenshot updates

Compared 30 screenshots: 29 matched, 1 updated.

  • graphics-draw-arc — updated screenshot. Screenshot differs (320x616 px, bit depth 8).

    graphics-draw-arc
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as graphics-draw-arc.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 24.70% (2635/10667 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 24.36% (12263/50336), branch 15.32% (711/4640), complexity 17.42% (735/4220), method 32.67% (593/1815), class 34.65% (105/303)
    • Lowest covered classes
      • com.codename1.impl.android.com.codename1.impl.android.AndroidContactsManager – 0.00% (0/400 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$Video – 0.00% (0/168 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.IntentIntegrator – 0.00% (0/139 lines covered)
      • com.codename1.impl.android.util.com.codename1.impl.android.util.Base64 – 0.00% (0/117 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidImplementation$SocketImpl – 0.00% (0/77 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidTextureView – 0.00% (0/76 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidSurfaceView – 0.00% (0/73 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.LocalNotificationPublisher – 0.00% (0/65 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.FridaDetectionUtil – 0.00% (0/64 lines covered)
      • com.codename1.impl.android.com.codename1.impl.android.AndroidDB – 0.00% (0/57 lines covered)

@shai-almog shai-almog closed this Dec 20, 2025
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.

2 participants