2008-01-31 01:25:06 -05:00
|
|
|
|
2008-02-04 22:26:59 -05:00
|
|
|
USING: kernel io io.files io.launcher hashtables tools.deploy.backend
|
|
|
|
system continuations namespaces sequences splitting math.parser
|
2008-02-04 22:58:57 -05:00
|
|
|
prettyprint tools.time calendar bake vars http.client
|
|
|
|
combinators ;
|
2008-01-31 01:25:06 -05:00
|
|
|
|
|
|
|
IN: builder
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
: datestamp ( -- string )
|
|
|
|
now `{ ,[ dup timestamp-year ]
|
2008-02-02 01:29:47 -05:00
|
|
|
,[ dup timestamp-month ]
|
|
|
|
,[ dup timestamp-day ]
|
|
|
|
,[ dup timestamp-hour ]
|
|
|
|
,[ timestamp-minute ] }
|
2008-02-05 00:48:18 -05:00
|
|
|
[ pad-00 ] map "-" join ;
|
2008-01-31 01:25:06 -05:00
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
SYMBOL: builder-recipients
|
|
|
|
|
|
|
|
: email-file ( subject file -- )
|
|
|
|
`{
|
2008-02-04 22:26:59 -05:00
|
|
|
{ +stdin+ , }
|
|
|
|
{ +arguments+ { "mutt" "-s" , %[ builder-recipients get ] } }
|
|
|
|
}
|
|
|
|
>hashtable run-process drop ;
|
|
|
|
|
|
|
|
: email-string ( subject -- )
|
|
|
|
`{ "mutt" "-s" , %[ builder-recipients get ] }
|
2008-02-05 00:48:18 -05:00
|
|
|
[ ] with-process-stream drop ;
|
2008-02-04 22:26:59 -05:00
|
|
|
|
2008-01-31 01:25:06 -05:00
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-06 00:09:33 -05:00
|
|
|
: target ( -- target ) `{ ,[ os ] %[ cpu "." split ] } "-" join ;
|
2008-02-05 19:28:05 -05:00
|
|
|
|
2008-02-06 00:09:33 -05:00
|
|
|
! : target ( -- target )
|
|
|
|
! { { [ os "windows" = ] [ "windows-nt-x86-32" ] }
|
|
|
|
! { [ t ] [ `{ ,[ os ] %[ cpu "." split ] } "-" join ] } }
|
|
|
|
! cond ;
|
2008-01-31 01:25:06 -05:00
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-02-04 22:58:57 -05:00
|
|
|
: factor-binary ( -- name )
|
|
|
|
os
|
|
|
|
{ { "macosx" [ "./Factor.app/Contents/MacOS/factor" ] }
|
2008-02-06 00:09:33 -05:00
|
|
|
{ "winnt" [ "./factor-nt.exe" ] }
|
2008-02-04 22:58:57 -05:00
|
|
|
[ drop "./factor" ] }
|
|
|
|
case ;
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-01-31 01:25:06 -05:00
|
|
|
VAR: stamp
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
: build ( -- )
|
|
|
|
|
2008-02-04 22:26:59 -05:00
|
|
|
datestamp >stamp
|
|
|
|
|
|
|
|
"/builds/factor" cd
|
|
|
|
|
2008-02-06 00:09:33 -05:00
|
|
|
{
|
|
|
|
"git"
|
|
|
|
"pull"
|
|
|
|
"--no-summary"
|
|
|
|
"git://factorcode.org/git/factor.git"
|
|
|
|
"master"
|
|
|
|
}
|
2008-02-04 22:26:59 -05:00
|
|
|
run-process process-status
|
|
|
|
0 =
|
|
|
|
[ ]
|
|
|
|
[
|
|
|
|
"builder: git pull" email-string
|
|
|
|
"builder: git pull" throw
|
|
|
|
]
|
|
|
|
if
|
|
|
|
|
|
|
|
"/builds/" stamp> append make-directory
|
|
|
|
"/builds/" stamp> append cd
|
|
|
|
|
2008-02-06 00:09:33 -05:00
|
|
|
{ "git" "clone" "../factor" } run-process drop
|
2008-02-04 22:26:59 -05:00
|
|
|
|
|
|
|
"factor" cd
|
|
|
|
|
|
|
|
{ "git" "show" } <process-stream>
|
|
|
|
[ readln ] with-stream
|
|
|
|
" " split second
|
|
|
|
"../git-id" <file-writer> [ print ] with-stream
|
|
|
|
|
|
|
|
{ "make" "clean" } run-process drop
|
|
|
|
|
|
|
|
`{
|
|
|
|
{ +arguments+ { "make" ,[ target ] } }
|
|
|
|
{ +stdout+ "../compile-log" }
|
|
|
|
{ +stderr+ +stdout+ }
|
|
|
|
}
|
|
|
|
>hashtable run-process process-status
|
|
|
|
0 =
|
|
|
|
[ ]
|
|
|
|
[
|
|
|
|
"builder: vm compile" "../compile-log" email-file
|
|
|
|
"builder: vm compile" throw
|
|
|
|
] if
|
|
|
|
|
|
|
|
[ "http://factorcode.org/images/latest/" boot-image-name append download ]
|
|
|
|
[ "builder: image download" email-string ]
|
|
|
|
recover
|
|
|
|
|
|
|
|
`{
|
|
|
|
{ +arguments+ {
|
2008-02-04 22:58:57 -05:00
|
|
|
,[ factor-binary ]
|
2008-02-04 22:26:59 -05:00
|
|
|
,[ "-i=" boot-image-name append ]
|
|
|
|
"-no-user-init"
|
|
|
|
} }
|
|
|
|
{ +stdout+ "../boot-log" }
|
|
|
|
{ +stderr+ +stdout+ }
|
|
|
|
}
|
|
|
|
>hashtable
|
|
|
|
[ run-process process-status ]
|
|
|
|
benchmark nip "../boot-time" <file-writer> [ . ] with-stream
|
|
|
|
0 =
|
|
|
|
[ ]
|
|
|
|
[
|
|
|
|
"builder: bootstrap" "../boot-log" email-file
|
|
|
|
"builder: bootstrap" throw
|
|
|
|
] if
|
|
|
|
|
2008-02-06 00:09:33 -05:00
|
|
|
! `{
|
|
|
|
! { +arguments+
|
|
|
|
! { ,[ factor-binary ] "-e=USE: tools.browser load-everything" } }
|
|
|
|
! { +stdout+ "../load-everything-log" }
|
|
|
|
! { +stderr+ +stdout+ }
|
|
|
|
! }
|
|
|
|
! >hashtable [ run-process process-status ] benchmark nip
|
|
|
|
! "../load-everything-time" <file-writer> [ . ] with-stream
|
|
|
|
! 0 =
|
|
|
|
! [ ]
|
|
|
|
! [
|
|
|
|
! "builder: load-everything" "../load-everything-log" email-file
|
|
|
|
! "builder: load-everything" throw
|
|
|
|
! ] if ;
|
|
|
|
|
|
|
|
`{ ,[ factor-binary ] "-run=builder.load-everything" } run-process drop
|
|
|
|
"../load-everything-log" exists?
|
|
|
|
[ "builder: load-everything" "../load-everything-log" email-file ]
|
|
|
|
when
|
|
|
|
|
|
|
|
;
|
2008-01-31 01:25:06 -05:00
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
MAIN: build
|