Cleaning up deployment tool
parent
10ee5cf8ed
commit
851c54ea7a
|
@ -1,10 +1,13 @@
|
||||||
! Copyright (C) 2007, 2008 Slava Pestov.
|
! Copyright (C) 2007, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! 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
|
IN: tools.deploy
|
||||||
|
|
||||||
: deploy ( vocab -- ) deploy* ;
|
: deploy ( vocab -- ) deploy* ;
|
||||||
|
|
||||||
os macosx? [ "tools.deploy.macosx" require ] when
|
{
|
||||||
os winnt? [ "tools.deploy.windows" require ] when
|
{ [ os macosx? ] [ "tools.deploy.macosx" ] }
|
||||||
os unix? [ "tools.deploy.unix" require ] when
|
{ [ os winnt? ] [ "tools.deploy.windows" ] }
|
||||||
|
{ [ os unix? ] [ "tools.deploy.unix" ] }
|
||||||
|
} cond require
|
|
@ -31,10 +31,14 @@ IN: tools.deploy.macosx
|
||||||
write-plist ;
|
write-plist ;
|
||||||
|
|
||||||
: create-app-dir ( vocab bundle-name -- vm )
|
: create-app-dir ( vocab bundle-name -- vm )
|
||||||
dup "Frameworks" copy-bundle-dir
|
[
|
||||||
dup "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
|
nip
|
||||||
dup "Contents/Resources/" copy-fonts
|
[ "Frameworks" copy-bundle-dir ]
|
||||||
2dup create-app-plist "Contents/MacOS/" append-path "" copy-vm ;
|
[ "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 )
|
: deploy.app-image ( vocab bundle-name -- str )
|
||||||
[ % "/Contents/Resources/" % % ".image" % ] "" make ;
|
[ % "/Contents/Resources/" % % ".image" % ] "" make ;
|
||||||
|
@ -43,9 +47,8 @@ IN: tools.deploy.macosx
|
||||||
deploy-name get ".app" append ;
|
deploy-name get ".app" append ;
|
||||||
|
|
||||||
: show-in-finder ( path -- )
|
: show-in-finder ( path -- )
|
||||||
NSWorkspace
|
[ NSWorkspace -> sharedWorkspace ]
|
||||||
-> sharedWorkspace
|
[ normalize-path [ <NSString> ] [ parent-directory <NSString> ] bi ] bi*
|
||||||
over <NSString> rot parent-directory <NSString>
|
|
||||||
-> selectFile:inFileViewerRootedAtPath: drop ;
|
-> selectFile:inFileViewerRootedAtPath: drop ;
|
||||||
|
|
||||||
M: macosx deploy* ( vocab -- )
|
M: macosx deploy* ( vocab -- )
|
||||||
|
@ -56,6 +59,6 @@ M: macosx deploy* ( vocab -- )
|
||||||
[ bundle-name create-app-dir ] keep
|
[ bundle-name create-app-dir ] keep
|
||||||
[ bundle-name deploy.app-image ] keep
|
[ bundle-name deploy.app-image ] keep
|
||||||
namespace make-deploy-image
|
namespace make-deploy-image
|
||||||
bundle-name normalize-path show-in-finder
|
bundle-name show-in-finder
|
||||||
] bind
|
] bind
|
||||||
] with-directory ;
|
] with-directory ;
|
||||||
|
|
|
@ -3,21 +3,21 @@
|
||||||
USING: io io.files io.backend kernel namespaces sequences
|
USING: io io.files io.backend kernel namespaces sequences
|
||||||
system tools.deploy.backend tools.deploy.config assocs
|
system tools.deploy.backend tools.deploy.config assocs
|
||||||
hashtables prettyprint ;
|
hashtables prettyprint ;
|
||||||
IN: tools.deploy.linux
|
IN: tools.deploy.unix
|
||||||
|
|
||||||
: create-app-dir ( vocab bundle-name -- vm )
|
|
||||||
dup "" copy-fonts
|
|
||||||
"" copy-vm ;
|
|
||||||
|
|
||||||
: bundle-name ( -- str )
|
|
||||||
deploy-name get ;
|
|
||||||
|
|
||||||
M: linux deploy* ( vocab -- )
|
: create-app-dir ( vocab bundle-name -- vm )
|
||||||
"." resource-path [
|
dup "" copy-fonts
|
||||||
dup deploy-config [
|
"" copy-vm ;
|
||||||
[ bundle-name create-app-dir ] keep
|
|
||||||
[ bundle-name image-name ] keep
|
: bundle-name ( -- str )
|
||||||
namespace make-deploy-image
|
deploy-name get ;
|
||||||
bundle-name normalize-path [ "Binary deployed to " % % "." % ] "" make print
|
|
||||||
] bind
|
M: unix deploy* ( vocab -- )
|
||||||
] with-directory ;
|
"." 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 ;
|
|
@ -6,8 +6,7 @@ prettyprint windows.shell32 windows.user32 ;
|
||||||
IN: tools.deploy.windows
|
IN: tools.deploy.windows
|
||||||
|
|
||||||
: copy-dlls ( bundle-name -- )
|
: copy-dlls ( bundle-name -- )
|
||||||
{ "freetype6.dll" "zlib1.dll" "factor.dll" }
|
{ "resource:freetype6.dll" "resource:zlib1.dll" "resource:factor.dll" }
|
||||||
[ resource-path ] map
|
|
||||||
swap copy-files-into ;
|
swap copy-files-into ;
|
||||||
|
|
||||||
: create-exe-dir ( vocab bundle-name -- vm )
|
: create-exe-dir ( vocab bundle-name -- vm )
|
||||||
|
@ -21,6 +20,6 @@ M: winnt deploy*
|
||||||
[ deploy-name get create-exe-dir ] keep
|
[ deploy-name get create-exe-dir ] keep
|
||||||
[ deploy-name get image-name ] keep
|
[ deploy-name get image-name ] keep
|
||||||
[ namespace make-deploy-image ] keep
|
[ namespace make-deploy-image ] keep
|
||||||
(normalize-path) open-in-explorer
|
open-in-explorer
|
||||||
] bind
|
] bind
|
||||||
] with-directory ;
|
] with-directory ;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: alien alien.c-types alien.syntax combinators
|
USING: alien alien.c-types alien.syntax combinators
|
||||||
kernel windows windows.user32 windows.ole32
|
kernel windows windows.user32 windows.ole32
|
||||||
windows.com windows.com.syntax ;
|
windows.com windows.com.syntax io.files ;
|
||||||
IN: windows.shell32
|
IN: windows.shell32
|
||||||
|
|
||||||
: CSIDL_DESKTOP HEX: 00 ; inline
|
: CSIDL_DESKTOP HEX: 00 ; inline
|
||||||
|
@ -83,7 +83,7 @@ FUNCTION: HINSTANCE ShellExecuteW ( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFi
|
||||||
: ShellExecute ShellExecuteW ; inline
|
: ShellExecute ShellExecuteW ; inline
|
||||||
|
|
||||||
: open-in-explorer ( dir -- )
|
: 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 -- )
|
: shell32-error ( n -- )
|
||||||
ole32-error ; inline
|
ole32-error ; inline
|
||||||
|
|
Loading…
Reference in New Issue