Skip to content

Take odrcore from maven central instead of building it with conan - #558

Merged
andiwand merged 1 commit into
mainfrom
feat/odr-core-android-maven
Aug 2, 2026
Merged

Take odrcore from maven central instead of building it with conan#558
andiwand merged 1 commit into
mainfrom
feat/odr-core-android-maven

Conversation

@andiwand

@andiwand andiwand commented Aug 2, 2026

Copy link
Copy Markdown
Member

Replaces the conan build of odrcore with the app.opendocument:odr-core-android AAR that OpenDocument.core now publishes.

What goes away

The app pulled both halves of the JNI bindings out of the odrcore conan package — conan cross built libodr_jni.so for four ABIs, and conandeployer.py dropped them into jniLibs next to the odr-core-java.jar it extracted from the same package. All of it is replaced by one line in the version catalog.

That takes the NDK, python and conan out of the build entirely. ./gradlew assembleProDebug now needs a JDK and the android SDK, nothing else, and CI loses ~80 lines of NDK install / conan cache / submodule export per workflow. The conan-odr-index submodule goes with it.

Both halves still ship in one artifact, so they cannot drift — that was the original reason for sourcing them from one conan package, and it survives intact. It resolves from maven central, not github packages: the latter demands authentication even for a public artifact, which f-droid and other clean source builders cannot supply.

Runtime assets

CoreLoader.initializeCore used to unpack assets/core into filesDir and point the core at it. odrcore 6.2 ended the need: the renderer's css and js are written into the html it produces, and Odr.mimetype is core's own detection rather than libmagic. setOdrCoreDataPath and setLibmagicDatabasePath are both inert now, so the extraction only cost startup time and apk size. initializeCore sets TMPDIR and nothing more, and the 8.1 MB magic.mgc leaves the apk.

Verified

Built against a local publishToMavenLocal copy of the AAR, assembled from the CI native artifacts of core main:

  • assembleDebug, testProDebugUnitTest, lintProDebug, lintLiteDebug, spotlessCheck — all green from clean
  • the apk carries lib/{arm64-v8a,armeabi-v7a,x86,x86_64}/libodr_jni.so plus libc++_shared.so
  • assets/ holds only RawLoader's own html and font; no assets/core

Blocked on

app.opendocument:odr-core-android:6.2.0 does not exist on maven central yet — hence draft. Core main has published nothing since v6.1.0, and the libmagic/asset removals this depends on are unreleased. The pinned odrCore = "6.2.0" in gradle/libs.versions.toml is a guess at the next release number and needs correcting if it lands as something else. CI here will fail to resolve the dependency until then.

Worth a look

ndk.debugSymbolLevel = "full" is still set for release builds, but the .so files in the AAR are stripped upstream by build_native.py. Play will no longer receive useful native symbols for odrcore crashes. Fixing that means shipping unstripped libraries from core, so it is deliberately left alone here.

🤖 Generated with Claude Code

The app depended on the odrcore conan package for both halves of the JNI
bindings: conan cross built libodr_jni.so per ABI, and a custom deployer
dropped it into jniLibs alongside the odr-core-java.jar it pulled out of
the same package. That is now one ordinary maven dependency,
app.opendocument:odr-core-android, which ships the java classes and a
libodr_jni.so for all four ABIs in one AAR - so the two halves still
cannot drift, without an NDK, python or conan anywhere in the build.

It resolves from maven central rather than github packages, which asks
for authentication even for a public artifact and would lock out f-droid
and any other clean source builder.

The runtime asset extraction goes too. odrcore 6.2 writes the renderer's
css and js into the html it produces and answers mimetype with its own
detection rather than libmagic, so setOdrCoreDataPath and
setLibmagicDatabasePath are both inert - initializeCore only sets TMPDIR
now, and the 8.1 MB magic.mgc leaves the apk with them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lqc6gWzBBnoqvdaQ9HPoEa

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 394cbba8e0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread gradle/libs.versions.toml
@andiwand
andiwand merged commit cdb15d5 into main Aug 2, 2026
8 of 9 checks passed
@andiwand
andiwand deleted the feat/odr-core-android-maven branch August 2, 2026 14:08
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