summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2020-09-09 10:49:11 -0500
committerColin Okay <cbeok@protonmail.com>2020-10-12 09:37:43 -0500
commit5f167f7ae1c464df220913ed1a9c2105dc1ada3e (patch)
tree7bca183be22bf2aa75b1f49b186fa4bf33a9c684
parentd02e04ba90cf2e431b34b578c6bcade60ed7c18e (diff)
added system for cli tool
But the ecl build doesn't work...
-rw-r--r--build.lisp34
-rw-r--r--imbricate-run.asd9
-rw-r--r--imbricate.asd2
-rw-r--r--run.lisp33
4 files changed, 56 insertions, 22 deletions
diff --git a/build.lisp b/build.lisp
index 9e98804..4552239 100644
--- a/build.lisp
+++ b/build.lisp
@@ -1,29 +1,21 @@
-(ql:quickload :imbricate)
-
-(defpackage #:imbricate.run
- (:use #:cl))
-
-(in-package :imbricate.run)
-
-(defun print-help ()
- (format t "USAGE: imbricate SOURCE-DIR TARGET-DIR SHEET-TITLE~%~%")
- (format t " SOURCE-DIR a directory containing png files. Non png files are skipped~%")
- (format t " TARGET-DIR a directory where the tilesheet is to be built.~%")
- (format t " SHEET-TITLE a name used for this sheet and its meta info~%~%"))
+(ql:register-local-projects)
+(dolist (dir ql:*local-project-directories*)
+ (push dir asdf:*central-registry*))
+(ql:quickload :imbricate-run)
#+sbcl
-(progn
- (defun main ()
- (unless (= 4 (length sb-ext:*posix-argv*))
- (print-help)
- (uiop:quit))
- (destructuring-bind (src target title) (cdr sb-ext:*posix-argv*)
- (imbricate:imbricate-and-save src target title)
- (uiop:quit)))
+(progn
+ (sb-ext:save-lisp-and-die #p"imbricate" :toplevel #'imbricate.run:main :executable t :compression t))
- (sb-ext:save-lisp-and-die #p"imbricate" :toplevel #'main :executable t :compression t))
+#+ecl
+(progn
+ (asdf:make-build :imbricate-run
+ :type :program
+ :move-here #P"./"
+ :epilogue-code '(imbricate.run:main))
+ (ext:exit))
diff --git a/imbricate-run.asd b/imbricate-run.asd
new file mode 100644
index 0000000..c017655
--- /dev/null
+++ b/imbricate-run.asd
@@ -0,0 +1,9 @@
+
+(asdf:defsystem #:imbricate-run
+ :description "cli tool for imbricate"
+ :author "colin okay <cbeok@protonmail.com>"
+ :license "AGPL-3.0"
+ :version "0.1.0"
+ :serial t
+ :depends-on ( #:asdf #:imbricate )
+ :components ((:file "run")))
diff --git a/imbricate.asd b/imbricate.asd
index a98ab0b..472579f 100644
--- a/imbricate.asd
+++ b/imbricate.asd
@@ -6,5 +6,5 @@
:license "AGPL-3.0"
:version "0.1.0"
:serial t
- :depends-on ( #:opticl #:uiop )
+ :depends-on (#:asdf #:uiop #:opticl)
:components ((:file "imbricate")))
diff --git a/run.lisp b/run.lisp
new file mode 100644
index 0000000..8eeb603
--- /dev/null
+++ b/run.lisp
@@ -0,0 +1,33 @@
+
+(defpackage #:imbricate.run
+ (:use #:cl)
+ (:export #:main))
+
+(in-package :imbricate.run)
+
+(defun print-help ()
+ (format t "USAGE: imbricate SOURCE-DIR TARGET-DIR SHEET-TITLE~%~%")
+ (format t " SOURCE-DIR a directory containing png files. Non png files are skipped~%")
+ (format t " TARGET-DIR a directory where the tilesheet is to be built.~%")
+ (format t " SHEET-TITLE a name used for this sheet and its meta info~%~%"))
+
+#+ecl
+(defun main ()
+ (print (ext:command-args)))
+ ;; (unless (= 4 (length (ext:command-args)))
+ ;; (print-help)
+ ;; (ext:quit))
+ ;; (destructuring-bind (src target title) (cdr (ext:command-args))
+ ;; (imbricate:imbricate-and-save src target title)
+ ;; (ext:quit)))
+
+#+sbcl
+(defun main ()
+ (unless (= 4 (length sb-ext:*posix-argv*))
+ (print-help)
+ (uiop:quit))
+ (destructuring-bind (src target title) (cdr sb-ext:*posix-argv*)
+ (imbricate:imbricate-and-save src target title)
+ (uiop:quit)))
+
+