Merge pull request #122 from prime31/patch-1

fixes steps with packages in sub-steps
This commit is contained in:
Alexandros Naskos 2020-06-19 03:53:20 +03:00 committed by GitHub
commit c8223b3a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,12 @@ pub fn main() !void {
// We also flatten them, we should probably keep the nested structure. // We also flatten them, we should probably keep the nested structure.
for (builder.top_level_steps.items) |tls| { for (builder.top_level_steps.items) |tls| {
for (tls.step.dependencies.items) |step| { for (tls.step.dependencies.items) |step| {
try processStep(stdout_stream, step);
}
}
}
fn processStep(stdout_stream: var, step: *std.build.Step) anyerror!void {
if (step.cast(InstallArtifactStep)) |install_exe| { if (step.cast(InstallArtifactStep)) |install_exe| {
for (install_exe.artifact.packages.items) |pkg| { for (install_exe.artifact.packages.items) |pkg| {
try processPackage(stdout_stream, pkg); try processPackage(stdout_stream, pkg);
@ -37,7 +43,9 @@ pub fn main() !void {
for (exe.packages.items) |pkg| { for (exe.packages.items) |pkg| {
try processPackage(stdout_stream, pkg); try processPackage(stdout_stream, pkg);
} }
} } else {
for (step.dependencies.items) |unknown_step| {
try processStep(stdout_stream, unknown_step);
} }
} }
} }