tools for building gleam projects with nix

gleam-tool: support application_start_argument in gleam.toml for app spec generation

foxgirl.engineering 9aae0989 ec4f21e3

verified
+15 -2
+4
CHANGELOG.md
··· 10 10 11 11 ## unreleased 12 12 13 + ### added 14 + 15 + - support for the new `erlang.application_start_argument` option in `gleam.toml`, introduced in gleam `1.13.0-rc1` 16 + 13 17 ### changed 14 18 15 19 - added default meta attributes to `buildGleamApplication` derivations
+10 -2
gleam_tool/src/app.rs
··· 54 54 55 55 let applications = get_applications(otp_dependencies, &gleam_toml).join(","); 56 56 let modules = get_modules(out_dir)?.join(","); 57 + 57 58 let start_module = gleam_toml 58 59 .erlang 59 - .and_then(|e| e.application_start_module) 60 - .map(|module| format!("{{mod, {{'{module}', []}}}},\n")) 60 + .and_then(|e| { 61 + e.application_start_module.map(|module| { 62 + ( 63 + module, 64 + e.application_start_argument.unwrap_or("[]".to_string()), 65 + ) 66 + }) 67 + }) 68 + .map(|(module, args)| format!("{{mod, {{'{module}', {args}}}}},\n")) 61 69 .unwrap_or_default(); 62 70 63 71 Ok(AppSpec {
+1
gleam_tool/src/gleam_toml.rs
··· 10 10 #[derive(Facet)] 11 11 pub struct ErlangOptions { 12 12 pub application_start_module: Option<String>, 13 + pub application_start_argument: Option<String>, 13 14 pub extra_applications: Option<Vec<String>>, 14 15 } 15 16