added ability to specify license in a package file
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 28 Nov 2023 18:37:19 +0000 (12:37 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 28 Nov 2023 18:37:19 +0000 (12:37 -0600)
CHANGELOG
scripts/onyx-pkg.onyx

index b02334eb546f33e482dd6ba1d59f3ca6a07668e1..d0b70f2397ff2e8f590c701323459cb4aca24ab9 100644 (file)
--- 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,
index c974b1a01121f6ec96a57d13a73ad01dbad281b9..b497bef57e97268acc69b4ce51ada4ea84fd670c 100644 (file)
@@ -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
         ]);