@@ -18,11 +18,9 @@ fn sdkRoot() *const [sdkRootIntern().len]u8 {
1818
1919// linux-x86_64
2020pub fn toolchainHostTag () []const u8 {
21- comptime {
22- const os = builtin .os .tag ;
23- const arch = builtin .cpu .arch ;
24- return @tagName (os ) ++ "-" ++ @tagName (arch );
25- }
21+ const os = builtin .os .tag ;
22+ const arch = builtin .cpu .arch ;
23+ return (comptime if (std .mem .eql (u8 , @tagName (os ), "macos" )) "darwin" else @tagName (os )) ++ "-" ++ @tagName (arch );
2624}
2725
2826/// This file encodes a instance of an Android SDK interface.
@@ -92,12 +90,12 @@ pub fn init(b: *Builder, user_config: ?UserConfig, toolchains: ToolchainVersions
9290 .name = "zip_add" ,
9391 .root_source_file = .{ .path = sdkRoot () ++ "/tools/zip_add.zig" },
9492 });
95- zip_add .addCSourceFile (sdkRoot () ++ "/vendor/kuba-zip/zip.c" , &[_ ][]const u8 {
93+ zip_add .addCSourceFile (.{ . file = .{ . path = sdkRoot () ++ "/vendor/kuba-zip/zip.c" }, . flags = &[_ ][]const u8 {
9694 "-std=c99" ,
9795 "-fno-sanitize=undefined" ,
9896 "-D_POSIX_C_SOURCE=200112L" ,
99- });
100- zip_add .addIncludePath (sdkRoot () ++ "/vendor/kuba-zip" );
97+ } } );
98+ zip_add .addIncludePath (.{ . path = sdkRoot () ++ "/vendor/kuba-zip" } );
10199 zip_add .linkLibC ();
102100
103101 break :blk HostTools {
@@ -503,10 +501,11 @@ pub fn createApp(
503501 }
504502 resource_dir_step .add (Resource {
505503 .path = "values/strings.xml" ,
506- .content = write_xml_step .getFileSource ("strings.xml" ).? ,
504+ // .content = write_xml_step.getFileSource("strings.xml").?,
505+ .content = write_xml_step .addCopyFile (.{ .path = "strings.xml" }, "" ),
507506 });
508507
509- const sdk_version_int = @enumToInt (app_config .target_version );
508+ const sdk_version_int = @intFromEnum (app_config .target_version );
510509
511510 if (sdk_version_int < 16 ) @panic ("Minimum supported sdk version is 16." );
512511
@@ -549,7 +548,8 @@ pub fn createApp(
549548 const unaligned_apk_file = make_unsigned_apk .addOutputFileArg (unaligned_apk_name );
550549
551550 make_unsigned_apk .addArg ("-M" ); // specify full path to AndroidManifest.xml to include in zip
552- make_unsigned_apk .addFileSourceArg (manifest_step .getFileSource ("AndroidManifest.xml" ).? );
551+ // make_unsigned_apk.addFileSourceArg(manifest_step.getFileSource("AndroidManifest.xml").?);
552+ make_unsigned_apk .addFileSourceArg (manifest_step .addCopyFile (.{ .path = "AndroidManifest.xml" }, "" ));
553553
554554 make_unsigned_apk .addArg ("-S" ); // directory in which to find resources. Multiple directories will be scanned and the first match found (left to right) will take precedence
555555 make_unsigned_apk .addDirectorySourceArg (resource_dir_step .getOutputDirectory ());
@@ -848,7 +848,7 @@ pub fn compileAppLibrary(
848848 ndk_root ,
849849 toolchainHostTag (),
850850 config .lib_dir ,
851- @enumToInt (app_config .target_version ),
851+ @intFromEnum (app_config .target_version ),
852852 });
853853
854854 const include_dir = std .fs .path .resolve (sdk .b .allocator , &[_ ][]const u8 {
@@ -887,7 +887,7 @@ pub fn compileAppLibrary(
887887
888888 // exe.addIncludePath(include_dir);
889889
890- exe .addLibraryPath (lib_dir );
890+ exe .addLibraryPath (.{ . path = lib_dir } );
891891
892892 // exe.addIncludePath(include_dir);
893893 // exe.addIncludePath(system_include_dir);
@@ -904,7 +904,7 @@ pub fn compileAppLibrary(
904904}
905905
906906fn createLibCFile (sdk : * const Sdk , version : AndroidVersion , folder_name : []const u8 , include_dir : []const u8 , sys_include_dir : []const u8 , crt_dir : []const u8 ) ! std.build.FileSource {
907- const fname = sdk .b .fmt ("android-{d}-{s}.conf" , .{ @enumToInt (version ), folder_name });
907+ const fname = sdk .b .fmt ("android-{d}-{s}.conf" , .{ @intFromEnum (version ), folder_name });
908908
909909 var contents = std .ArrayList (u8 ).init (sdk .b .allocator );
910910 errdefer contents .deinit ();
@@ -926,7 +926,8 @@ fn createLibCFile(sdk: *const Sdk, version: AndroidVersion, folder_name: []const
926926 try writer .writeAll ("gcc_dir=\n " );
927927
928928 const step = sdk .b .addWriteFile (fname , contents .items );
929- return step .getFileSource (fname ) orelse unreachable ;
929+ // return step.getFileSource(fname) orelse unreachable;
930+ return step .addCopyFile (.{ .path = fname }, "" );
930931}
931932
932933pub fn compressApk (sdk : Sdk , input_apk_file : []const u8 , output_apk_file : []const u8 ) * Step {
@@ -1151,22 +1152,22 @@ const BuildOptionStep = struct {
11511152 }
11521153 return ;
11531154 },
1154- std .builtin .Version = > {
1155- out .print (
1156- \\pub const {}: @import("std").builtin.Version = .{{
1157- \\ .major = {d},
1158- \\ .minor = {d},
1159- \\ .patch = {d},
1160- \\}};
1161- \\
1162- , .{
1163- std .zig .fmtId (name ),
1164-
1165- value .major ,
1166- value .minor ,
1167- value .patch ,
1168- }) catch unreachable ;
1169- },
1155+ // std.builtin.Version => {
1156+ // out.print(
1157+ // \\pub const {}: @import("std").builtin.Version = .{{
1158+ // \\ .major = {d},
1159+ // \\ .minor = {d},
1160+ // \\ .patch = {d},
1161+ // \\}};
1162+ // \\
1163+ // , .{
1164+ // std.zig.fmtId(name),
1165+
1166+ // value.major,
1167+ // value.minor,
1168+ // value.patch,
1169+ // }) catch unreachable;
1170+ // },
11701171 std .SemanticVersion = > {
11711172 out .print (
11721173 \\pub const {}: @import("std").SemanticVersion = .{{
0 commit comments