From d99c47989a1047cd24019fd5ce434e701b5d3519 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 7 Feb 2021 04:56:58 -0400 Subject: Mo' updates, less problems. --- stdlib/source/program/aedifex/command/build.lux | 2 +- stdlib/source/program/aedifex/command/deploy.lux | 17 ++++----- stdlib/source/program/aedifex/command/deps.lux | 42 +++++++++++++++++------ stdlib/source/program/aedifex/command/install.lux | 20 ++++++----- 4 files changed, 52 insertions(+), 29 deletions(-) (limited to 'stdlib/source/program/aedifex/command') diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 7241b1de4..388a48c89 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -107,7 +107,7 @@ (All [!] (-> (file.System !) Path Artifact Path)) (let [/ (\ fs separator)] (|> artifact - ///local.uri + (///local.uri (get@ #///artifact.version artifact)) (text.replace_all uri.separator /) (format home /)))) diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux index fe96055ef..758f87ab9 100644 --- a/stdlib/source/program/aedifex/command/deploy.lux +++ b/stdlib/source/program/aedifex/command/deploy.lux @@ -63,12 +63,13 @@ _ (///dependency/deployment.one repository [artifact ///artifact/type.lux_library] - {#///package.origin (#///repository/origin.Remote "") - #///package.library [library - (///dependency/status.verified library)] - #///package.pom [pom - (|> pom - (\ xml.codec encode) - (\ encoding.utf8 encode) - ///dependency/status.verified)]})] + (let [pom_data (|> pom + (\ xml.codec encode) + (\ encoding.utf8 encode))] + {#///package.origin (#///repository/origin.Remote "") + #///package.library [library + (///dependency/status.verified library)] + #///package.pom [pom + pom_data + (///dependency/status.verified pom_data)]}))] (console.write_line //clean.success console))) diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux index 71dffeec1..14b5d803f 100644 --- a/stdlib/source/program/aedifex/command/deps.lux +++ b/stdlib/source/program/aedifex/command/deps.lux @@ -3,13 +3,16 @@ [abstract [monad (#+ do)]] [control + ["." exception] [concurrency ["." promise (#+ Promise)]]] [data [collection ["." set (#+ Set)] ["." list ("#\." fold)] - ["." dictionary]]] + ["." dictionary]] + [text + ["%" format (#+ format)]]] [world [program (#+ Program)] ["." file] @@ -18,22 +21,39 @@ ["#." clean] ["/#" // #_ [command (#+ Command)] - [artifact (#+ Artifact)] [repository (#+ Repository)] ["#" profile] ["#." action (#+ Action)] - ["#." dependency #_ + ["#." artifact (#+ Artifact)] + ["#." dependency (#+ Dependency) ["#/." resolution (#+ Resolution)] ["#/." deployment]]]]) +(def: %dependency + (%.Format Dependency) + (|>> (get@ #///dependency.artifact) + ///artifact.format + %.text)) + (def: #export (do! console local remotes profile) (-> (Console Promise) (Repository Promise) (List (Repository Promise)) (Command Resolution)) - (do ///action.monad + (do promise.monad [#let [dependencies (set.to_list (get@ #///.dependencies profile))] - cache (///dependency/resolution.all (list local) dependencies ///dependency/resolution.empty) - resolution (///dependency/resolution.all remotes dependencies cache) - cached (|> (dictionary.keys cache) - (list\fold dictionary.remove resolution) - (///dependency/deployment.all local)) - _ (console.write_line //clean.success console)] - (wrap resolution))) + [local_successes local_failures cache] (///dependency/resolution.all (list local) dependencies ///dependency/resolution.empty) + [remote_successes remote_failures resolution] (///dependency/resolution.all remotes dependencies cache)] + (do ///action.monad + [cached (|> (dictionary.keys cache) + (list\fold dictionary.remove resolution) + (///dependency/deployment.all local)) + _ (console.write_line //clean.success console) + _ (console.write_line (exception.report + ["Local successes" (exception.enumerate %dependency local_successes)] + ["Local failures" (exception.enumerate %dependency local_failures)] + ["Remote successes" (let [remote_successes (|> remote_successes + (set.from_list ///dependency.hash) + (set.difference (set.from_list ///dependency.hash local_successes)) + set.to_list)] + (exception.enumerate %dependency remote_successes))] + ["Remote failures" (exception.enumerate %dependency remote_failures)]) + console)] + (wrap resolution)))) diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux index b051a4900..35ffcf72f 100644 --- a/stdlib/source/program/aedifex/command/install.lux +++ b/stdlib/source/program/aedifex/command/install.lux @@ -54,15 +54,17 @@ (do ///action.monad [package (export.library system (set.to_list (get@ #/.sources profile))) pom (\ promise.monad wrap (///pom.write profile)) - _ (///dependency/deployment.one repository [identity ///artifact/type.lux_library] - {#///package.origin (#///origin.Local "") - #///package.library (let [library (binary.run tar.writer package)] - [library (///dependency/status.verified library)]) - #///package.pom [pom - (|> pom - (\ xml.codec encode) - (\ encoding.utf8 encode) - ///dependency/status.verified)]})] + _ (///dependency/deployment.one repository + [identity ///artifact/type.lux_library] + (let [pom_data (|> pom + (\ xml.codec encode) + (\ encoding.utf8 encode))] + {#///package.origin (#///origin.Local "") + #///package.library (let [library (binary.run tar.writer package)] + [library (///dependency/status.verified library)]) + #///package.pom [pom + pom_data + (///dependency/status.verified pom_data)]}))] (console.write_line //clean.success console)) _ -- cgit v1.2.3