diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-02-25 20:25:17 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-02-26 11:42:04 -0800 |
| commit | 67904e925d2b33c48dda3d4ddaf158328964dc2e (patch) | |
| tree | 35c505758915b7a2473dec2b7165a4fc4c2d5b38 /lib/init | |
| parent | ea516f0e81d055e0d7504eff36dfde694831bec1 (diff) | |
| download | zig-67904e925d2b33c48dda3d4ddaf158328964dc2e.tar.gz zig-67904e925d2b33c48dda3d4ddaf158328964dc2e.zip | |
zig init: adjust template lang to allow zig fmt passthrough
Diffstat (limited to 'lib/init')
| -rw-r--r-- | lib/init/build.zig | 6 | ||||
| -rw-r--r-- | lib/init/build.zig.zon | 6 | ||||
| -rw-r--r-- | lib/init/src/main.zig | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/init/build.zig b/lib/init/build.zig index ec25698c68..4db31713e4 100644 --- a/lib/init/build.zig +++ b/lib/init/build.zig @@ -42,14 +42,14 @@ pub fn build(b: *std.Build) void { // Modules can depend on one another using the `std.Build.Module.addImport` function. // This is what allows Zig source code to use `@import("foo")` where 'foo' is not a // file path. In this case, we set up `exe_mod` to import `lib_mod`. - exe_mod.addImport("$n_lib", lib_mod); + exe_mod.addImport(".NAME_lib", lib_mod); // Now, we will create a static library based on the module we created above. // This creates a `std.Build.Step.Compile`, which is the build step responsible // for actually invoking the compiler. const lib = b.addLibrary(.{ .linkage = .static, - .name = "$n", + .name = ".NAME", .root_module = lib_mod, }); @@ -61,7 +61,7 @@ pub fn build(b: *std.Build) void { // This creates another `std.Build.Step.Compile`, but this one builds an executable // rather than a static library. const exe = b.addExecutable(.{ - .name = "$n", + .name = ".NAME", .root_module = exe_mod, }); diff --git a/lib/init/build.zig.zon b/lib/init/build.zig.zon index 061254fd67..b154ddc16b 100644 --- a/lib/init/build.zig.zon +++ b/lib/init/build.zig.zon @@ -6,7 +6,7 @@ // // It is redundant to include "zig" in this name because it is already // within the Zig package namespace. - .name = .$n, + .name = .LITNAME, // This is a [Semantic Version](https://semver.org/). // In a future version of Zig it will be used for package deduplication. @@ -24,11 +24,11 @@ // original project's identity. Thus it is recommended to leave the comment // on the following line intact, so that it shows up in code reviews that // modify the field. - .nonce = $i, // Changing this has security and trust implications. + .nonce = .NONCE, // Changing this has security and trust implications. // Tracks the earliest Zig version that the package considers to be a // supported use case. - .minimum_zig_version = "$v", + .minimum_zig_version = ".ZIGVER", // This field is optional. // This is currently advisory only; Zig does not yet do anything diff --git a/lib/init/src/main.zig b/lib/init/src/main.zig index cc69127d4f..85d8c93551 100644 --- a/lib/init/src/main.zig +++ b/lib/init/src/main.zig @@ -43,4 +43,4 @@ test "fuzz example" { const std = @import("std"); /// This imports the separate module containing `root.zig`. Take a look in `build.zig` for details. -const lib = @import("$n_lib"); +const lib = @import(".NAME_lib"); |
