mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-05 18:20:36 -08:00
batch command line rendering of .clog files
This commit is contained in:
parent
417aedd981
commit
780918d1ed
4 changed files with 40 additions and 19 deletions
|
|
@ -173,9 +173,17 @@
|
||||||
(let ((app (make-instance 'app-data)))
|
(let ((app (make-instance 'app-data)))
|
||||||
(setf (connection-data-item body "app-data") app))
|
(setf (connection-data-item body "app-data") app))
|
||||||
(display-splash body)
|
(display-splash body)
|
||||||
(start-game body))
|
(start-game body)
|
||||||
|
;; When *app-mode* set only run the game once and then shutdown the app
|
||||||
|
(when *app-mode*
|
||||||
|
(clog:shutdown)
|
||||||
|
(uiop:quit)))
|
||||||
|
|
||||||
(defun start-demo (&key (host "0.0.0.0") (port 8080))
|
(defparameter *app-mode* nil)
|
||||||
"Start demo."
|
|
||||||
|
(defun start-demo (&key (host "0.0.0.0") (port 8080) app)
|
||||||
|
"Start demo. If app is t, runs one game and shutsdown."
|
||||||
(initialize 'on-new-window :host host :port port)
|
(initialize 'on-new-window :host host :port port)
|
||||||
(open-browser :url (format nil "http://127.0.0.1:~A" port)))
|
(if app
|
||||||
|
(setf *app-mode* app)
|
||||||
|
(open-browser :url (format nil "http://127.0.0.1:~A" port))))
|
||||||
|
|
|
||||||
1
run-render
Executable file
1
run-render
Executable file
|
|
@ -0,0 +1 @@
|
||||||
|
sbcl --eval "(ql:quickload :clog/tools)" --eval "(clog-tools:clog-builder :port 0 :app :batch :project $1)"
|
||||||
|
|
@ -155,8 +155,7 @@
|
||||||
(add-select-option (designtime-list panel) "" "Missing /tools")
|
(add-select-option (designtime-list panel) "" "Missing /tools")
|
||||||
(add-select-option (design-deps panel) "" "Missing /tools"))))
|
(add-select-option (design-deps panel) "" "Missing /tools"))))
|
||||||
(t
|
(t
|
||||||
(confirm-dialog panel "Load project?"
|
(flet ((load-proj (answer)
|
||||||
(lambda (answer)
|
|
||||||
(cond (answer
|
(cond (answer
|
||||||
(ql:quickload sel)
|
(ql:quickload sel)
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
|
|
@ -165,8 +164,17 @@
|
||||||
(projects-populate panel))
|
(projects-populate panel))
|
||||||
(t
|
(t
|
||||||
(setf (current-project app) nil)
|
(setf (current-project app) nil)
|
||||||
(setf (text-value (project-list panel)) "None"))))
|
(setf (text-value (project-list panel)) "None")))))
|
||||||
:title "System not loaded"))))))
|
(cond ((eq *app-mode* :batch)
|
||||||
|
(load-proj t)
|
||||||
|
(projects-rerender panel)
|
||||||
|
(clog:shutdown)
|
||||||
|
(uiop:quit))
|
||||||
|
(t
|
||||||
|
(confirm-dialog panel "Load project?"
|
||||||
|
(lambda (answer)
|
||||||
|
(load-proj answer))
|
||||||
|
:title "System not loaded")))))))))
|
||||||
|
|
||||||
(defun projects-add-dep (panel sys)
|
(defun projects-add-dep (panel sys)
|
||||||
(Input-dialog panel "Enter system name:"
|
(Input-dialog panel "Enter system name:"
|
||||||
|
|
|
||||||
|
|
@ -2685,8 +2685,11 @@ of controls and double click to select control."
|
||||||
|
|
||||||
(defun clog-builder (&key (port 8080) (start-browser t)
|
(defun clog-builder (&key (port 8080) (start-browser t)
|
||||||
app project static-root system)
|
app project static-root system)
|
||||||
"Start clog-builder. When port is 0 choose a random port. When app is
|
"Start clog-builder. When PORT is 0 choose a random port. When APP is
|
||||||
t, shutdown clog on termination of first window."
|
t, shutdown applicatoin on termination of first window. If APP eq :BATCH then
|
||||||
|
must specific default project :PROJECT and it will be batch rerendered
|
||||||
|
and shutdown application. You can set the specific STATIC-ROOT or set SYSTEM
|
||||||
|
to use that asdf system's static root."
|
||||||
(if project
|
(if project
|
||||||
(setf *start-project* (string-downcase (format nil "~A" project)))
|
(setf *start-project* (string-downcase (format nil "~A" project)))
|
||||||
(setf *start-project* nil))
|
(setf *start-project* nil))
|
||||||
|
|
@ -2694,7 +2697,7 @@ t, shutdown clog on termination of first window."
|
||||||
(setf static-root (merge-pathnames "./www/"
|
(setf static-root (merge-pathnames "./www/"
|
||||||
(asdf:system-source-directory system))))
|
(asdf:system-source-directory system))))
|
||||||
(when app
|
(when app
|
||||||
(setf *app-mode* t))
|
(setf *app-mode* app))
|
||||||
(when (eql port 0)
|
(when (eql port 0)
|
||||||
(setf port (clog-connection:random-port)))
|
(setf port (clog-connection:random-port)))
|
||||||
(if static-root
|
(if static-root
|
||||||
|
|
@ -2705,4 +2708,5 @@ t, shutdown clog on termination of first window."
|
||||||
(set-on-new-window 'on-attach-builder-page :path "/builder-page")
|
(set-on-new-window 'on-attach-builder-page :path "/builder-page")
|
||||||
(set-on-new-window 'on-convert-image :path "/image-to-data")
|
(set-on-new-window 'on-convert-image :path "/image-to-data")
|
||||||
(when start-browser
|
(when start-browser
|
||||||
|
(format t "If browser does not start go to http://127.0.0.1:~A/builder" port)
|
||||||
(open-browser :url (format nil "http://127.0.0.1:~A/builder" port))))
|
(open-browser :url (format nil "http://127.0.0.1:~A/builder" port))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue