Don't copy freetype over if UI is not deployed

db4
Slava Pestov 2008-10-02 10:53:30 -05:00
parent d5bbbd90e4
commit 00afda7f7e
3 changed files with 39 additions and 16 deletions

View File

@ -10,13 +10,15 @@ io.encodings.utf8 destructors accessors ;
IN: tools.deploy.backend
: copy-vm ( executable bundle-name extension -- vm )
[ prepend-path ] dip append vm over copy-file ;
[ prepend-path ] dip append vm over copy-file ;
: copy-fonts ( name dir -- )
append-path "resource:fonts/" swap copy-tree-into ;
deploy-ui? get [
append-path "resource:fonts/" swap copy-tree-into
] [ 2drop ] if ;
: image-name ( vocab bundle-name -- str )
prepend-path ".image" append ;
prepend-path ".image" append ;
: copy-lines ( -- )
readln [ print flush copy-lines ] when* ;

View File

@ -4,7 +4,7 @@ USING: io io.files kernel namespaces make sequences
system tools.deploy.backend tools.deploy.config assocs
hashtables prettyprint io.unix.backend cocoa io.encodings.utf8
io.backend cocoa.application cocoa.classes cocoa.plists
qualified ;
qualified combinators ;
IN: tools.deploy.macosx
: bundle-dir ( -- dir )
@ -30,12 +30,26 @@ IN: tools.deploy.macosx
"Contents/Info.plist" append-path
write-plist ;
: copy-dll ( bundle-name -- )
"Frameworks/libfactor.dylib" copy-bundle-dir ;
: copy-freetype ( bundle-name -- )
deploy-ui? get [ "Frameworks" copy-bundle-dir ] [ drop ] if ;
: copy-nib ( bundle-name -- )
deploy-ui? get [
"Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
] [ drop ] if ;
: create-app-dir ( vocab bundle-name -- vm )
[
nip
[ "Frameworks" copy-bundle-dir ]
[ "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir ]
[ "Contents/Resources/" copy-fonts ] tri
nip {
[ copy-dll ]
[ copy-freetype ]
[ copy-nib ]
[ "Contents/Resources/" copy-fonts ]
[ "Contents/Resources" append-path make-directories ]
} cleave
]
[ create-app-plist ]
[ "Contents/MacOS/" append-path "" copy-vm ] 2tri ;

View File

@ -5,16 +5,23 @@ tools.deploy.backend tools.deploy.config assocs hashtables
prettyprint combinators windows.shell32 windows.user32 ;
IN: tools.deploy.windows
: copy-dlls ( bundle-name -- )
{
"resource:freetype6.dll"
"resource:zlib1.dll"
"resource:factor.dll"
} swap copy-files-into ;
: copy-dll ( bundle-name -- )
"resource:factor.dll" swap copy-file-into ;
: copy-freetype ( bundle-name -- )
deploy-ui? get [
{
"resource:freetype6.dll"
"resource:zlib1.dll"
} swap copy-files-into
] when ;
: create-exe-dir ( vocab bundle-name -- vm )
dup copy-dlls
dup "" copy-fonts
deploy-ui? get [
dup copy-dll
dup copy-freetype
dup "" copy-fonts
] when
".exe" copy-vm ;
M: winnt deploy*