diff --git a/extra/tools/deploy/deploy.factor b/extra/tools/deploy/deploy.factor index bbeadc40cd..e57cc1f04b 100755 --- a/extra/tools/deploy/deploy.factor +++ b/extra/tools/deploy/deploy.factor @@ -1,10 +1,13 @@ ! Copyright (C) 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: tools.deploy.backend system vocabs.loader kernel ; +USING: tools.deploy.backend system vocabs.loader kernel +combinators ; IN: tools.deploy : deploy ( vocab -- ) deploy* ; -os macosx? [ "tools.deploy.macosx" require ] when -os winnt? [ "tools.deploy.windows" require ] when -os unix? [ "tools.deploy.unix" require ] when \ No newline at end of file +{ + { [ os macosx? ] [ "tools.deploy.macosx" ] } + { [ os winnt? ] [ "tools.deploy.windows" ] } + { [ os unix? ] [ "tools.deploy.unix" ] } +} cond require \ No newline at end of file diff --git a/extra/tools/deploy/macosx/macosx.factor b/extra/tools/deploy/macosx/macosx.factor index ca710e9d28..d38b40db4b 100755 --- a/extra/tools/deploy/macosx/macosx.factor +++ b/extra/tools/deploy/macosx/macosx.factor @@ -31,10 +31,14 @@ IN: tools.deploy.macosx write-plist ; : create-app-dir ( vocab bundle-name -- vm ) - dup "Frameworks" copy-bundle-dir - dup "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir - dup "Contents/Resources/" copy-fonts - 2dup create-app-plist "Contents/MacOS/" append-path "" copy-vm ; + [ + nip + [ "Frameworks" copy-bundle-dir ] + [ "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir ] + [ "Contents/Resources/" copy-fonts ] tri + ] + [ create-app-plist ] + [ "Contents/MacOS/" append-path "" copy-vm ] 2tri ; : deploy.app-image ( vocab bundle-name -- str ) [ % "/Contents/Resources/" % % ".image" % ] "" make ; @@ -43,9 +47,8 @@ IN: tools.deploy.macosx deploy-name get ".app" append ; : show-in-finder ( path -- ) - NSWorkspace - -> sharedWorkspace - over rot parent-directory + [ NSWorkspace -> sharedWorkspace ] + [ normalize-path [ ] [ parent-directory ] bi ] bi* -> selectFile:inFileViewerRootedAtPath: drop ; M: macosx deploy* ( vocab -- ) @@ -56,6 +59,6 @@ M: macosx deploy* ( vocab -- ) [ bundle-name create-app-dir ] keep [ bundle-name deploy.app-image ] keep namespace make-deploy-image - bundle-name normalize-path show-in-finder + bundle-name show-in-finder ] bind ] with-directory ; diff --git a/extra/tools/deploy/unix/unix.factor b/extra/tools/deploy/unix/unix.factor index a995d66cd8..6f5a0304a2 100644 --- a/extra/tools/deploy/unix/unix.factor +++ b/extra/tools/deploy/unix/unix.factor @@ -3,21 +3,21 @@ USING: io io.files io.backend kernel namespaces sequences system tools.deploy.backend tools.deploy.config assocs hashtables prettyprint ; -IN: tools.deploy.linux - -: create-app-dir ( vocab bundle-name -- vm ) - dup "" copy-fonts - "" copy-vm ; - -: bundle-name ( -- str ) - deploy-name get ; +IN: tools.deploy.unix -M: linux deploy* ( vocab -- ) - "." resource-path [ - dup deploy-config [ - [ bundle-name create-app-dir ] keep - [ bundle-name image-name ] keep - namespace make-deploy-image - bundle-name normalize-path [ "Binary deployed to " % % "." % ] "" make print - ] bind - ] with-directory ; \ No newline at end of file +: create-app-dir ( vocab bundle-name -- vm ) + dup "" copy-fonts + "" copy-vm ; + +: bundle-name ( -- str ) + deploy-name get ; + +M: unix deploy* ( vocab -- ) + "." resource-path [ + dup deploy-config [ + [ bundle-name create-app-dir ] keep + [ bundle-name image-name ] keep + namespace make-deploy-image + bundle-name normalize-path [ "Binary deployed to " % % "." % ] "" make print + ] bind + ] with-directory ; \ No newline at end of file diff --git a/extra/tools/deploy/windows/windows.factor b/extra/tools/deploy/windows/windows.factor index 4f6527a4ce..5af3062e39 100755 --- a/extra/tools/deploy/windows/windows.factor +++ b/extra/tools/deploy/windows/windows.factor @@ -6,8 +6,7 @@ prettyprint windows.shell32 windows.user32 ; IN: tools.deploy.windows : copy-dlls ( bundle-name -- ) - { "freetype6.dll" "zlib1.dll" "factor.dll" } - [ resource-path ] map + { "resource:freetype6.dll" "resource:zlib1.dll" "resource:factor.dll" } swap copy-files-into ; : create-exe-dir ( vocab bundle-name -- vm ) @@ -21,6 +20,6 @@ M: winnt deploy* [ deploy-name get create-exe-dir ] keep [ deploy-name get image-name ] keep [ namespace make-deploy-image ] keep - (normalize-path) open-in-explorer + open-in-explorer ] bind ] with-directory ; diff --git a/extra/windows/shell32/shell32.factor b/extra/windows/shell32/shell32.factor index d64fb68cb3..f938ca15e6 100644 --- a/extra/windows/shell32/shell32.factor +++ b/extra/windows/shell32/shell32.factor @@ -1,6 +1,6 @@ USING: alien alien.c-types alien.syntax combinators kernel windows windows.user32 windows.ole32 -windows.com windows.com.syntax ; +windows.com windows.com.syntax io.files ; IN: windows.shell32 : CSIDL_DESKTOP HEX: 00 ; inline @@ -83,7 +83,7 @@ FUNCTION: HINSTANCE ShellExecuteW ( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFi : ShellExecute ShellExecuteW ; inline : open-in-explorer ( dir -- ) - f "open" rot f f SW_SHOWNORMAL ShellExecute drop ; + f "open" rot (normalize-path) f f SW_SHOWNORMAL ShellExecute drop ; : shell32-error ( n -- ) ole32-error ; inline