ReviewOS

also looking at this

craft-native/craft

feat(android): getDeviceInfo in Zig, and the JNI calls it needed

#137
Merged glennmichael123 wants to merge feat/android-jni-args into main
3 files +741 -0
packages/zig/build.zigmodified+14-0
Changes to packages/zig/build.zig
@@ -413,6 +413,18 @@ pub fn build(b: *std.Build) void {
413413 });
414414 const run_jni_tests = b.addRunArtifact(jni_tests);
415415
416 // The Android bridge modules. Rooted at the device module because it is
417 // the only one so far; a second joins by being imported from here, the way
418 // `ios.zig` gathers the iOS ones.
419 const android_bridge_tests = b.addTest(.{
420 .root_module = b.createModule(.{
421 .root_source_file = b.path("src/bridge_android_device.zig"),
422 .target = target,
423 .optimize = optimize,
424 }),
425 });
426 const run_android_bridge_tests = b.addRunArtifact(android_bridge_tests);
427
416428 ios_conformance_tests.root_module.addAnonymousImport("CraftApp.swift", .{
417429 .root_source_file = b.path("../ios/templates/CraftApp.swift"),
418430 });
@@ -1526,6 +1538,7 @@ pub fn build(b: *std.Build) void {
15261538 }
15271539 test_step.dependOn(&run_ios_conformance_tests.step);
15281540 test_step.dependOn(&run_jni_tests.step);
1541 test_step.dependOn(&run_android_bridge_tests.step);
15291542 test_step.dependOn(&run_menubar_tests.step);
15301543 test_step.dependOn(&run_components_tests.step);
15311544 test_step.dependOn(&run_gpu_tests.step);
@@ -2202,6 +2215,7 @@ pub fn build(b: *std.Build) void {
22022215 // second one: `jni_runtime.zig` is the only way anything here reaches Java,
22032216 // so a run that skipped it would not be an Android test run.
22042217 test_android_step.dependOn(&run_jni_tests.step);
2218 test_android_step.dependOn(&run_android_bridge_tests.step);
22052219
22062220 // Add Android tests to the main test step
22072221 test_step.dependOn(&run_android_tests.step);