(.module: [lux #* [abstract [monad (#+ do)]] [control [concurrency ["." promise (#+ Promise) ("#\." monad)]]] [data [binary (#+ Binary)] [text ["." encoding]] [collection ["." set]] [format ["." binary] ["." tar] ["." xml]]] [world ["." file] ["." console (#+ Console)]]] [program [compositor ["." export]]] ["." // #_ ["#." clean] ["/#" // #_ [repository (#+ Identity Repository)] [command (#+ Command)] ["/" profile] ["#." action (#+ Action)] ["#." pom] ["#." hash] ["#." artifact (#+ Artifact) ["#/." extension (#+ Extension)]]]]) (def: #export (do! console repository fs identity artifact profile) (-> (Console Promise) (Repository Promise) (file.System Promise) Identity Artifact (Command Any)) (let [deploy! (: (-> Extension Binary (Action Any)) (\ repository upload identity artifact))] (do {! ///action.monad} [library (|> profile (get@ #/.sources) set.to-list (export.library fs) (\ ! map (binary.run tar.writer))) pom (promise\wrap (///pom.write profile)) _ (deploy! ///artifact/extension.pom (|> pom (\ xml.codec encode) encoding.to-utf8)) _ (deploy! ///artifact/extension.lux-library library) _ (deploy! ///artifact/extension.sha-1 (///hash.data (///hash.sha-1 library))) _ (deploy! ///artifact/extension.md5 (///hash.data (///hash.md5 library)))] (console.write-line //clean.success console))))