Skip to content

Fix initializr projects: keep win32 module, dual-mode default theme, Linux/win32 IDE targets#5299

Open
shai-almog wants to merge 2 commits into
masterfrom
fix/initializr-win32-theme-linux-targets
Open

Fix initializr projects: keep win32 module, dual-mode default theme, Linux/win32 IDE targets#5299
shai-almog wants to merge 2 commits into
masterfrom
fix/initializr-win32-theme-linux-targets

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Fixes three problems reported for projects downloaded from initializr / generated via the cn1app-archetype.

1. Missing win/ folder — keep the win32 native module

win/ is now the native win32 target (platform=win, buildTarget=windows-device, built by WindowsNativeBuilder), not the retired UWP module. The generator was still stripping win/ and its root-pom <profile id="win"> for Java 17, with stale "retired UWP" comments.

  • GeneratorModel.java (initializr server): dropped the dropWindowsModule zip filter and the pom <profile id="win"> strip; removed the now-dead stripWindowsModuleProfile method.
  • archetype-post-generate.groovy (local mvn archetype:generate): removed the win/ deletion + profile strip and its mirror method. Java-8 .claude/ stripping preserved.
  • GeneratorModelMatrixTest: Java 17 now asserts win/ ships (was asserting it must be absent); Java 8 comment updated.
  • win/pom.xml: fixed copy-paste build execution id build-android -> build-windows.

The win module ships for every Java version now and is activated via the win profile (-Dcodename1.platform=win).

2. "Initializr Theme Overrides" broke light mode — ship a dual-mode default

The UI no longer exposes a theme picker, but currentOptions() still derived the generated theme from the website's host dark-mode flag, emitting hard-coded dark colors at top-level CSS scope that broke light mode for anyone who opened the project.

  • Initializr.java: generation always ships the barebones default (no host dark/light state baked in).
  • theme.css: replaced the commented-out example with an active @media (prefers-color-scheme: dark) block, so the default theme adapts to both light and dark out of the box.

3. Missing desktop/native build targets in the IDE

  • IntelliJ workspace.xml: added Linux Desktop Build, Linux Device Build, and Windows Device Build (win32), each registered in the RunManager <list> (the list entry is what makes a config appear).
  • NetBeans nb-configuration.xml: added Linux Desktop App (it already had the win32 Windows Device App).

Verification

  • initializr CN1 test suite passes 6/6 (./mvnw -pl javase -am test -Ptest -Dcodename1.platform=javase -DfailIfNoTests=false), including GeneratorModelMatrixTest asserting win/ ships for Java 17 and the dual-mode default theme.
  • workspace.xml and nb-configuration.xml pass xmllint; groovy is brace-balanced with no dangling win/strip references.

Rollout

These live in the initializr server, the cn1app-archetype artifact, and the codenameone-maven-plugin artifact — they take effect for new downloads once those are republished/redeployed.

🤖 Generated with Claude Code

…, Linux/win32 IDE targets

Three fixes for projects downloaded from initializr / generated via the
cn1app-archetype:

- Keep the win/ module (now the native win32 target, not the retired UWP
  module) for every Java version. The generator was still stripping win/
  and its root-pom <profile id="win"> for Java 17 with stale "retired UWP"
  comments. Removed that strip from GeneratorModel (initializr server) and
  archetype-post-generate.groovy (local archetype:generate), and updated the
  matrix test to assert win/ ships for Java 17. Also fixed a copy-paste
  build execution id in win/pom.xml (build-android -> build-windows).

- Stop baking the website's dark/light state into downloads. The UI no
  longer exposes a theme picker, but currentOptions() still derived the
  theme from the host dark-mode flag, emitting hard-coded dark colors at
  top-level CSS scope that broke light mode. Generation now always ships the
  barebones default, and theme.css carries an active
  @media (prefers-color-scheme: dark) block so the default theme adapts to
  both modes out of the box.

- Add missing desktop/native build run configs. IntelliJ workspace.xml gains
  Linux Desktop Build, Linux Device Build, and Windows Device Build (win32),
  each registered in the RunManager <list> so they actually appear; NetBeans
  nb-configuration.xml gains Linux Desktop App (it already had the win32
  Windows Device App).

Verified: initializr CN1 test suite passes 6/6 (GeneratorModelMatrixTest now
asserts win/ for Java 17 and the dual-mode default theme); workspace.xml and
nb-configuration.xml pass xmllint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 139 screenshots: 139 matched.

