mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
revisions
This commit is contained in:
parent
7b68d1c064
commit
e0c4d1c7f4
16 changed files with 65 additions and 73 deletions
|
|
@ -3,8 +3,10 @@
|
|||
:depends-on ()
|
||||
:components ((:file "lisp/package")
|
||||
(:file "lisp/ui-vars")
|
||||
#+mobile
|
||||
(:file "lisp/swank-quicklisp")
|
||||
(:file "lisp/eval")
|
||||
#+mobile
|
||||
(:file "lisp/qml-reload/auto-reload-mobile")
|
||||
(:file "lisp/curl")
|
||||
(:file "lisp/main")))
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@
|
|||
|
||||
(in-package :qml)
|
||||
|
||||
#+(or android ios)
|
||||
(defvar *reload-all* nil)
|
||||
(defvar *edited-file* nil)
|
||||
|
||||
#+(or android ios)
|
||||
(defun remote-ip ()
|
||||
(terpri *query-io*)
|
||||
(princ "Please enter WiFi IP of desktop computer (hit RET to skip): "
|
||||
|
|
@ -15,27 +13,20 @@
|
|||
(unless (x:empty-string ip)
|
||||
(format nil "http://~A:8080/" ip))))
|
||||
|
||||
#+(or android ios)
|
||||
(defvar *remote-ip* #+interpreter nil
|
||||
#-interpreter #.(remote-ip))
|
||||
|
||||
#+(or android ios)
|
||||
(defun load* (file)
|
||||
(load (make-string-input-stream (curl (x:cc *remote-ip* file)))))
|
||||
|
||||
(export 'load*)
|
||||
|
||||
#+(or android ios)
|
||||
(defun load-on-reloaded ()
|
||||
(load* "lisp/qml-reload/on-reloaded.lisp"))
|
||||
|
||||
#+(or android ios)
|
||||
(defun qml:view-status-changed (status)
|
||||
(when (and (= 1 status)
|
||||
(reload-main-p))
|
||||
(load-on-reloaded)))
|
||||
|
||||
#+(or android ios)
|
||||
(defun reload-main-p ()
|
||||
(prog1
|
||||
(or *reload-all*
|
||||
|
|
@ -43,7 +34,6 @@
|
|||
(when (eql :once *reload-all*)
|
||||
(setf *reload-all* nil))))
|
||||
|
||||
#+(or android ios)
|
||||
(let ((secs 0)
|
||||
(ini t))
|
||||
(defun auto-reload-qml ()
|
||||
|
|
@ -70,5 +60,6 @@
|
|||
(setf secs curr)))))
|
||||
(qsingle-shot 250 'auto-reload-qml)))
|
||||
|
||||
#+(or android ios)
|
||||
(export 'auto-reload-qml)
|
||||
(export
|
||||
(list 'load*
|
||||
'auto-reload-qml))
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
(in-package :qml)
|
||||
|
||||
#+(and (or android ios) (not interpreter))
|
||||
#-interpreter
|
||||
(ffi:clines "extern void init_lib_ASDF(cl_object);")
|
||||
|
||||
(defun %sym (symbol package)
|
||||
|
|
@ -10,14 +10,12 @@
|
|||
|
||||
;;; Quicklisp setup
|
||||
|
||||
#+(or android ios)
|
||||
(defun ensure-asdf ()
|
||||
(unless (find-package :asdf)
|
||||
(ffi:c-inline nil nil :void "ecl_init_module(NULL, init_lib_ASDF)" :one-liner t)
|
||||
(in-package :qml-user))
|
||||
:asdf)
|
||||
|
||||
#+(or android ios)
|
||||
(defun quicklisp ()
|
||||
(ensure-asdf)
|
||||
(unless (find-package :quicklisp)
|
||||
|
|
@ -36,7 +34,6 @@
|
|||
|
||||
;;; Swank setup
|
||||
|
||||
#+(or android ios)
|
||||
(defun swank/create-server (interface port dont-close style)
|
||||
(funcall (%sym 'create-server :swank)
|
||||
:interface interface
|
||||
|
|
@ -44,7 +41,6 @@
|
|||
:dont-close dont-close
|
||||
:style style))
|
||||
|
||||
#+(or android ios)
|
||||
(defun start-swank (&key (port 4005) (interface "0.0.0.0") (style :spawn)
|
||||
(load-contribs t) (setup t) (delete t) (quiet t)
|
||||
(dont-close t) log-events)
|
||||
|
|
@ -64,20 +60,17 @@
|
|||
"SLIME-listener"
|
||||
(lambda () (swank/create-server interface port dont-close style)))))
|
||||
|
||||
#+(or android ios)
|
||||
(defun stop-swank (&optional (port 4005))
|
||||
(when (find-package :swank)
|
||||
(funcall (%sym 'stop-server :swank) port)
|
||||
:stopped))
|
||||
|
||||
#+(or android ios)
|
||||
(progn
|
||||
;; be careful not to use :s, :q in your mobile app code
|
||||
;; ios simulator note: wrap :s and :q in qrun* (would crash otherwise)
|
||||
(define-symbol-macro :s (start-swank))
|
||||
(define-symbol-macro :q (quicklisp)))
|
||||
|
||||
#+(or android ios)
|
||||
(export (list #+ios
|
||||
'start-swank
|
||||
'stop-swank
|
||||
|
|
|
|||
|
|
@ -7,24 +7,27 @@
|
|||
(list "/ecl-android/" "/ecl-ios/")
|
||||
(list :android :ios)))
|
||||
|
||||
#+(or android ios)
|
||||
(pushnew :mobile *features*)
|
||||
|
||||
;;; copy Swank and ECL contrib files (mobile only)
|
||||
|
||||
(defun cc (&rest args)
|
||||
(apply 'concatenate 'string args))
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(defvar *assets* #+android "../platforms/android/assets/lib/"
|
||||
#+ios "../platforms/ios/assets/Library/")
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(defun find-swank ()
|
||||
(probe-file (cc *assets* "quicklisp/local-projects/slime/swank.lisp")))
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(defun shell (command)
|
||||
(ext:run-program "sh" (list "-c" command)))
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(progn
|
||||
(unless (find-swank)
|
||||
(let ((to (cc *assets* "quicklisp/local-projects/slime/")))
|
||||
|
|
@ -36,7 +39,7 @@
|
|||
(shell (cc "cp " lib "*.doc " *assets*))
|
||||
(shell (cc "cp -r " lib "encodings " *assets*)))))
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(unless (find-swank)
|
||||
(error "Swank files missing, please see <LQML root>/slime/src/readme-sources.md"))
|
||||
|
||||
|
|
@ -59,7 +62,7 @@
|
|||
(dolist (file (list "package" "x" "ecl-ext" "ini" "qml")) ; load LQML symbols
|
||||
(load (merge-pathnames file "src/lisp/")))
|
||||
|
||||
#-(or android ios)
|
||||
#-mobile
|
||||
(progn
|
||||
(require :ecl-curl)
|
||||
(asdf:make-build "app"
|
||||
|
|
@ -68,7 +71,7 @@
|
|||
:move-here (cc *current* "build/tmp/")
|
||||
:init-name "ini_app"))
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(progn
|
||||
(pushnew :interpreter *features*)
|
||||
(defvar *asdf-system* "app")
|
||||
|
|
@ -83,11 +86,11 @@
|
|||
|
||||
;;; rename lib
|
||||
|
||||
(let* ((from #-(or android ios) (cc *current* "build/tmp/app--all-systems.a")
|
||||
#+(or android ios) (cc *library-path* "app--all-systems.a"))
|
||||
(let* ((from #-mobile (cc *current* "build/tmp/app--all-systems.a")
|
||||
#+mobile (cc *library-path* "app--all-systems.a"))
|
||||
(to "libapp.a")
|
||||
(to* #-(or android ios) (cc *current* "build/tmp/" to)
|
||||
#+(or android ios) (cc *library-path* to)))
|
||||
(to* #-mobile (cc *current* "build/tmp/" to)
|
||||
#+mobile (cc *library-path* to)))
|
||||
(when (probe-file to*)
|
||||
(delete-file to*))
|
||||
(rename-file from to))
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ $ cd ..
|
|||
$ ./copy.sh advanced-qml-auto-reload
|
||||
```
|
||||
|
||||
See also [../../slime/src/readme-sources](../../slime/src/readme-sources.md) for
|
||||
installing the Slime sources where this example can find them.
|
||||
See also [../../slime/src/readme-sources](../../slime/src/readme-sources.md)
|
||||
for installing the Slime sources where this example can find them.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue