Skip to content

Commit

Permalink
to v0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
FObersteiner committed Aug 6, 2024
1 parent b8fc504 commit 5354997
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 172 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ See [changelog](https://codeberg.org/FObersteiner/zdt/src/branch/main/docs/chang

## Zig version

This library is developed with Zig `0.14.0-dev`, might not compile with older versions. As of 2024-06-15, Zig-0.12 and Zig-0.13 (both stable) should work.
This library is developed with Zig `0.14.0-dev`, might not compile with older versions. As of 2024-08-04, Zig-0.12 and Zig-0.13 (both stable) should work.

## Dependencies

Expand All @@ -67,6 +67,10 @@ This library is developed with Zig `0.14.0-dev`, might not compile with older ve

For development, to update the time zone database and the version info, run the following build steps: `zig build update-tz-database && zig build update-tz-version`.

## Cross-Compilation

Does not work at the moment, see [#50](https://codeberg.org/FObersteiner/zdt/issues/50). The main reason is that the timezone database is stored locally instead of being embedded in a build.

## License

MPL. See the LICENSE file in the root directory of the repository.
20 changes: 4 additions & 16 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! ---
//! `tests` - run unit tests
//! `examples` - build examples
//! `clean` - remove zig-cache on non-Windows OS
//! `docs` - run autodoc generation
//! `update-tz-version` - retreive version of tzdata from local copy and set in zig file
//! `update-tz-prefix` - update tzdata path
Expand All @@ -12,7 +11,7 @@ const std = @import("std");
const builtin = @import("builtin");
const log = std.log.scoped(.zdt_build);

const zdt_version = std.SemanticVersion{ .major = 0, .minor = 1, .patch = 5 };
const zdt_version = std.SemanticVersion{ .major = 0, .minor = 1, .patch = 6 };

const example_files = [_][]const u8{
"ex_demo",
Expand Down Expand Up @@ -144,7 +143,8 @@ pub fn build(b: *std.Build) !void {
run_gen_version.addPathDir("lib");
const out_file_v = run_gen_version.addOutputFileArg("tzdb_version.zig");
const write_files_v = b.addWriteFiles();
write_files_v.addCopyFileToSource(out_file_v, "./lib/tzdb_version.zig");
_ = write_files_v.addCopyFile(out_file_v, "./lib/tzdb_version.zig");
// write_files_v.addCopyFileToSource(out_file_v, "./lib/tzdb_version.zig");
update_tz_version_step.dependOn(&write_files_v.step);
}
// --------------------------------------------------------------------------------
Expand Down Expand Up @@ -191,7 +191,7 @@ pub fn build(b: *std.Build) !void {
// build & run via 'zig build examples && ./zig-out/bin/[example-name]'
const example_step = b.step("examples", "Build examples");
{
for (example_files) |example_name| {
inline for (example_files) |example_name| {
const example = b.addExecutable(.{
.name = example_name,
.root_source_file = b.path(b.fmt("examples/{s}.zig", .{example_name})),
Expand All @@ -207,18 +207,6 @@ pub fn build(b: *std.Build) !void {
}
// --------------------------------------------------------------------------------

// --------------------------------------------------------------------------------
// clean step: remove ./zig-out and ./zig-cache
const clean_step = b.step("clean", "Clean up");
{
clean_step.dependOn(&b.addRemoveDirTree(b.install_path).step);
if (builtin.os.tag != .windows) {
clean_step.dependOn(&b.addRemoveDirTree(b.pathFromRoot(".zig-cache")).step);
clean_step.dependOn(&b.addRemoveDirTree(b.pathFromRoot("zig-cache")).step);
}
}
// --------------------------------------------------------------------------------

// --------------------------------------------------------------------------------
// generate docs
// run on a local server e.g. via
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = "zdt",
.version = "0.1.4",
.version = "0.1.6",
.paths = .{
"zdt.zig",
"lib", // anything from lib
Expand Down
5 changes: 5 additions & 0 deletions docs/change.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 2024-08-06, v0.1.6

- renamings; replace 'self' with more meaningful designation
- remove 'clean' step from build.zig

## 2024-07-07, v0.1.5

- add option to truncate fractional second via 's.:[precision]' formatting directive
Expand Down
Loading

0 comments on commit 5354997

Please sign in to comment.