From 2d16bdfa2854d851034eff9f042863dcceb8664a Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 3 Oct 2020 20:13:27 -0400 Subject: Gave Aedifex support for multiple profiles. --- stdlib/source/program/aedifex/profile.lux | 135 ++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 stdlib/source/program/aedifex/profile.lux (limited to 'stdlib/source/program/aedifex/profile.lux') diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux new file mode 100644 index 000000000..5e5cb6175 --- /dev/null +++ b/stdlib/source/program/aedifex/profile.lux @@ -0,0 +1,135 @@ +(.module: + [lux (#- Info Source Module Name) + [abstract + [monoid (#+ Monoid)]] + [control + ["." exception (#+ exception:)]] + [data + ["." maybe ("#@." monoid)] + ["." text] + [collection + ["." dictionary (#+ Dictionary)] + ["." list ("#@." monoid)] + ["." set (#+ Set)]]] + [world + [net (#+ URL)] + [file (#+ Path)]] + [tool + [compiler + [meta + [archive + [descriptor (#+ Module)]]]]]] + [// + [artifact (#+ Artifact)] + ["." dependency]]) + +(def: #export file + "project.lux") + +(type: #export Distribution + #Repo + #Manual) + +(type: #export License + [Text + URL + Distribution]) + +(type: #export SCM + URL) + +(type: #export Organization + [Text + URL]) + +(type: #export Email + Text) + +(type: #export Developer + [Text + Email + (Maybe Organization)]) + +(type: #export Contributor + Developer) + +(type: #export Info + {#url (Maybe URL) + #scm (Maybe SCM) + #description (Maybe Text) + #licenses (List License) + #organization (Maybe Organization) + #developers (List Developer) + #contributors (List Contributor)}) + +(def: #export default-info + Info + {#url #.None + #scm #.None + #description #.None + #licenses (list) + #organization #.None + #developers (list) + #contributors (list)}) + +(type: #export Source + Path) + +(def: #export default-source + Source + "source") + +(type: #export Target + Path) + +(def: #export default-target + Target + "target") + +(type: #export Name + Text) + +(def: #export default + Name + "") + +(type: #export Profile + {#parents (List Name) + #identity (Maybe Artifact) + #info (Maybe Info) + #repositories (Set dependency.Repository) + #dependencies (Set dependency.Dependency) + #sources (Set Source) + #target (Maybe Target) + #program (Maybe Module) + #test (Maybe Module) + #deploy-repositories (Dictionary Text dependency.Repository)}) + +(exception: #export no-identity) + +(structure: #export monoid + (Monoid Profile) + + (def: identity + {#parents (list) + #identity #.None + #info #.None + #repositories (set.new text.hash) + #dependencies (set.new dependency.hash) + #sources (set.new text.hash) + #target #.None + #program #.None + #test #.None + #deploy-repositories (dictionary.new text.hash)}) + + (def: (compose override baseline) + {#parents (list@compose (get@ #parents baseline) (get@ #parents override)) + #identity (maybe@compose (get@ #identity override) (get@ #identity baseline)) + #info (maybe@compose (get@ #info override) (get@ #info baseline)) + #repositories (set.union (get@ #repositories baseline) (get@ #repositories override)) + #dependencies (set.union (get@ #dependencies baseline) (get@ #dependencies override)) + #sources (set.union (get@ #sources baseline) (get@ #sources override)) + #target (maybe@compose (get@ #target override) (get@ #target baseline)) + #program (maybe@compose (get@ #program override) (get@ #program baseline)) + #test (maybe@compose (get@ #test override) (get@ #test baseline)) + #deploy-repositories (dictionary.merge (get@ #deploy-repositories override) (get@ #deploy-repositories baseline))})) -- cgit v1.2.3