From 33b3f1b3b4771b2fd97ab75ba56468c53e59296d Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 7 Mar 2008 21:28:51 -0600 Subject: [PATCH] Fixing deploy --- extra/cocoa/plists/plists.factor | 4 ++-- extra/tools/deploy/backend/backend.factor | 4 ++-- extra/tools/deploy/macosx/macosx.factor | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/extra/cocoa/plists/plists.factor b/extra/cocoa/plists/plists.factor index 646a759c59..5965c74af8 100644 --- a/extra/cocoa/plists/plists.factor +++ b/extra/cocoa/plists/plists.factor @@ -19,5 +19,5 @@ M: hashtable >plist >plist 1array "plist" build-tag* dup { { "version" "1.0" } } update ; -: print-plist ( obj -- ) - build-plist build-xml print-xml ; +: plist>string ( obj -- string ) + build-plist build-xml xml>string ; diff --git a/extra/tools/deploy/backend/backend.factor b/extra/tools/deploy/backend/backend.factor index 6e8a231b81..301ffa3378 100755 --- a/extra/tools/deploy/backend/backend.factor +++ b/extra/tools/deploy/backend/backend.factor @@ -23,7 +23,7 @@ IN: tools.deploy.backend +closed+ >>stdin utf8 dup copy-lines - process-stream-process wait-for-process zero? [ + process>> wait-for-process zero? [ "Deployment failed" throw ] unless ; @@ -61,7 +61,7 @@ IN: tools.deploy.backend ] { } make ; : run-factor ( vm flags -- ) - dup . swap add* run-with-output ; inline + swap add* dup . run-with-output ; inline : make-staging-image ( vm config -- ) staging-command-line run-factor ; diff --git a/extra/tools/deploy/macosx/macosx.factor b/extra/tools/deploy/macosx/macosx.factor index 6cab5c98b9..6db19cf868 100755 --- a/extra/tools/deploy/macosx/macosx.factor +++ b/extra/tools/deploy/macosx/macosx.factor @@ -9,17 +9,18 @@ IN: tools.deploy.macosx : bundle-dir ( -- dir ) vm parent-directory parent-directory ; -: copy-bundle-dir ( name dir -- ) - bundle-dir swap path+ swap "Contents" path+ copy-tree ; +: copy-bundle-dir ( bundle-name dir -- ) + bundle-dir over path+ -rot + "Contents" swap path+ path+ copy-tree ; : copy-vm ( executable bundle-name -- vm ) "Contents/MacOS/" path+ swap path+ vm over copy-file ; : copy-fonts ( name -- ) "fonts/" resource-path - swap "Contents/Resources/" path+ copy-tree ; + swap "Contents/Resources/" path+ copy-tree-into ; -: print-app-plist ( executable bundle-name -- ) +: app-plist ( executable bundle-name -- string ) [ namespace { { "CFBundleInfoDictionaryVersion" "6.0" } @@ -30,11 +31,12 @@ IN: tools.deploy.macosx dup "CFBundleExecutable" set "org.factor." swap append "CFBundleIdentifier" set - ] H{ } make-assoc print-plist ; + ] H{ } make-assoc plist>string ; : create-app-plist ( vocab bundle-name -- ) - dup "Contents/Info.plist" path+ - utf8 [ print-app-plist ] with-file-writer ; + [ app-plist ] keep + "Contents/Info.plist" path+ + utf8 set-file-contents ; : create-app-dir ( vocab bundle-name -- vm ) dup "Frameworks" copy-bundle-dir @@ -62,7 +64,7 @@ M: macosx-deploy-implementation deploy* ( vocab -- ) ".app deploy tool" assert.app "." resource-path cd dup deploy-config [ - bundle-name delete-tree + bundle-name dup exists? [ delete-tree ] [ drop ] if [ bundle-name create-app-dir ] keep [ bundle-name deploy.app-image ] keep namespace make-deploy-image