tools.deploy: adding a deploy-path that gives you the executable that was created.
parent
ec7afb3ea6
commit
17b369972f
|
@ -140,3 +140,5 @@ DEFER: ?make-staging-image
|
|||
image vm embed-image ;
|
||||
|
||||
HOOK: deploy* os ( vocab -- )
|
||||
|
||||
HOOK: deploy-path os ( vocab -- path )
|
||||
|
|
|
@ -18,6 +18,12 @@ delete-staging-images
|
|||
|
||||
{ } [ "hello-world" shake-and-bake 550000 small-enough? ] unit-test
|
||||
|
||||
{ "Hello world\n" } [
|
||||
"hello-world" deploy
|
||||
"hello-world" deploy-path 1array
|
||||
ascii [ contents ] with-process-reader
|
||||
] unit-test
|
||||
|
||||
{ } [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test
|
||||
|
||||
! [ ] [ "hello-ui" shake-and-bake 1605000 small-enough? ] unit-test
|
||||
|
|
|
@ -92,8 +92,22 @@ IN: tools.deploy.macosx
|
|||
: deploy-app-bundle? ( vocab -- ? )
|
||||
deploy-config [ deploy-console? get not deploy-ui? get or ] with-variables ;
|
||||
|
||||
M: macosx deploy* ( vocab -- )
|
||||
M: macosx deploy*
|
||||
! pass off to M: unix deploy* if we're building a console app
|
||||
dup deploy-app-bundle?
|
||||
[ deploy-app-bundle ]
|
||||
[ call-next-method ] if ;
|
||||
dup deploy-app-bundle? [
|
||||
deploy-app-bundle
|
||||
] [
|
||||
call-next-method
|
||||
] if ;
|
||||
|
||||
M: macosx deploy-path
|
||||
dup deploy-app-bundle? [
|
||||
deploy-directory get [
|
||||
dup deploy-config [
|
||||
bundle-name "Contents/MacOS/" append-path
|
||||
swap append-path normalize-path
|
||||
] with-variables
|
||||
] with-directory
|
||||
] [
|
||||
call-next-method
|
||||
] if ;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
! Copyright (C) 2008 James Cash
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: io io.backend io.directories io.files.info.unix kernel
|
||||
namespaces sequences system tools.deploy.backend
|
||||
tools.deploy.config tools.deploy.config.editor ;
|
||||
USING: io io.backend io.directories io.files.info.unix
|
||||
io.pathnames kernel namespaces sequences system
|
||||
tools.deploy.backend tools.deploy.config
|
||||
tools.deploy.config.editor ;
|
||||
QUALIFIED: webbrowser
|
||||
IN: tools.deploy.unix
|
||||
|
||||
|
@ -13,7 +14,7 @@ IN: tools.deploy.unix
|
|||
: bundle-name ( -- str )
|
||||
deploy-name get ;
|
||||
|
||||
M: unix deploy* ( vocab -- )
|
||||
M: unix deploy*
|
||||
deploy-directory get [
|
||||
dup deploy-config [
|
||||
[ bundle-name create-app-dir ] keep
|
||||
|
@ -24,3 +25,10 @@ M: unix deploy* ( vocab -- )
|
|||
bundle-name webbrowser:open-file
|
||||
] with-variables
|
||||
] with-directory ;
|
||||
|
||||
M: unix deploy-path
|
||||
deploy-directory get [
|
||||
dup deploy-config [
|
||||
bundle-name swap append-path normalize-path
|
||||
] with-variables
|
||||
] with-directory ;
|
||||
|
|
|
@ -40,3 +40,12 @@ M: windows deploy*
|
|||
} 2cleave
|
||||
] with-variables
|
||||
] with-directory ;
|
||||
|
||||
M: windows deploy-path
|
||||
deploy-directory get [
|
||||
dup deploy-config [
|
||||
deploy-name get
|
||||
swap ".exe" append append-path
|
||||
normalize-path
|
||||
] with-variables
|
||||
] with-directory ;
|
||||
|
|
Loading…
Reference in New Issue