Skip to content

Make JniGen name mangling placement-aware#79

Merged
milyin merged 2 commits into
mainfrom
package-aware-mangling
Jul 15, 2026
Merged

Make JniGen name mangling placement-aware#79
milyin merged 2 commits into
mainfrom
package-aware-mangling

Conversation

@milyin

@milyin milyin commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • pass the fully qualified destination package to placement-aware JniGen name-mangling hooks; keep the fixed-placement harness hook name-only
  • separate package function naming from class method naming with set_method_name_mangle(package, class, name)
  • rename class declaration .fun(...) to .method(...) and remove implicit generator-specific class-prefix stripping
  • route JNINative externs, handle destructors, vector helpers, class methods, and factories through the contextual method hook
  • keep explicit .name(...) overrides verbatim and order-independent

This enables binding consumers such as zenoh-flat-jni to systematize flat Rust names like z_session_put into Session.put without teaching prebindgen a Zenoh-specific convention.

Linked downstream PRs:

Verification

  • cargo clippy --all-targets --no-default-features --all-features -- --deny warnings
  • cargo test --all --all-features
  • bash examples/regen-check.sh
  • examples/covertest-kotlin: ./gradlew run (26 sections pass)

@milyin milyin merged commit d8b474d into main Jul 15, 2026
3 checks passed
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