File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -359,10 +359,33 @@ fn doInstallApk(apk: *Apk) std.mem.Allocator.Error!*Step.InstallFile {
359359 // Add assets
360360 for (apk .assets .items ) | asset | {
361361 switch (asset ) {
362- .directory = > | asset_dir | {
362+ .directory = > | asset_dir_path | {
363363 aapt2link .addArg ("-A" );
364- aapt2link .addDirectoryArg (asset_dir .source );
365- },
364+ aapt2link .addDirectoryArg (asset_dir_path .source );
365+
366+ const cwd = if (builtin .zig_version .major == 0 and builtin .zig_version .minor <= 15 ) std .fs .cwd () else std .Io .Dir .cwd ();
367+
368+ var asset_dir = (
369+ if (builtin .zig_version .major == 0 and builtin .zig_version .minor <= 15 )
370+ cwd .openDir (asset_dir_path .source .cwd_relative , .{ .iterate = true })
371+ else
372+ cwd .openDir (b .graph .io , asset_dir_path .source .cwd_relative , .{ .iterate = true })
373+ ) catch | err | @panic (@errorName (err ));
374+
375+ defer if (builtin .zig_version .major == 0 and builtin .zig_version .minor <= 15 ) asset_dir .close () else asset_dir .close (b .graph .io );
376+
377+ var walker = try asset_dir .walk (b .allocator );
378+ defer walker .deinit ();
379+
380+ while ((
381+ if (builtin .zig_version .major == 0 and builtin .zig_version .minor <= 15 )
382+ walker .next ()
383+ else
384+ walker .next (b .graph .io )
385+ ) catch | err | @panic (@errorName (err ))) | entry | {
386+ if (entry .kind == .file ) aapt2link .addFileInput (try asset_dir_path .source .join (b .allocator , entry .path ));
387+ }
388+ }
366389 }
367390 }
368391
You can’t perform that action at this time.
0 commit comments