Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
# Stable Zig Builds
#

- name: Setup Zig Stable (0.14.0)
- name: Setup Zig Stable (0.15.1)
# note(jae): 2024-09-15
# Uses download mirror first as preferred by Zig Foundation
# see: https://ziglang.org/news/migrate-to-self-hosting/
uses: mlugg/setup-zig@v2
with:
version: "0.14.0"
version: "0.15.1"

- name: Build Minimal Example (Zig Stable)
run: zig build -Dandroid=true --verbose
Expand Down Expand Up @@ -94,6 +94,23 @@ jobs:
# adb shell monkey --kill-process-after-error --monitor-native-crashes --pct-touch 100 -p com.zig.sdl2 --throttle 1000 -v 2
# working-directory: examples/sdl2

#
# Previous Stable Zig Build
#

- name: Setup Zig Previous Stable (0.14.0)
uses: mlugg/setup-zig@v2
with:
version: "0.14.0"

- name: Build Minimal Example (Zig Previous Stable)
run: zig build -Dandroid=true --verbose
working-directory: examples/minimal

- name: Build SDL2 Example (Zig Previous Stable)
run: zig build -Dandroid=true --verbose
working-directory: examples/sdl2

#
# Nightly Zig Builds
#
Expand Down
4 changes: 2 additions & 2 deletions src/android/android.zig
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const AndroidLog = struct {
};
}

fn log_each_newline(logger: *AndroidLog, buffer: []const u8) std.io.Writer.Error!usize {
fn log_each_newline(logger: *AndroidLog, buffer: []const u8) std.Io.Writer.Error!usize {
var written: usize = 0;
var bytes_to_log = buffer;
while (std.mem.indexOfScalar(u8, bytes_to_log, '\n')) |newline_pos| {
Expand All @@ -191,7 +191,7 @@ const AndroidLog = struct {
return written;
}

fn drain(w: *std.Io.Writer, data: []const []const u8, splat: usize) std.io.Writer.Error!usize {
fn drain(w: *std.Io.Writer, data: []const []const u8, splat: usize) std.Io.Writer.Error!usize {
const logger: *AndroidLog = @alignCast(@fieldParentPtr("writer", w));
var written: usize = 0;

Expand Down
8 changes: 3 additions & 5 deletions src/androidbuild/builtin_options_update.zig
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ fn make(step: *Step, _: Build.Step.MakeOptions) !void {

const package_name_path = builtin_options_update.package_name_stdout.getPath3(b, step);

// NOTE(jae): 2025-07-23
// As of Zig 0.15.0-dev.1092+d772c0627, package_name_path.openFile("") is not possible as it assumes you're appending *something*
const file = try package_name_path.root_dir.handle.openFile(package_name_path.sub_path, .{});

// Read package name from stdout and strip line feed / carriage return
// ie. "com.zig.sdl2\n\r"
const package_name_filedata = try file.readToEndAlloc(b.allocator, 8192);
const package_name_backing_buf = try b.allocator.alloc(u8, 8192);
defer b.allocator.free(package_name_backing_buf);
const package_name_filedata = try package_name_path.root_dir.handle.readFile(package_name_path.sub_path, package_name_backing_buf);
const package_name_stripped = std.mem.trimRight(u8, package_name_filedata, " \r\n");
const package_name: [:0]const u8 = try b.allocator.dupeZ(u8, package_name_stripped);

Expand Down
Loading