Merge git://factorcode.org/git/factor

release
Doug Coleman 2007-11-24 18:42:00 -06:00
commit e9e26039b2
4 changed files with 35 additions and 22 deletions

View File

@ -16,4 +16,18 @@ USING: io.unix.launcher tools.test ;
[ { "abc def" "hey" } ] [ "'abc def' \"hey\"" tokenize-command ] unit-test [ { "abc def" "hey" } ] [ "'abc def' \"hey\"" tokenize-command ] unit-test
[ "'abc def' \"hey" tokenize-command ] unit-test-fails [ "'abc def' \"hey" tokenize-command ] unit-test-fails
[ "'abc def" tokenize-command ] unit-test-fails [ "'abc def" tokenize-command ] unit-test-fails
[ { "abc def" "h\"ey" } ] [ "'abc def' \"h\"ey\" " tokenize-command ] unit-test [ { "abc def" "h\"ey" } ] [ "'abc def' \"h\\\"ey\" " tokenize-command ] unit-test
[
{
"Hello world.app/Contents/MacOS/hello-ui"
"-i=boot.macosx-ppc.image"
"-include= math compiler ui"
"-deploy-vocab=hello-ui"
"-output-image=Hello world.app/Contents/Resources/hello-ui.image"
"-no-stack-traces"
"-no-user-init"
}
] [
"\"Hello world.app/Contents/MacOS/hello-ui\" -i=boot.macosx-ppc.image \"-include= math compiler ui\" -deploy-vocab=hello-ui \"-output-image=Hello world.app/Contents/Resources/hello-ui.image\" -no-stack-traces -no-user-init" tokenize-command
] unit-test

View File

@ -16,19 +16,18 @@ USE: unix
! "foo bar" -- quotation ! "foo bar" -- quotation
LAZY: 'escaped-char' "\\" token any-char-parser &> ; LAZY: 'escaped-char' "\\" token any-char-parser &> ;
LAZY: 'chars' 'escaped-char' any-char-parser <|> <*> ; LAZY: 'quoted-char' ( delimiter -- parser' )
'escaped-char'
swap [ member? not ] curry satisfy
<|> ; inline
LAZY: 'quoted-1' 'chars' "\"" "\"" surrounded-by ; LAZY: 'quoted' ( delimiter -- parser )
dup 'quoted-char' <*> swap dup surrounded-by ;
LAZY: 'quoted-2' 'chars' "'" "'" surrounded-by ; LAZY: 'unquoted' ( -- parser ) " " 'quoted-char' <+> ;
LAZY: 'non-space-char' LAZY: 'argument' ( -- parser )
'escaped-char' [ CHAR: \s = not ] satisfy <|> ; "\"" 'quoted' "'" 'quoted' 'unquoted' <|> <|>
LAZY: 'unquoted' 'non-space-char' <+> ;
LAZY: 'argument'
'quoted-1' 'quoted-2' 'unquoted' <|> <|>
[ >string ] <@ ; [ >string ] <@ ;
MEMO: 'arguments' ( -- parser ) MEMO: 'arguments' ( -- parser )

View File

@ -26,12 +26,8 @@ IN: tools.deploy
[ (copy-lines) ] [ stream-close ] [ ] cleanup ; [ (copy-lines) ] [ stream-close ] [ ] cleanup ;
: stage2 ( vm flags -- ) : stage2 ( vm flags -- )
[ >r "-i=" boot-image-name append 2array r> append dup .
"\"" % swap % "\" -i=" % <process-stream>
boot-image-name %
[ " " % % ] each
] "" make
dup print <process-stream>
dup duplex-stream-out stream-close dup duplex-stream-out stream-close
copy-lines ; copy-lines ;
@ -48,11 +44,11 @@ IN: tools.deploy
: deploy-command-line ( vm image vocab config -- vm flags ) : deploy-command-line ( vm image vocab config -- vm flags )
[ [
"\"-include=" swap profile-string "\"" 3append , "-include=" swap profile-string append ,
"-deploy-vocab=" swap append , "-deploy-vocab=" swap append ,
"\"-output-image=" swap "\"" 3append , "-output-image=" swap append ,
"-no-stack-traces" , "-no-stack-traces" ,

View File

@ -2,8 +2,9 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: io io.files io.launcher kernel namespaces sequences USING: io io.files io.launcher kernel namespaces sequences
system tools.deploy tools.deploy.config assocs hashtables system tools.deploy tools.deploy.config assocs hashtables
prettyprint unix io.unix.backend cocoa cocoa.plists prettyprint io.unix.backend cocoa cocoa.plists
cocoa.application cocoa.classes ; cocoa.application cocoa.classes qualified ;
QUALIFIED: unix
IN: tools.deploy.macosx IN: tools.deploy.macosx
: touch ( path -- ) : touch ( path -- )
@ -19,10 +20,13 @@ IN: tools.deploy.macosx
bundle-dir over path+ -rot bundle-dir over path+ -rot
>r "Contents" path+ r> path+ copy-directory ; >r "Contents" path+ r> path+ copy-directory ;
: chmod ( path perms -- )
unix:chmod io-error ;
: copy-vm ( executable bundle-name -- vm ) : copy-vm ( executable bundle-name -- vm )
"Contents/MacOS/" path+ swap path+ vm swap "Contents/MacOS/" path+ swap path+ vm swap
[ copy-file ] keep [ copy-file ] keep
[ 755 chmod io-error ] keep ; [ OCT: 755 chmod ] keep ;
: copy-fonts ( name -- ) : copy-fonts ( name -- )
"fonts/" resource-path "fonts/" resource-path