From a6aa93a7b465b229f5b1c54602f15326913c17b2 Mon Sep 17 00:00:00 2001 From: Bohdan Sokolovskyi Date: Thu, 4 Feb 2021 22:25:51 +0200 Subject: [PATCH] update gitignore, add options to makefile, update make-image, update asd file, fix some errors in code --- .gitignore | 2 +- make-image.lisp | 15 ++++++++++-- makefile | 23 +++++++++++++++---- nobot/botscript/parser/acacia.lisp | 6 ++--- .../parser/acacia/result-packaging.lisp | 12 +++++----- nobot/nobot.asd | 9 ++++---- 6 files changed, 45 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index e5473a5..be19fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ \'#* .DS_Store \#* -nobot-app +release/ diff --git a/make-image.lisp b/make-image.lisp index f7b6863..a30646b 100644 --- a/make-image.lisp +++ b/make-image.lisp @@ -6,9 +6,20 @@ (load "nobot/nobot.asd") (asdf:load-system :nobot) +;; application parameters +(defparameter *nobot-application-name* "nobot") +(defparameter *nobot-version* "0.1") +(defparameter *nobot-spec-name* "mega-trash") + ;; make image -(sb-ext:save-lisp-and-die - #p "nobot-app" +(sb-ext:save-lisp-and-die + (make-pathname + :directory '(:relative "release") + :name (format nil "~a-~a-~a" + *nobot-application-name* + *nobot-version* + *nobot-spec-name*) + :type "bin") :toplevel #'nobot/startup:*run* :save-runtime-options t :executable t) diff --git a/makefile b/makefile index 43b7385..6fdd3f2 100644 --- a/makefile +++ b/makefile @@ -1,13 +1,26 @@ # Copyright (c) 2021 Bohdan Sokolovskyi # Author: Bohdan Sokolovskyi +# config variables +project-dir=nobot/ +SHELL=/bin/bash + .PHONY: clean -project-dir=nobot/ +all: build install + +build: clean + mkdir release + sbcl --disable-debugger \ + --load make-image.lisp + +help: + @echo "all build help install uninstall clean" + +install: -build: - sbcl --load make-image.lisp +uninstall: clean: - rm nobot-app || : - (find $(project-dir) -name '*.fasl' -print0 | xargs -0 rm ||:) + (rm -rf release || :) + (find $(project-dir) -name '*.fasl' -print0 | xargs -0 rm || :) diff --git a/nobot/botscript/parser/acacia.lisp b/nobot/botscript/parser/acacia.lisp index 38a1c67..4cf9880 100644 --- a/nobot/botscript/parser/acacia.lisp +++ b/nobot/botscript/parser/acacia.lisp @@ -26,6 +26,6 @@ #:define-rule #:pack-parse-tree #:acacia-packed-result - #:get-parse-tree - #:get-source-type - #:get-source)) + #:acacia-get-parse-tree + #:acacia-get-source-type + #:acacia-get-source)) diff --git a/nobot/botscript/parser/acacia/result-packaging.lisp b/nobot/botscript/parser/acacia/result-packaging.lisp index c83e2ea..5ef7a31 100644 --- a/nobot/botscript/parser/acacia/result-packaging.lisp +++ b/nobot/botscript/parser/acacia/result-packaging.lisp @@ -6,9 +6,9 @@ (:use :cl) (:export #:pack-parse-tree #:acacia-packed-result - #:get-parse-tree - #:get-source-type - #:get-source)) + #:acacia-get-parse-tree + #:acacia-get-source-type + #:acacia-get-source)) (in-package :nobot/botscript/parser/acacia/result-packaging) @@ -16,15 +16,15 @@ ((parse-tree :type list :initarg :parse-tree - :reader get-parse-tree) + :reader acacia-get-parse-tree) (source-type :type keyword :initarg :source-type - :reader get-source-type) + :reader acacia-get-source-type) (source :type string :initarg :source - :reader get-source))) + :reader acacia-get-source))) (defmethod initialize-instance :around ((res acacia-packed-result) &key parse-tree source-type diff --git a/nobot/nobot.asd b/nobot/nobot.asd index be8795c..36d1f46 100644 --- a/nobot/nobot.asd +++ b/nobot/nobot.asd @@ -2,11 +2,11 @@ ;;;; Author: Bohdan Sokolovskyi -(asdf:defsystem "nobot" +(asdf:defsystem :nobot :class :package-inferred-system :defsystem-depends-on (:asdf-package-system) :description "Engine for creating chat bots" - :version "1.0" + :version "0.1" :author "Sokolovskyi Bohdan" :depends-on ("nobot/startup" "nobot/toplevel" @@ -24,6 +24,5 @@ "cl-ppcre" "unix-opts" "yason") - :in-order-to ((test-op (load-op "nobot/tests"))) - ;;TODO: change to rewd from string + eval, or another solution - :perform (test-op (o c) (uiop:symbol-call :nobot/tests :run-unit-tests))) + :in-order-to ((asdf:test-op (asdf:load-op :nobot/tests))) + :perform (asdf:test-op (o c) (uiop:symbol-call :nobot/tests :run-unit-tests)))