Native Android coverage

  • 📊 Line coverage: 14.62% (8986/61459 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 11.85% (44203/373047), branch 5.24% (1840/35083), complexity 6.30% (2119/33613), method 10.92% (1715/15708), class 17.78% (396/2227)
    • 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: 14.62% (8986/61459 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 11.85% (44203/373047), branch 5.24% (1840/35083), complexity 6.30% (2119/33613), method 10.92% (1715/15708), class 17.78% (396/2227)
    • 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
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 229ms / native 244ms = 0.9x speedup
SIMD float-mul (64K x300) java 144ms / native 111ms = 1.2x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 272.000 ms
Base64 CN1 decode 190.000 ms
Base64 native encode 1084.000 ms
Base64 encode ratio (CN1/native) 0.251x (74.9% faster)
Base64 native decode 832.000 ms
Base64 decode ratio (CN1/native) 0.228x (77.2% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 131 screenshots: 131 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 137 screenshots: 137 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 72ms / native 4ms = 18.0x speedup
SIMD float-mul (64K x300) java 79ms / native 8ms = 9.8x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 357.000 ms
Base64 CN1 decode 260.000 ms
Base64 native encode 1450.000 ms
Base64 encode ratio (CN1/native) 0.246x (75.4% faster)
Base64 native decode 807.000 ms
Base64 decode ratio (CN1/native) 0.322x (67.8% faster)
Base64 SIMD encode 54.000 ms
Base64 encode ratio (SIMD/CN1) 0.151x (84.9% faster)
Base64 SIMD decode 61.000 ms
Base64 decode ratio (SIMD/CN1) 0.235x (76.5% faster)
Base64 encode ratio (SIMD/native) 0.037x (96.3% faster)
Base64 decode ratio (SIMD/native) 0.076x (92.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 49.000 ms
Image createMask (SIMD on) 11.000 ms
Image createMask ratio (SIMD on/off) 0.224x (77.6% faster)
Image applyMask (SIMD off) 287.000 ms
Image applyMask (SIMD on) 246.000 ms
Image applyMask ratio (SIMD on/off) 0.857x (14.3% faster)
Image modifyAlpha (SIMD off) 273.000 ms
Image modifyAlpha (SIMD on) 199.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.729x (27.1% faster)
Image modifyAlpha removeColor (SIMD off) 297.000 ms
Image modifyAlpha removeColor (SIMD on) 231.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.778x (22.2% faster)

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 69000 ms
Simulator Boot (Run) 2000 ms
App Install 11000 ms
App Launch 1000 ms
Test Execution 369000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 69ms / native 3ms = 23.0x speedup
SIMD float-mul (64K x300) java 124ms / native 3ms = 41.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 303.000 ms
Base64 CN1 decode 330.000 ms
Base64 native encode 382.000 ms
Base64 encode ratio (CN1/native) 0.793x (20.7% faster)
Base64 native decode 316.000 ms
Base64 decode ratio (CN1/native) 1.044x (4.4% slower)
Base64 SIMD encode 64.000 ms
Base64 encode ratio (SIMD/CN1) 0.211x (78.9% faster)
Base64 SIMD decode 85.000 ms
Base64 decode ratio (SIMD/CN1) 0.258x (74.2% faster)
Base64 encode ratio (SIMD/native) 0.168x (83.2% faster)
Base64 decode ratio (SIMD/native) 0.269x (73.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 18.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.056x (94.4% faster)
Image applyMask (SIMD off) 50.000 ms
Image applyMask (SIMD on) 30.000 ms
Image applyMask ratio (SIMD on/off) 0.600x (40.0% faster)
Image modifyAlpha (SIMD off) 51.000 ms
Image modifyAlpha (SIMD on) 53.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.039x (3.9% slower)
Image modifyAlpha removeColor (SIMD off) 201.000 ms
Image modifyAlpha removeColor (SIMD on) 197.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.980x (2.0% faster)

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 77000 ms
Simulator Boot (Run) 0 ms
App Install 11000 ms
App Launch 36000 ms
Test Execution 411000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 73ms / native 3ms = 24.3x speedup
SIMD float-mul (64K x300) java 58ms / native 3ms = 19.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 403.000 ms
Base64 CN1 decode 383.000 ms
Base64 native encode 391.000 ms
Base64 encode ratio (CN1/native) 1.031x (3.1% slower)
Base64 native decode 640.000 ms
Base64 decode ratio (CN1/native) 0.598x (40.2% faster)
Base64 SIMD encode 59.000 ms
Base64 encode ratio (SIMD/CN1) 0.146x (85.4% faster)
Base64 SIMD decode 50.000 ms
Base64 decode ratio (SIMD/CN1) 0.131x (86.9% faster)
Base64 encode ratio (SIMD/native) 0.151x (84.9% faster)
Base64 decode ratio (SIMD/native) 0.078x (92.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 19.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.158x (84.2% faster)
Image applyMask (SIMD off) 59.000 ms
Image applyMask (SIMD on) 76.000 ms
Image applyMask ratio (SIMD on/off) 1.288x (28.8% slower)
Image modifyAlpha (SIMD off) 101.000 ms
Image modifyAlpha (SIMD on) 38.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.376x (62.4% faster)
Image modifyAlpha removeColor (SIMD off) 70.000 ms
Image modifyAlpha removeColor (SIMD on) 35.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.500x (50.0% faster)

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Apple TV (tvOS / Metal)

Compared 136 screenshots: 135 matched, 1 missing actual.

  • DesktopMode — missing actual screenshot. Actual screenshot missing (test did not produce output).

    No preview available for this screenshot.

@shai-almog

shai-almog commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 214 screenshots: 214 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

…e dark theme

The previous commit forced currentOptions() to always LIGHT to stop baking
dark overrides into downloads. But that method also feeds the live preview, so
on a dark host the "Hello World" preview lost its dark styling and looked
un-themed.

- Decouple the two consumers: currentOptions() is restored to host-aware
  (darkMode ? DARK : LIGHT) and drives only the preview; a new downloadOptions()
  always returns the barebones default theme and drives the generated download.
  The preview behaves exactly as before the PR; downloads still ship a clean
  theme.css with no injected "Initializr Theme Overrides".

- Make theme.css's dark block conservative. The aggressive version overrode
  Form/Toolbar/Button/Title/Dialog with flat colors, which clobbered the native
  theme in dark mode (the same "no native theme" symptom, in the built app).
  The native theme already handles dark mode for standard components, so the
  dark block now only flips the side menu -- the one thing this template
  hard-codes to light colors -- matching the team's original commented example.

Verified: initializr CN1 test suite passes 6/6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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