Improved deployment

release
Slava Pestov 2007-10-09 02:07:59 -04:00
parent bce82aa915
commit 86df33bc5d
5 changed files with 15 additions and 5 deletions

View File

@ -4,6 +4,7 @@ USING: vocabs.loader io.files io kernel sequences assocs
splitting parser prettyprint ; splitting parser prettyprint ;
IN: tools.deploy.config IN: tools.deploy.config
SYMBOL: strip-io?
SYMBOL: strip-globals? SYMBOL: strip-globals?
SYMBOL: strip-word-props? SYMBOL: strip-word-props?
SYMBOL: strip-word-names? SYMBOL: strip-word-names?
@ -22,6 +23,7 @@ SYMBOL: deploy-image
: default-config ( -- assoc ) : default-config ( -- assoc )
V{ V{
{ strip-io? f }
{ strip-prettyprint? t } { strip-prettyprint? t }
{ strip-globals? t } { strip-globals? t }
{ strip-word-props? t } { strip-word-props? t }

View File

@ -57,4 +57,5 @@ PRIVATE>
deploy-command-line stage2 ; deploy-command-line stage2 ;
: deploy ( vocab -- ) : deploy ( vocab -- )
"" resource-path cd
vm over ".image" append rot dup deploy-config deploy* ; vm over ".image" append rot dup deploy-config deploy* ;

View File

@ -15,19 +15,20 @@ IN: tools.deploy.shaker
: strip-init-hooks ( -- ) : strip-init-hooks ( -- )
"Stripping startup hooks" show "Stripping startup hooks" show
"command-line" init-hooks get delete-at ; "command-line" init-hooks get delete-at
strip-io? get [ "io.backend" init-hooks get delete-at ] when ;
: strip-debugger ( -- ) : strip-debugger ( -- )
strip-debugger? get [ strip-debugger? get [
"Stripping debugger" show "Stripping debugger" show
"resource:extra/tools/deploy/strip-debugger.factor" "resource:extra/tools/deploy/shaker/strip-debugger.factor"
run-file run-file
] when ; ] when ;
: strip-cocoa ( -- ) : strip-cocoa ( -- )
"cocoa" vocab [ "cocoa" vocab [
"Stripping unused Cocoa methods" show "Stripping unused Cocoa methods" show
"resource:extra/tools/deploy/strip-cocoa.factor" "resource:extra/tools/deploy/shaker/strip-cocoa.factor"
run-file run-file
] when ; ] when ;
@ -90,6 +91,8 @@ USING: bit-arrays byte-arrays io.streams.nested ;
{ } set-retainstack { } set-retainstack
V{ } set-namestack V{ } set-namestack
V{ } set-catchstack V{ } set-catchstack
"Stripping compiled quotations" show
strip-compiled-quotations
"Saving final image" show "Saving final image" show
[ save-image-and-exit ] call-clear ; [ save-image-and-exit ] call-clear ;
@ -100,14 +103,14 @@ SYMBOL: deploy-vocab
\ boot , \ boot ,
init-hooks get values concat % init-hooks get values concat %
, ,
"io.backend" init-hooks get at [ \ flush , ] when strip-io? get [ \ flush , ] unless
] [ ] make "Boot quotation: " write dup . flush ] [ ] make "Boot quotation: " write dup . flush
set-boot-quot ; set-boot-quot ;
: retained-globals ( -- seq ) : retained-globals ( -- seq )
[ [
builtins , builtins ,
io-backend , strip-io? get [ io-backend , ] unless
strip-dictionary? get [ strip-dictionary? get [
{ {
@ -178,6 +181,8 @@ SYMBOL: deploy-vocab
deploy-vocab get require deploy-vocab get require
r> [ call ] when* r> [ call ] when*
strip strip
"Compressing image" show
compress-image
finish-deploy finish-deploy
] [ ] [
print-error flush 1 exit print-error flush 1 exit

View File

@ -1,4 +1,6 @@
USING: kernel ; USING: kernel ;
IN: debugger IN: debugger
: print-error die ;
: error. die ; : error. die ;