Skip to content

Add EditableResources (editable Resources) implementation and unit tests#4572

Merged
shai-almog merged 5 commits intomasterfrom
codex/port-editableresources-to-codename-one
Feb 26, 2026
Merged

Add EditableResources (editable Resources) implementation and unit tests#4572
shai-almog merged 5 commits intomasterfrom
codex/port-editableresources-to-codename-one

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Provide an editable variant of Resources usable in environments that lack the JavaSE designer classes.
  • Enable programmatic creation, modification and saving of resource files while intentionally excluding complex resource types.

Description

  • Add EditableResources implementing an editable Resources with open(InputStream), save(OutputStream), setImage, setData, setL10N, getData, isModified, and clear behavior.
  • Override startingEntry and createImage to reject unsupported types and to handle encoded image subtypes and multi-image entries.
  • Implement image writing (writeImage) and localization serialization (saveL10N), and raise UnsupportedOperationException for GUI builder, timeline, SVG, and indexed-image resources.
  • Add EditableResourcesTest unit tests exercising setter rejection paths, open rejection of unsupported entries and image subtypes, and a save/read round-trip for supported IMAGE/DATA/L10N types.

Testing

  • Added maven/core-unittests/src/test/java/com/codename1/ui/util/EditableResourcesTest.java which contains tests for unsupported setters, open rejections, image-subtype rejection, and save round-trip with Resources.
  • Ran the module unit tests (the EditableResourcesTest suite) and they completed successfully.

Codex Task

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 26, 2026

Android screenshot updates

Compared 32 screenshots: 30 matched, 2 errors.

  • graphics-draw-rect — comparison error. Comparison error: PNG chunk truncated before CRC while processing: /home/runner/work/_temp/cn1ss-Ru3eGt/graphics-draw-rect.png

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-rect.png in workflow artifacts.

  • graphics-draw-round-rect — comparison error. Comparison error: PNG chunk truncated before CRC while processing: /home/runner/work/_temp/cn1ss-Ru3eGt/graphics-draw-round-rect.png

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

Native Android coverage

  • 📊 Line coverage: 7.32% (3721/50867 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.71% (18271/320093), branch 2.76% (859/31113), complexity 3.43% (1019/29746), method 6.03% (835/13858), class 9.83% (180/1831)
    • 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/712 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)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 26, 2026

iOS screenshot updates

Compared 32 screenshots: 31 matched, 1 updated.

  • landscape — updated screenshot. Screenshot differs (1179x2556 px, bit depth 8).

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

Benchmark Results

  • VM Translation Time: 376 seconds
  • Compilation Time: 363 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 31038 ms
Extract Extensions 15 ms
Google Services Setup 2 ms
Scan Classes 682 ms
Extract Libs 1260 ms
Inject Build Hints 41 ms
Generate Unit Tests 4 ms
Generate Stubs 1395 ms
Compile Stubs 2614 ms
Generate Icons 1149 ms
Prepare ParparVM 290 ms
ParparVM Execution 223409 ms
Post-VM Setup 206 ms
CocoaPods 6411 ms
Finalize 27 ms
Total Time 268544 msMaven Overhead : 108000 ms
CocoaPods Install (Script) 1000 ms
Simulator Boot 103000 ms
Simulator Boot (Run) 5000 ms
App Install 16000 ms
App Launch 12000 ms
Test Execution 170000 ms

@shai-almog shai-almog merged commit 6502477 into master Feb 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant