dependencies_installed[to_install.repo] = to_install.version;
}
+ build_package_file_to_load();
+
if options.clean {
for os.list_directory(config.config.lib_source_directory) {
if it.type != .Directory do continue;
return os.process_wait(^run_proc);
}
+build_package_file_to_load :: () {
+ filepath := tprintf("{}/{}", config.config.lib_source_directory, "packages.onyx");
+
+ if os.file_exists(filepath) {
+ os.remove_file(filepath);
+ }
+
+ for os.with_file(filepath, .Write) {
+ w := io.writer_make(it);
+ defer io.writer_free(^w);
+
+ io.write(^w, """
+//
+// THIS FILE WAS AUTOMATICALLY GENERATED BY onyx-pkg.
+// DO NOT MODIFY UNLESS YOU KNOW WHAT YOU ARE DOING.
+//
+
+// PACKAGE LOADING
+""");
+
+ for config.dependencies.dependencies->as_iter() {
+ dependency_repo := it.key;
+ dependency_folder := config.dependency_folders.folders[dependency_repo];
+
+ io.write_format(^w,
+ "#load \"./{}/module.onyx\"\n",
+ dependency_folder);
+ }
+
+ io.write(^w, "\n\n// NATIVE LIBRARY PATH\n");
+
+ io.write_format(^w, "#library_path \"{}\"\n", config.config.lib_bin_directory);
+ }
+}
+
+
#tag conv.Custom_Parse.{parse}
#tag conv.Custom_Format.{format}