diff options
author | Eduardo Julian | 2020-10-03 20:13:27 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-10-03 20:13:27 -0400 |
commit | 2d16bdfa2854d851034eff9f042863dcceb8664a (patch) | |
tree | a1c593916c6ec9d6e9c132e641fc8b34b85a07f8 /stdlib/source/program/aedifex/local.lux | |
parent | 618b1ce9743bb79f1ae3375b05a394a4183b21e8 (diff) |
Gave Aedifex support for multiple profiles.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/local.lux | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/stdlib/source/program/aedifex/local.lux b/stdlib/source/program/aedifex/local.lux index 0a429fdc2..1b8a02f1a 100644 --- a/stdlib/source/program/aedifex/local.lux +++ b/stdlib/source/program/aedifex/local.lux @@ -5,6 +5,7 @@ [control ["." io (#+ IO)] ["." try (#+ Try)] + ["." exception] [concurrency ["." promise (#+ Promise)]] [security @@ -16,7 +17,8 @@ ["." encoding]] [collection ["." list ("#@." monoid)] - ["." dictionary]] + ["." dictionary] + ["." set]] [format ["." binary] ["." tar] @@ -27,7 +29,7 @@ [compositor ["." export]]] ["." // #_ - ["/" project (#+ Project)] + ["/" profile (#+ Profile)] ["#." extension] ["#." pom] ["#." artifact (#+ Artifact)] @@ -67,17 +69,22 @@ (file.get-file promise.monad system file))] (!.use (:: file over-write) [content]))) -(def: #export (install system project) - (-> (file.System Promise) Project (Promise (Try Any))) - (do (try.with promise.monad) - [repository (..guarantee-repository! system (get@ #/.identity project)) - #let [identity (get@ #/.identity project) - artifact-name (format repository (:: system separator) (//artifact.identity identity))] - package (export.library system (get@ #/.sources project)) - _ (..save! system (binary.run tar.writer package) - (format artifact-name "." //dependency.lux-library))] - (..save! system (|> project //pom.project (:: xml.codec encode) encoding.to-utf8) - (format artifact-name //extension.pom)))) +(def: #export (install system profile) + (-> (file.System Promise) Profile (Promise (Try Any))) + (case (get@ #/.identity profile) + (#.Some identity) + (do (try.with promise.monad) + [repository (..guarantee-repository! system identity) + #let [artifact-name (format repository (:: system separator) (//artifact.identity identity))] + package (export.library system (set.to-list (get@ #/.sources profile))) + _ (..save! system (binary.run tar.writer package) + (format artifact-name "." //dependency.lux-library)) + pom (:: promise.monad wrap (//pom.project profile))] + (..save! system (|> pom (:: xml.codec encode) encoding.to-utf8) + (format artifact-name //extension.pom))) + + _ + (:: promise.monad wrap (exception.throw /.no-identity [])))) (def: #export (cache system [artifact type] package) (-> (file.System Promise) Dependency Package (Promise (Try Any))) |