From: Brendan Hansen Date: Tue, 28 Nov 2023 18:37:19 +0000 (-0600) Subject: added ability to specify license in a package file X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=74d6ab6957dd8a6eb57c512b1fd5418f91ae7d81;p=onyx.git added ability to specify license in a package file --- diff --git a/CHANGELOG b/CHANGELOG index b02334eb..d0b70f23 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,8 @@ Additions: Removals: Changes: +- Simplified using union variants of type `void`. + - Now instead of `.{ Foo = .{} }`, use `.Foo` instead. - Renamed `--no-std` flag to `--no-core`, since Onyx does not call its standard library "std", the name did not make any sense. - `net.make_ipv4_address` now has a reasonable definition using a string for the IP, diff --git a/scripts/onyx-pkg.onyx b/scripts/onyx-pkg.onyx index c974b1a0..b497bef5 100644 --- a/scripts/onyx-pkg.onyx +++ b/scripts/onyx-pkg.onyx @@ -31,7 +31,7 @@ Template_Directory :: () -> str { |> string.alloc_copy(); } -Version :: SemVer.{0, 1, 1} +Version :: SemVer.{0, 1, 8} @@ -1095,6 +1095,7 @@ Config :: struct { package_url: str; package_author: str; package_version: SemVer; + package_license: str; dependency_source_path: str; dependency_binary_path: str; @@ -1162,6 +1163,7 @@ load_config :: (path: str) -> ? Config { load_string(pack, "author", &c.package_author); load_string(pack, "description", &c.package_description); load_string(pack, "url", &c.package_url); + load_string(pack, "license", &c.package_license); version: str; load_string(pack, "version", &version); @@ -1256,6 +1258,9 @@ store_config :: (path: str) -> bool { version_node := doc->create_node("version"); version_node->add_value(.{ String = tprintf("{}", config.package_version) }); + license_node := doc->create_node("license"); + license_node->add_value(.{ String = config.package_license }); + array.concat(&package_node.children, .[ name_node, author_node, url_node, description_node, version_node ]);