internal/rosa: improve helper bindings

This uses more intuitive names for some arguments and inverts their default value. Slices and nil-capable strings replace skip arguments.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-08-10 21:55:47 +09:00
parent 7d86e19c07
commit 7193656b6a
47 changed files with 153 additions and 163 deletions
+31 -12
View File
@@ -811,14 +811,17 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var attr GenericHelper
chdir := true
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("inPlace"): &attr.InPlace,
k("chdir"): &chdir,
k("build"): &attr.Build,
k("check"): &attr.Check,
k("install"): &attr.Install,
}); err != nil {
return
}
attr.InPlace = !chdir
v = &attr
set = true
return
@@ -828,28 +831,33 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var attr MakeHelper
defaults, chdir, checkEarly := true, true, true
attr.Configure, attr.Check = []KV{}, []string{}
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("omitDefaults"): &attr.OmitDefaults,
k("defaults"): &defaults,
k("generate"): &attr.Generate,
k("preMake"): &attr.ScriptMakeEarly,
k("preCheck"): &attr.ScriptCheckEarly,
k("postInstall"): &attr.Script,
k("inPlace"): &attr.InPlace,
k("skipConfigure"): &attr.SkipConfigure,
k("chdir"): &chdir,
k("configureName"): &attr.ConfigureName,
k("forceAutoconf"): &attr.ForceAutoconf,
k("configure"): &attr.Configure,
k("host"): &attr.Host,
k("build"): &attr.Build,
k("make"): &attr.Make,
k("skipCheck"): &attr.SkipCheck,
k("check"): &attr.Check,
k("install"): &attr.Install,
k("skipEarlyStageCheck"): &attr.SkipCheckEarly,
k("checkEarly"): &checkEarly,
}); err != nil {
return
}
attr.OmitDefaults, attr.InPlace = !defaults, !chdir
attr.SkipConfigure = attr.Configure == nil
attr.SkipCheck = attr.Check == nil
attr.SkipCheckEarly = !checkEarly
v = &attr
set = true
return
@@ -859,17 +867,20 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var attr CMakeHelper
var test azalea.AString
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("append"): &attr.Append,
k("buildType"): &attr.BuildType,
k("cache"): &attr.Cache,
k("postInstall"): &attr.Script,
k("test"): &attr.Test,
k("skipTest"): &attr.SkipTest,
k("test"): &test,
k("make"): &attr.Make,
}); err != nil {
return
}
attr.Test = test.V
attr.SkipTest = test.Nil
v = &attr
set = true
return
@@ -879,18 +890,21 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var attr MesonHelper
test := true
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("muon"): &attr.Muon,
k("preCompile"): &attr.ScriptCompileEarly,
k("postCompile"): &attr.ScriptCompiled,
k("postInstall"): &attr.Script,
k("setup"): &attr.Setup,
k("skipTest"): &attr.SkipTest,
k("test"): &test,
k("skipTests"): &attr.SkipTests,
k("interactiveTest"): &attr.InteractiveTest,
}); err != nil {
return
}
attr.SkipTest = !test
v = &attr
set = true
return
@@ -900,11 +914,13 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var attr MakeMakerHelper
doCheck := true
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("skipCheck"): &attr.SkipCheck,
k("check"): &doCheck,
}); err != nil {
return
}
attr.SkipCheck = !doCheck
v = &attr
set = true
return
@@ -914,17 +930,20 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var attr PipHelper
var scriptCheck azalea.AString
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("append"): &attr.Append,
k("buildIsolation"): &attr.BuildIsolation,
k("enterSource"): &attr.EnterSource,
k("install"): &attr.Install,
k("skipCheck"): &attr.SkipCheck,
k("check"): &attr.Check,
k("check"): &scriptCheck,
k("postInstall"): &attr.Script,
}); err != nil {
return
}
attr.Check = scriptCheck.V
attr.SkipCheck = scriptCheck.Nil
v = &attr
set = true
return