From 580bafb8578c5dc5407c5b9be2cc07a4d2057739 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 22 Apr 2014 14:08:40 -0700 Subject: [PATCH] tools.deploy: adding a configurable deploy-directory. --- basis/tools/deploy/config/config.factor | 6 ++++-- basis/tools/deploy/macosx/macosx.factor | 4 ++-- basis/tools/deploy/unix/unix.factor | 4 ++-- basis/tools/deploy/windows/windows.factor | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/basis/tools/deploy/config/config.factor b/basis/tools/deploy/config/config.factor index 7af24b837f..950b2da2a1 100644 --- a/basis/tools/deploy/config/config.factor +++ b/basis/tools/deploy/config/config.factor @@ -1,7 +1,6 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: io.files io kernel sequences assocs splitting parser -namespaces math vocabs hashtables ; +USING: assocs hashtables kernel math namespaces vocabs ; IN: tools.deploy.config SYMBOL: deploy-name @@ -67,3 +66,6 @@ SYMBOL: deploy-image ! default value for deploy.macosx { "stop-after-last-window?" t } } assoc-union ; + +SYMBOL: deploy-directory +"resource:" deploy-directory set-global diff --git a/basis/tools/deploy/macosx/macosx.factor b/basis/tools/deploy/macosx/macosx.factor index 6b06dd0c08..6b1ab40eed 100644 --- a/basis/tools/deploy/macosx/macosx.factor +++ b/basis/tools/deploy/macosx/macosx.factor @@ -74,7 +74,7 @@ IN: tools.deploy.macosx [ % "/Contents/Resources/" % % ".image" % ] "" make ; : deploy-app-bundle ( vocab -- ) - [ + deploy-directory get [ dup deploy-config [ bundle-name dup exists? [ delete-tree ] [ drop ] if [ bundle-name create-app-dir ] keep @@ -85,7 +85,7 @@ IN: tools.deploy.macosx [ "Contents/Frameworks" copy-libraries ] 2bi bundle-name show-in-finder ] with-variables - ] with-resource-directory ; + ] with-directory ; : deploy-app-bundle? ( vocab -- ? ) deploy-config [ deploy-console? get not deploy-ui? get or ] with-variables ; diff --git a/basis/tools/deploy/unix/unix.factor b/basis/tools/deploy/unix/unix.factor index 7b3ffb05a0..e8fd2c745b 100644 --- a/basis/tools/deploy/unix/unix.factor +++ b/basis/tools/deploy/unix/unix.factor @@ -14,7 +14,7 @@ IN: tools.deploy.unix deploy-name get ; M: unix deploy* ( vocab -- ) - [ + deploy-directory get [ dup deploy-config [ [ bundle-name create-app-dir ] keep [ deployed-image-name ] keep @@ -23,4 +23,4 @@ M: unix deploy* ( vocab -- ) bundle-name normalize-path "Binary deployed to " "." surround print bundle-name webbrowser:open-file ] with-variables - ] with-resource-directory ; + ] with-directory ; diff --git a/basis/tools/deploy/windows/windows.factor b/basis/tools/deploy/windows/windows.factor index 31b7f9fde2..0a9cd8d105 100755 --- a/basis/tools/deploy/windows/windows.factor +++ b/basis/tools/deploy/windows/windows.factor @@ -29,7 +29,7 @@ CONSTANT: app-icon-resource-id "APPICON" [ 2drop ] if ; M: windows deploy* - [ + deploy-directory get [ dup deploy-config [ deploy-name get { @@ -41,4 +41,4 @@ M: windows deploy* [ nip open-in-explorer ] } 2cleave ] with-variables - ] with-resource-directory ; + ] with-directory ;