upgrade example to 0.15.1
All checks were successful
AWS-Zig Build / build-zig-amd64-host (push) Successful in 7m51s

This commit is contained in:
Emil Lerch 2025-08-25 10:39:29 -07:00
parent e29829f2a0
commit ffdd31d7b0
Signed by: lobo
GPG key ID: A7B62D657EF764F8
3 changed files with 18 additions and 13 deletions

View file

@ -15,15 +15,17 @@ pub fn build(b: *std.Build) void {
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "tmp",
// In this case the main source file is merely a path, however, in more
// complicated build scripts, this could be a generated file.
const mod_exe = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "tmp",
.root_module = mod_exe,
});
const aws_dep = b.dependency("aws", .{
// These are the two arguments to the dependency. It expects a target and optimization level.
.target = target,
@ -59,13 +61,16 @@ pub fn build(b: *std.Build) void {
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
// Creates a step for unit testing. This only builds the test executable
// but does not run it.
const unit_tests = b.addTest(.{
const mod_unit_tests = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
// Creates a step for unit testing. This only builds the test executable
// but does not run it.
const unit_tests = b.addTest(.{
.root_module = mod_unit_tests,
});
const run_unit_tests = b.addRunArtifact(unit_tests);

View file

@ -6,8 +6,8 @@
.dependencies = .{
.aws = .{
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/7a6086447c1249b0e5b5b5f3873d2f7932bea56d/7a6086447c1249b0e5b5b5f3873d2f7932bea56d-with-models.tar.gz",
.hash = "aws-0.0.1-SbsFcGN_CQCBjurpc2GEMw4c_qAkGu6KpuVnLBLY4L4q",
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/e29829f2a0144a974a00d7b2372e3a03a015d98d/e29829f2a0144a974a00d7b2372e3a03a015d98d-with-models.tar.gz",
.hash = "aws-0.0.1-SbsFcNntCQDBi1FVdiZaWpqR7kF3XGlRQXB4S6gpWALQ",
},
},
}

View file

@ -15,10 +15,10 @@ pub fn main() anyerror!void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
const stdout_raw = std.io.getStdOut().writer();
var bw = std.io.bufferedWriter(stdout_raw);
defer bw.flush() catch unreachable;
const stdout = bw.writer();
var stdout_buffer: [1024]u8 = undefined;
var stdout_raw = std.fs.File.stdout().writer(&stdout_buffer);
const stdout = &stdout_raw.interface;
defer stdout.flush() catch unreachable;
// To use a proxy, uncomment the following with your own configuration
// const proxy = std.http.Proxy{