USING: tools.deploy.config ;
H{
- { deploy-io 2 }
- { deploy-math? f }
- { deploy-threads? f }
- { deploy-compiler? f }
- { deploy-word-props? f }
- { deploy-word-defs? f }
{ deploy-name "Hello world (console)" }
- { deploy-reflection 2 }
+ { deploy-threads? f }
{ deploy-c-types? f }
+ { deploy-compiler? f }
{ deploy-ui? f }
+ { deploy-math? f }
+ { deploy-reflection 1 }
+ { deploy-word-defs? f }
+ { deploy-io 2 }
+ { deploy-word-props? f }
{ "stop-after-last-window?" t }
}
USING: tools.deploy.config ;
H{
- { deploy-reflection 2 }
- { deploy-word-props? f }
+ { deploy-name "Sudoku" }
+ { deploy-threads? f }
+ { deploy-c-types? f }
{ deploy-compiler? t }
+ { deploy-ui? f }
{ deploy-math? f }
- { deploy-c-types? f }
+ { deploy-reflection 1 }
+ { deploy-word-defs? f }
{ deploy-io 2 }
- { deploy-ui? f }
- { deploy-name "Sudoku" }
+ { deploy-word-props? f }
{ "stop-after-last-window?" t }
- { deploy-word-defs? f }
}
: run-factor ( vm flags -- )
swap add* dup . run-with-output ; inline
-: make-staging-image ( vm config -- )
- staging-command-line run-factor ;
+: make-staging-image ( config -- )
+ vm swap staging-command-line run-factor ;
+
+: ?make-staging-image ( config -- )
+ dup [ staging-image-name ] bind exists?
+ [ drop ] [ make-staging-image ] if ;
: deploy-command-line ( image vocab config -- flags )
[
: make-deploy-image ( vm image vocab config -- )
make-boot-image
- dup staging-image-name exists? [
- >r pick r> tuck make-staging-image
- ] unless
+ dup ?make-staging-image
deploy-command-line run-factor ;
SYMBOL: deploy-implementation
IN: tools.deploy.tests\r
USING: tools.test system io.files kernel tools.deploy.config\r
-tools.deploy.backend math sequences io.launcher ;\r
+tools.deploy.backend math sequences io.launcher arrays ;\r
\r
-: shake-and-bake\r
+: shake-and-bake ( vocab -- )\r
"." resource-path [\r
- vm\r
+ >r vm\r
"test.image" temp-file\r
- rot dup deploy-config make-deploy-image\r
+ r> dup deploy-config make-deploy-image\r
] with-directory ;\r
\r
+: small-enough? ( n -- ? )\r
+ >r "test.image" temp-file file-info file-info-size r> <= ;\r
+\r
[ ] [ "hello-world" shake-and-bake ] unit-test\r
\r
[ t ] [\r
- "hello.image" temp-file file-info file-info-size 500000 <=\r
+ 500000 small-enough?\r
] unit-test\r
\r
[ ] [ "sudoku" shake-and-bake ] unit-test\r
\r
[ t ] [\r
- "hello.image" temp-file file-info file-info-size 1500000 <=\r
+ 1500000 small-enough?\r
] unit-test\r
\r
[ ] [ "hello-ui" shake-and-bake ] unit-test\r
\r
[ t ] [\r
- "hello.image" temp-file file-info file-info-size 2000000 <=\r
+ 2000000 small-enough?\r
] unit-test\r
\r
[ ] [ "bunny" shake-and-bake ] unit-test\r
\r
[ t ] [\r
- "hello.image" temp-file file-info file-info-size 3000000 <=\r
+ 3000000 small-enough?\r
] unit-test\r
\r
[ ] [\r
"tools.deploy.test.1" shake-and-bake\r
- vm "-i=" "test.image" temp-file append try-process\r
+ vm "-i=" "test.image" temp-file append 2array try-process\r
] unit-test\r
\r
[ ] [\r
"tools.deploy.test.2" shake-and-bake\r
- vm "-i=" "test.image" temp-file append try-process\r
+ vm "-i=" "test.image" temp-file append 2array try-process\r
] unit-test\r
QUALIFIED: init
QUALIFIED: inspector
QUALIFIED: io.backend
-QUALIFIED: io.nonblocking
QUALIFIED: io.thread
QUALIFIED: layouts
QUALIFIED: libc.private
strip-io? [ io.backend:io-backend , ] when
- { io.backend:io-backend io.nonblocking:default-buffer-size }
- { "alarms" "io" "tools" } strip-vocab-globals %
+ [
+ io.backend:io-backend
+ "default-buffer-size" "io.nonblocking" lookup ,
+ ] { "alarms" "io" "tools" } strip-vocab-globals %
strip-dictionary? [
{ } { "cpu" } strip-vocab-globals %