diff options
author | Eduardo Julian | 2020-12-04 01:13:01 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-04 01:13:01 -0400 |
commit | 8df63aae42c40ac0413ccfacc3b2e8eb72e00a15 (patch) | |
tree | 5e1eb6833398b8a67a2e3d0db4a615204a25f80f /stdlib/source/program | |
parent | 0205e5146b50ab066d152fccda0fc8cef4eef852 (diff) |
Re-named old luxc-jvm to lux-bootstrapper.
Diffstat (limited to 'stdlib/source/program')
-rw-r--r-- | stdlib/source/program/aedifex.lux | 132 | ||||
-rw-r--r-- | stdlib/source/program/compositor/import.lux | 6 |
2 files changed, 74 insertions, 64 deletions
diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index 06b75afd5..d804fd552 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -5,7 +5,7 @@ [control [pipe (#+ do>)] ["." io (#+ IO)] - ["." try (#+ Try)] + ["." try (#+ Try) ("#\." functor)] ["." exception (#+ exception:)] [parser ["." cli (#+ program:)] @@ -86,70 +86,80 @@ (program: [{[profile operation] /cli.command}] (do {! io.monad} - [?profile (/input.read io.monad file.default profile) - ?console console.default] - (case [?profile ?console] - [(#try.Success profile) (#try.Success console)] - (let [console (console.async console)] - (case operation - #/cli.Version - (exec (/command/version.do! console profile) - (wrap [])) - - #/cli.Clean - (exec (/command/clean.do! console (file.async file.default) profile) - (wrap [])) + [?console console.default] + (case (try\map console.async ?console) + (#try.Failure error) + (wrap (log! error)) - #/cli.POM - (exec (/command/pom.do! console (file.async file.default) profile) - (wrap [])) - - #/cli.Install - (exec (/command/install.do! console (file.async file.default) profile) - (wrap [])) + (#try.Success console) + (case operation + #/cli.Version + (exec (/command/version.do! console (\ /.monoid identity)) + (wrap [])) - (#/cli.Deploy repository identity) - (exec (case [(get@ #/.identity profile) - (dictionary.get repository (get@ #/.deploy-repositories profile))] - [(#.Some artifact) (#.Some repository)] - (/command/deploy.do! console - (/repository.async (/repository.remote repository)) - (file.async file.default) - identity - artifact - profile) + _ + (do ! + [?profile (/input.read io.monad file.default profile)] + (case ?profile + (#try.Failure error) + (wrap (log! error)) - [#.None _] - (promise\wrap (exception.throw /.no-identity [])) + (#try.Success profile) + (case operation + #/cli.Version + (wrap []) + + #/cli.Clean + (exec (/command/clean.do! console (file.async file.default) profile) + (wrap [])) + + #/cli.POM + (exec (/command/pom.do! console (file.async file.default) profile) + (wrap [])) + + #/cli.Install + (exec (/command/install.do! console (file.async file.default) profile) + (wrap [])) - [_ #.None] - (promise\wrap (exception.throw ..cannot-find-repository [repository (get@ #/.deploy-repositories profile)]))) - (wrap [])) - - #/cli.Dependencies - (exec (/command/deps.do! console (file.async file.default) (..repositories profile) profile) - (wrap [])) + (#/cli.Deploy repository identity) + (exec (case [(get@ #/.identity profile) + (dictionary.get repository (get@ #/.deploy-repositories profile))] + [(#.Some artifact) (#.Some repository)] + (/command/deploy.do! console + (/repository.async (/repository.remote repository)) + (file.async file.default) + identity + artifact + profile) - (#/cli.Compilation compilation) - (case compilation - #/cli.Build (exec (..with-dependencies console /command/build.do! profile) - (wrap [])) - #/cli.Test (exec (..with-dependencies console /command/test.do! profile) - (wrap []))) + [#.None _] + (promise\wrap (exception.throw /.no-identity [])) - (#/cli.Auto auto) - (do ! - [?watcher watch.default] - (case ?watcher - (#try.Failure error) - (wrap (log! error)) + [_ #.None] + (promise\wrap (exception.throw ..cannot-find-repository [repository (get@ #/.deploy-repositories profile)]))) + (wrap [])) - (#try.Success watcher) - (exec (case auto - #/cli.Build (..with-dependencies console (/command/auto.do! watcher /command/build.do!) profile) - #/cli.Test (..with-dependencies console (/command/auto.do! watcher /command/test.do!) profile)) - (wrap [])))))) - - (^or [(#try.Failure error) _] - [_ (#try.Failure error)]) - (wrap (log! error))))) + #/cli.Dependencies + (exec (/command/deps.do! console (file.async file.default) (..repositories profile) profile) + (wrap [])) + + (#/cli.Compilation compilation) + (case compilation + #/cli.Build (exec (..with-dependencies console /command/build.do! profile) + (wrap [])) + #/cli.Test (exec (..with-dependencies console /command/test.do! profile) + (wrap []))) + + (#/cli.Auto auto) + (do ! + [?watcher watch.default] + (case ?watcher + (#try.Failure error) + (wrap (log! error)) + + (#try.Success watcher) + (exec (case auto + #/cli.Build (..with-dependencies console (/command/auto.do! watcher /command/build.do!) profile) + #/cli.Test (..with-dependencies console (/command/auto.do! watcher /command/test.do!) profile)) + (wrap []))))) + )))))) diff --git a/stdlib/source/program/compositor/import.lux b/stdlib/source/program/compositor/import.lux index edc0160f5..54227c7f3 100644 --- a/stdlib/source/program/compositor/import.lux +++ b/stdlib/source/program/compositor/import.lux @@ -46,9 +46,9 @@ (def: (import-library system library import) (-> (file.System Promise) Library Import (Action Import)) (do (try.with promise.monad) - [library (: (Action (File Promise)) - (!.use (\ system file) [library])) - binary (!.use (\ library content) [])] + [file (: (Action (File Promise)) + (!.use (\ system file) [library])) + binary (!.use (\ file content) [])] (promise\wrap (do {! try.monad} [tar (<b>.run tar.parser binary)] |