kn: fix CI and add documents for building script#1039
kn: fix CI and add documents for building script#1039axxel merged 9 commits intozxing-cpp:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Kotlin/Native wrapper and CI to improve Linux testing/linking and align the wrapper API with the current ZXing C API.
Changes:
- Refactors Kotlin/Native barcode format interop (switching from raw bitmask parsing to enum/value mapping and updating reader options formats getter/setter).
- Moves cinterop configuration from
libZXing.definto Gradle and adjusts Linux CI to build/test against shared libraries via Zig. - Tweaks CI workflows and ignores additional Kotlin tooling artifacts.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wrappers/kn/src/nativeMain/kotlin/zxingcpp/BarcodeWriter.kt | Updates creator options format interop to use the new cValue mapping. |
| wrappers/kn/src/nativeMain/kotlin/zxingcpp/BarcodeReader.kt | Reworks ReaderOptions.formats interop to use list + count API and pinned arrays. |
| wrappers/kn/src/nativeMain/kotlin/zxingcpp/BarcodeFormat.kt | Refactors BarcodeFormat to wrap ZXing_BarcodeFormat and adds conversion helpers. |
| wrappers/kn/src/nativeMain/kotlin/zxingcpp/Barcode.kt | Simplifies barcode format mapping via toKObject(). |
| wrappers/kn/build.gradle.kts | Embeds cinterop config in Gradle and configures Linux tests to use shared libs; adds Zig-based builds for Linux. |
| wrappers/kn/.gitignore | Ignores .kotlin directory. |
| .github/workflows/publish-kn.yml | Removes prebuilt linux artifact dependency; installs Zig; uploads built Linux shared libs. |
| .github/workflows/ci.yml | Removes system lib install step; installs Zig; updates konan version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… instead source header file The def file is only used by kotlin official cinterop plugin, the KrossCompile wrapper doesn't use it, move it's content into Gradle build script.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val soPath = "build/cmake/libZXing/${target.name}/out/lib" | ||
| when (target) { | ||
| is KotlinNativeTargetWithHostTests -> { | ||
| target.testRuns.withType<DefaultHostTestRun> { | ||
| executionTask.configure { | ||
| environment("LD_LIBRARY_PATH", soPath) | ||
| } |
There was a problem hiding this comment.
LD_LIBRARY_PATH is being set to just soPath, which overwrites any existing LD_LIBRARY_PATH value for the test process. This can break environments that rely on additional shared-library search paths (including CI runners and developer machines). Prefer prepending/appending soPath to the existing value (and handle the empty/null case) rather than replacing it outright.
|
Could you do me the favor and resolve the merge conflicts? |
|
confilict resolved :) |
|
Unfortunately, the publish-kn job failed to publish the results: https://github.com/axxel/zxing-cpp/actions/runs/14321812223 Could you have a look at this? Note that my lengthy work on fixing the publication of the android artifacts was apparently successful. Maybe there is some insight to have. |
Sorry but I cant access the workflow's log for it says "The logs for this run have expired and are no longer available." |
|
My bad, I sent you the wrong link. Here is the right one: https://github.com/zxing-cpp/zxing-cpp/actions/runs/21869699416 |
This pull request had done following things:
Version.h.libZXing.deftobuild.gradle.kts.strictEnumsconfiguration inlibZXing.defbefore.