mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-05 18:20:33 -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.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
(list "/ecl-android/" "/ecl-ios/")
|
||||
(list :android :ios)))
|
||||
|
||||
#+(or android ios)
|
||||
(pushnew :mobile *features*)
|
||||
|
||||
(require :asdf)
|
||||
|
||||
(push (merge-pathnames "../")
|
||||
|
|
@ -26,14 +29,14 @@
|
|||
(defun cc (&rest args)
|
||||
(apply 'concatenate 'string args))
|
||||
|
||||
#-(or android ios)
|
||||
#-mobile
|
||||
(asdf:make-build "app"
|
||||
:monolithic t
|
||||
:type :static-library
|
||||
:move-here (cc *current* "build/tmp/")
|
||||
:init-name "ini_app")
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(progn
|
||||
(pushnew :interpreter *features*)
|
||||
(defvar *asdf-system* "app")
|
||||
|
|
@ -47,11 +50,11 @@
|
|||
(load "platforms/shared/make"))
|
||||
|
||||
;; 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))
|
||||
|
|
|
|||
|
|
@ -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,7 +2,6 @@
|
|||
|
||||
(in-package :qml)
|
||||
|
||||
#+(or android ios)
|
||||
(defun remote-ip ()
|
||||
(terpri *query-io*)
|
||||
(princ "Please enter WiFi IP of desktop computer (hit RET to skip): "
|
||||
|
|
@ -11,22 +10,16 @@
|
|||
(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 qml:view-status-changed (status)
|
||||
(when (= 1 status)
|
||||
(load* "lisp/qml-reload/on-reloaded.lisp")))
|
||||
|
||||
#+(or android ios)
|
||||
(let ((secs 0)
|
||||
(ini t))
|
||||
(defun auto-reload-qml ()
|
||||
|
|
@ -45,5 +38,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
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#:*flick-output*
|
||||
#:*history-back*
|
||||
#:*history-forward*
|
||||
#:*main*
|
||||
#:*progress*
|
||||
#:*repl-input*
|
||||
#:*repl-output*
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
(defparameter *flick-output* "flick_output")
|
||||
(defparameter *history-back* "history_back")
|
||||
(defparameter *history-forward* "history_forward")
|
||||
(defparameter *main* "main")
|
||||
(defparameter *progress* "progress")
|
||||
(defparameter *repl-input* "repl_input")
|
||||
(defparameter *repl-output* "repl_output")
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import "ext/" as Ext
|
|||
Item {
|
||||
width: 300
|
||||
height: 500
|
||||
objectName: "main"
|
||||
|
||||
Ext.Repl {}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@
|
|||
|
||||
(setf *features* (remove :interpreter *features*))
|
||||
|
||||
#+(or android ios)
|
||||
(load (merge-pathnames (format nil "platforms/~A/cross-compile"
|
||||
#+android "android"
|
||||
#+ios "ios")))
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Info
|
|||
|
||||
This is meant for the Swank server on mobile.
|
||||
|
||||
Please donwload latest [Slime sources](https://github.com/slime/slime/releases)
|
||||
Please download latest [Slime sources](https://github.com/slime/slime/releases)
|
||||
and put them in this directory, that is, put the contents of `slime-x.x/`
|
||||
in this directory.
|
||||
|
||||
|
|
|
|||
|
|
@ -239,6 +239,9 @@
|
|||
;;; mobile ini
|
||||
|
||||
#+(or android ios)
|
||||
(pushnew :mobile *features*)
|
||||
|
||||
#+mobile
|
||||
(defvar *assets* #+android "assets:/lib/"
|
||||
#+ios "assets/")
|
||||
|
||||
|
|
@ -263,7 +266,7 @@
|
|||
(ext:setenv (car el) (namestring (merge-pathnames (cdr el)
|
||||
(user-homedir-pathname))))))
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(defun copy-asset-files (&optional (dir-name *assets*) origin)
|
||||
"Copy asset files to home directory."
|
||||
(flet ((directory-p (path)
|
||||
|
|
@ -290,7 +293,7 @@
|
|||
(return-from copy-asset-files))))))
|
||||
t)
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(defun %ini-mobile ()
|
||||
;; internal use, see 'main.cpp'
|
||||
(ext:install-bytecodes-compiler)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
(list "/ecl-android/" "/ecl-ios/")
|
||||
(list :android :ios)))
|
||||
|
||||
#+(or android ios)
|
||||
(pushnew :mobile *features*)
|
||||
|
||||
;;; compile ASDF system
|
||||
|
||||
(require :asdf)
|
||||
|
|
@ -17,7 +20,7 @@
|
|||
(setf *default-pathname-defaults*
|
||||
(merge-pathnames "../../")) ; LQML root
|
||||
|
||||
#-(or android ios)
|
||||
#-mobile
|
||||
(asdf:make-build "lqml"
|
||||
:monolithic t
|
||||
:type :static-library
|
||||
|
|
@ -26,7 +29,7 @@
|
|||
#+darwin "macos")
|
||||
:init-name "ini_LQML")
|
||||
|
||||
#+(or android ios)
|
||||
#+mobile
|
||||
(progn
|
||||
(pushnew :interpreter *features*)
|
||||
(defvar *asdf-system* "lqml")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue