Skip to content

Commit

Permalink
build: rename std.Build.*Step to std.Build.Step.*
Browse files Browse the repository at this point in the history
Follow-up actions from #14647

Fixes #14947
  • Loading branch information
sterchelen authored and Vexu committed May 3, 2023
1 parent 855493b commit 13eb725
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 44 deletions.
28 changes: 14 additions & 14 deletions lib/std/Build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ pub const Builder = Build;
pub const InstallDirectoryOptions = InstallDirStep.Options;

pub const Step = @import("Build/Step.zig");
pub const CheckFileStep = @import("Build/CheckFileStep.zig");
pub const CheckObjectStep = @import("Build/CheckObjectStep.zig");
pub const ConfigHeaderStep = @import("Build/ConfigHeaderStep.zig");
pub const FmtStep = @import("Build/FmtStep.zig");
pub const InstallArtifactStep = @import("Build/InstallArtifactStep.zig");
pub const InstallDirStep = @import("Build/InstallDirStep.zig");
pub const InstallFileStep = @import("Build/InstallFileStep.zig");
pub const ObjCopyStep = @import("Build/ObjCopyStep.zig");
pub const CompileStep = @import("Build/CompileStep.zig");
pub const OptionsStep = @import("Build/OptionsStep.zig");
pub const RemoveDirStep = @import("Build/RemoveDirStep.zig");
pub const RunStep = @import("Build/RunStep.zig");
pub const TranslateCStep = @import("Build/TranslateCStep.zig");
pub const WriteFileStep = @import("Build/WriteFileStep.zig");
pub const CheckFileStep = @import("Build/Step/CheckFile.zig");
pub const CheckObjectStep = @import("Build/Step/CheckObject.zig");
pub const ConfigHeaderStep = @import("Build/Step/ConfigHeader.zig");
pub const FmtStep = @import("Build/Step/Fmt.zig");
pub const InstallArtifactStep = @import("Build/Step/InstallArtifact.zig");
pub const InstallDirStep = @import("Build/Step/InstallDir.zig");
pub const InstallFileStep = @import("Build/Step/InstallFile.zig");
pub const ObjCopyStep = @import("Build/Step/ObjCopy.zig");
pub const CompileStep = @import("Build/Step/Compile.zig");
pub const OptionsStep = @import("Build/Step/Options.zig");
pub const RemoveDirStep = @import("Build/Step/RemoveDir.zig");
pub const RunStep = @import("Build/Step/Run.zig");
pub const TranslateCStep = @import("Build/Step/TranslateC.zig");
pub const WriteFileStep = @import("Build/Step/WriteFile.zig");

install_tls: TopLevelStep,
uninstall_tls: TopLevelStep,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
//! TODO: make this more flexible, supporting more kinds of checks.
//! TODO: generalize the code in std.testing.expectEqualStrings and make this
//! CheckFileStep produce those helpful diagnostics when there is not a match.
const CheckFileStep = @This();
const std = @import("std");
const Step = std.Build.Step;
const fs = std.fs;
const mem = std.mem;

step: Step,
expected_matches: []const []const u8,
Expand Down Expand Up @@ -80,9 +85,3 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
}
}
}

const CheckFileStep = @This();
const std = @import("../std.zig");
const Step = std.Build.Step;
const fs = std.fs;
const mem = std.mem;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const assert = std.debug.assert;
const fs = std.fs;
const macho = std.macho;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const builtin = @import("builtin");
const std = @import("../std.zig");
const std = @import("std");
const mem = std.mem;
const fs = std.fs;
const assert = std.debug.assert;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const std = @import("std");
const ConfigHeaderStep = @This();
const Step = std.Build.Step;

pub const Style = union(enum) {
/// The configure format supported by autotools. It uses `#undef foo` to
/// mark lines that can be substituted with different values.
Expand Down Expand Up @@ -431,7 +435,3 @@ fn renderValueNasm(output: *std.ArrayList(u8), name: []const u8, value: Value) !
},
}
}

const std = @import("../std.zig");
const ConfigHeaderStep = @This();
const Step = std.Build.Step;
7 changes: 3 additions & 4 deletions lib/std/Build/FmtStep.zig → lib/std/Build/Step/Fmt.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! This step has two modes:
//! * Modify mode: directly modify source files, formatting them in place.
//! * Check mode: fail the step if a non-conforming file is found.
const std = @import("std");
const Step = std.Build.Step;
const FmtStep = @This();

step: Step,
paths: []const []const u8,
Expand Down Expand Up @@ -67,7 +70,3 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {

return step.evalChildProcess(argv.items);
}

const std = @import("../std.zig");
const Step = std.Build.Step;
const FmtStep = @This();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const Step = std.Build.Step;
const CompileStep = std.Build.CompileStep;
const InstallDir = std.Build.InstallDir;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const mem = std.mem;
const fs = std.fs;
const Step = std.Build.Step;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const Step = std.Build.Step;
const FileSource = std.Build.FileSource;
const InstallDir = std.Build.InstallDir;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const builtin = @import("builtin");
const fs = std.fs;
const Step = std.Build.Step;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const fs = std.fs;
const Step = std.Build.Step;
const RemoveDirStep = @This();
Expand Down
2 changes: 1 addition & 1 deletion lib/std/Build/RunStep.zig → lib/std/Build/Step/Run.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const builtin = @import("builtin");
const Step = std.Build.Step;
const CompileStep = std.Build.CompileStep;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const std = @import("../std.zig");
const std = @import("std");
const Step = std.Build.Step;
const CompileStep = std.Build.CompileStep;
const CheckFileStep = std.Build.CheckFileStep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
//! during the normal build process, but as a utility run by a developer with
//! intention to update source files, which will then be committed to version
//! control.
const std = @import("std");
const Step = std.Build.Step;
const fs = std.fs;
const ArrayList = std.ArrayList;
const WriteFileStep = @This();

step: Step,
/// The elements here are pointers because we need stable pointers for the
Expand Down Expand Up @@ -284,10 +289,3 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {

try step.writeManifest(&man);
}

const std = @import("../std.zig");
const Step = std.Build.Step;
const fs = std.fs;
const ArrayList = std.ArrayList;

const WriteFileStep = @This();

0 comments on commit 13eb725

Please sign in to comment.