(.module: [lux #* [abstract [monad (#+ do)]] [control ["." try (#+ Try)] ["." exception] [concurrency ["." promise (#+ Promise)]]] [data [binary (#+ Binary)] [text ["%" format (#+ format)] [encoding ["." utf8]]] [collection ["." set]] [format ["." binary] ["." tar] ["." xml]]] [world [program (#+ Program)] ["." file (#+ Path File)] ["." console (#+ Console)]]] [program [compositor ["." export]]] ["." // #_ ["#." clean] ["/#" // #_ ["/" profile (#+ Profile)] ["#." action (#+ Action)] ["#." command (#+ Command)] ["#." local] ["#." pom] ["#." package] [repository (#+ Repository) ["#." origin]] ["#." dependency #_ ["#/." deployment] ["#/." status]] ["#." artifact (#+ Artifact) ["#/." type]]]]) (def: #export success "Successfully installed the project locally.") (def: #export failure "Failure: No 'identity' defined for the project.") (def: #export (do! console system repository profile) (-> (Console Promise) (file.System Promise) (Repository Promise) (Command Any)) (case (get@ #/.identity profile) (#.Some identity) (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] (let [pom_data (|> pom (\ xml.codec encode) (\ utf8.codec 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 ..success console)) _ (console.write_line ..failure console)))