Skip to content

Book importer: handle Otzaria source layout, invoke module mains via reflection, and adjust packaging/JVM toolchain#5

Merged
arieldaniely merged 2 commits into
masterfrom
codex/fix-unresolved-references-in-importexecution.kt-g17p07
Mar 3, 2026
Merged

Book importer: handle Otzaria source layout, invoke module mains via reflection, and adjust packaging/JVM toolchain#5
arieldaniely merged 2 commits into
masterfrom
codex/fix-unresolved-references-in-importexecution.kt-g17p07

Conversation

@arieldaniely

Copy link
Copy Markdown
Owner

Motivation

  • Allow users to point at either the Otzaria root folder or its parent by recognizing the Hebrew folder name אוצריא when importing.
  • Avoid hard compile-time coupling to other generator modules when launching their main entrypoints so the desktop app can be packaged more easily.
  • Tweak packaging and toolchain settings to match the build environment for native distributions.

Description

  • Replace direct calls to generated *Kt.main functions with reflective helpers invokeArrayMain and invokeNoArgMain that call Class.forName(...).getMethod("main"...) to invoke other modules at runtime.
  • Add resolveOtzariaSourceRoot in ImportExecution.kt and resolveLibraryDir in ImportPreflight to normalize incoming root paths to the actual אוצריא library directory used by scanning/importing.
  • Harden input validation in ImportPreflight.validateInputs to require that each provided root is either the אוצריא folder itself or a directory that contains an אוצריא child.
  • Add a buildTypes.release.proguard { isEnabled.set(false) } block to the compose desktop application configuration and update the project JVM toolchain version from 25 to 21 in libs.versions.toml.

Testing

  • Verified the project compiles successfully with ./gradlew :generator:bookimporter:build (build succeeded).
  • Ran the desktop importer assemble step as a smoke check (:generator:bookimporter:assemble) which completed without compilation errors.

Codex Task

@arieldaniely arieldaniely merged commit e11b95d into master Mar 3, 2026
1 check passed
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review


P2 Badge Unwrap InvocationTargetException from reflective main calls

When any invoked generator main throws, Method.invoke wraps it in InvocationTargetException, whose message is typically null; this regresses error reporting because the importer surfaces only error.message (and the UI shows it.message), so failures become הייבוא נכשל: null instead of the real cause. Unwrapping and rethrowing the underlying cause preserves actionable diagnostics during failed imports.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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