def plugin_step
near-v-framework@0.4.0.0 · domain/architecture/system/plan/ops.bend:58
import near-v-framework@0.4.0.0/domain/architecture/system/plan/ops.bend as Ops
import Base
import near-v-framework@0.4.0.0/domain/architecture/system/release/type.bend as Rl
import near-v-framework@0.4.0.0/domain/architecture/system/plan/type.bend as P
58
59def plugin_step(g: Rl.Plugin, t: P.Tag) -> P.Step:
60 match g t:
61 case Rl.Plugin{+n, +v, _, _, Rl.Repository{+r, _}} P.Tag{repo, tagged, +built, differs}:
62 +what = "plugin " ++ n ++ "@" ++ v
63 Bool.pick(P.Step, String.is_empty(built), P.Blocked{what, "does not build"},
64 Bool.pick(P.Step, Bool.not(String.eq(built, v)), P.Blocked{what, "builds as version " ++ built},
65 Bool.pick(P.Step, Bool.not(repo), P.ReleasePlugin{n, v, r, True{}},
66 Bool.pick(P.Step, Bool.not(tagged), P.ReleasePlugin{n, v, r, False{}},
67 Bool.pick(P.Step, differs, P.Blocked{what, "changed since " ++ n ++ "-v" ++ v ++ " was released; give it a new version"},
68 P.Current{what})))))