entry-point easy run from builder

This commit is contained in:
David Botton 2022-08-05 18:21:49 -04:00
parent 7fd0d6f844
commit dae94b56af
8 changed files with 67 additions and 35 deletions

View file

@ -4,6 +4,7 @@
:license "BSD"
:version "0.0.0"
:serial t
:entry-point "<%= (@ sys-name) %>:start-app"
:depends-on (#:clog) ; add clog plugins here as #:plugin for run time
:components ((:file "<%= (@ sys-name) %>")))

View file

@ -5,6 +5,7 @@
:version "0.0.0"
:serial t
:depends-on (#:clog)
:entry-point "<%= (@ sys-name) %>:start-test"
:components ((:file "<%= (@ sys-name) %>")))
(asdf:defsystem #:<%= (@ sys-name) %>/tools

View file

@ -4,6 +4,7 @@
:license "BSD"
:version "0.0.0"
:serial t
:entry-point "<%= (@ sys-name) %>:start-app"
:depends-on (#:clog) ; add clog plugins here as #:plugin for run time
:components ((:file "<%= (@ sys-name) %>")))

View file

@ -4,6 +4,7 @@
:license "BSD"
:version "0.0.0"
:serial t
:entry-point "<%= (@ sys-name) %>:start-app"
:depends-on (#:clog) ; add clog plugins here as #:plugin for run time
:components ((:file "<%= (@ sys-name) %>")))

View file

@ -4,6 +4,7 @@
:license "BSD"
:version "0.0.0"
:serial t
:entry-point "<%= (@ sys-name) %>:start-app"
:depends-on (#:clog) ; add clog plugins here as #:plugin for run time
:components ((:file "<%= (@ sys-name) %>")))

View file

@ -2573,6 +2573,25 @@ of controls and double click to select control."
:color-class "w3-green"
:time-out 3)))))
(defun projects-entry-point-change (panel)
(let* ((sys (text-value (project-list panel)))
(entry-point (text-value (entry-point panel)))
(fname (asdf:system-source-file (asdf:find-system sys)))
(sys-list '()))
(with-open-file (s fname)
(loop
(let* ((line (read s nil)))
(unless line (return))
(when (equalp (format nil "~A" (second line)) sys)
(if (getf line :entry-point)
(setf (getf line :entry-point) entry-point)
(setf line (append line `(:entry-point ,entry-point)))))
(push line sys-list))))
(with-open-file (s fname :direction :output :if-exists :rename)
(let ((*print-case* :downcase))
(dolist (n (reverse sys-list))
(pprint n s))))))
(defun projects-populate (panel)
(let ((app (connection-data-item panel "builder-app-data"))
(already (asdf/operate:already-loaded-systems))
@ -2582,6 +2601,7 @@ of controls and double click to select control."
(setf (inner-html (designtime-list panel)) "")
(setf (inner-html (runtime-deps panel)) "")
(setf (inner-html (design-deps panel)) "")
(setf (text-value (entry-point panel)) "")
(setf (disabledp (runtime-add-lisp panel)) t)
(setf (disabledp (runtime-delete panel)) t)
(setf (disabledp (designtime-add-lisp panel)) t)
@ -2592,7 +2612,8 @@ of controls and double click to select control."
(setf (disabledp (design-add-dep panel)) t)
(setf (disabledp (design-del-dep panel)) t)
(setf (disabledp (design-plugin panel)) t)
(setf (disabledp (entry-point panel)) t)
(setf (disabledp (run-button panel)) t)
(setf (current-project app) (if (equal sel "None")
nil
sel))
@ -2632,7 +2653,9 @@ of controls and double click to select control."
(setf (disabledp (runtime-del-dep panel)) nil)
(setf (disabledp (design-add-dep panel)) nil)
(setf (disabledp (design-del-dep panel)) nil)
(setf (disabledp (design-plugin panel)) nil))
(setf (disabledp (design-plugin panel)) nil)
(setf (disabledp (entry-point panel)) nil)
(setf (disabledp (run-button panel)) nil))
(t
(alert-toast panel "Warning" "Missing :defsystem-depends-on (:clog)"
:color-class "w3-yellow" :time-out 2))))

View file

@ -1,6 +1,6 @@
<data id="I3868715283" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="43" data-clog-title="projects"></data><label for="undefined" data-clog-type="label" data-clog-for="projects-list" data-clog-name="projects-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 6.99858px;">Current Project</label><select data-clog-type="dropdown" data-clog-name="project-list" style="box-sizing: content-box; position: absolute; left: 5px; top: 35px; width: 386.54px; height: 22px; bottom: 309.041px;" data-on-create="(projects-setup panel)" data-on-change="(projects-populate panel)"></select><button data-clog-type="button" data-clog-name="edit-asd" style="box-sizing: content-box; position: absolute; left: 400px; top: 32px; height: 22px; width: 90px;" data-on-click="(let ((sel (text-value (project-list panel))))
<data id="I3868724677" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="43" data-clog-title="projects"></data><label for="undefined" data-clog-type="label" data-clog-for="projects-list" data-clog-name="projects-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 6.99858px;">Current Project</label><select data-clog-type="dropdown" data-clog-name="project-list" style="box-sizing: content-box; position: absolute; left: 5px; top: 35px; width: 386.54px; height: 22px; bottom: 309.041px;" data-on-create="(projects-setup panel)" data-on-change="(projects-populate panel)"></select><button data-clog-type="button" data-clog-name="edit-asd" style="box-sizing: content-box; position: absolute; left: 400px; top: 32px; height: 22px; width: 90px;" data-on-click="(let ((sel (text-value (project-list panel))))
(on-open-file panel :open-file (asdf:system-source-file
(asdf:find-system sel))))">Edit .asd</button><label for="CLOGB386871257741" data-clog-type="label" data-clog-for="entry-point" data-clog-name="entry-point-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 69px;">Entry Point - package:function</label><input type="TEXT" value="" data-clog-type="input" data-clog-name="entry-point" style="box-sizing: content-box; position: absolute; left: 5px; top: 94px; width: 381px; height: 22.5px;" readonly="readonly"><button data-clog-type="button" data-clog-name="run-button" style="box-sizing: content-box; position: absolute; left: 400px; top: 92px; width: 90px; height: 22.5px;" data-on-click="(projects-run panel)">Run</button><button data-clog-type="button" data-clog-name="new-project-button" style="box-sizing: content-box; position: absolute; left: 520px; top: 8px; width: 100px; height: 22px;" data-on-click="(on-new-app-template panel)">New</button><button data-clog-type="button" data-clog-name="unload-project-button" style="box-sizing: content-box; position: absolute; left: 520px; top: 43px; width: 100px; height: 22px; bottom: 309.041px;" data-on-click="(let ((sel (text-value (project-list panel))))
(asdf:find-system sel))))">Edit .asd</button><label for="CLOGB386871257741" data-clog-type="label" data-clog-for="entry-point" data-clog-name="entry-point-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 69px;">Entry Point - package:function</label><input type="TEXT" value="" data-clog-type="input" data-clog-name="entry-point" style="box-sizing: content-box; position: absolute; left: 5px; top: 94px; width: 381px; height: 22.5px;" data-on-change="(projects-entry-point-change panel)"><button data-clog-type="button" data-clog-name="run-button" style="box-sizing: content-box; position: absolute; left: 400px; top: 92px; width: 90px; height: 22.5px;" data-on-click="(projects-run panel)">Run</button><button data-clog-type="button" data-clog-name="new-project-button" style="box-sizing: content-box; position: absolute; left: 520px; top: 8px; width: 100px; height: 22px;" data-on-click="(on-new-app-template panel)">New</button><button data-clog-type="button" data-clog-name="unload-project-button" style="box-sizing: content-box; position: absolute; left: 520px; top: 43px; width: 100px; height: 22px; bottom: 309.041px;" data-on-click="(let ((sel (text-value (project-list panel))))
(asdf:clear-system sel)
(setf (text-value (project-list panel)) &quot;None&quot;)
(projects-populate panel))">Unload</button><button data-clog-type="button" data-clog-name="reload-project-button" style="box-sizing: content-box; position: absolute; left: 521px; top: 79px; width: 100px; height: 22px; bottom: 309.041px;" data-on-click="(let ((sel (text-value (project-list panel))))

File diff suppressed because one or more lines are too long