Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY web web
COPY t t
COPY src src
COPY lisp-inference.asd .
COPY *.lisp .
COPY scripts scripts
RUN ros install ./lisp-inference.asd
RUN ros run -s lisp-inference/web -q
EXPOSE 40000
Expand Down
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SBCL_CMD := sbcl --noinform --disable-debugger --load
SBCL_CMD := sbcl --noinform --disable-debugger --load scripts/fix-quicklisp.lisp --load
OBJECTS := lisp-inference
DOCKER_IMG = lisp-inference
VERSION := latest
Expand All @@ -8,23 +8,23 @@ all: $(OBJECTS)


$(OBJECTS): src/*.lisp
$(SBCL_CMD) build.lisp
$(SBCL_CMD) scripts/build.lisp


check:
@$(SBCL_CMD) run-test.lisp
@$(SBCL_CMD) scripts/run-test.lisp


server:
@$(SBCL_CMD) run-server.lisp
@$(SBCL_CMD) scripts/run-server.lisp

docs-worktree:
@if [ ! -d docs ]; then \
git worktree add docs gh-pages -f; \
fi

docs: docs-worktree
@$(SBCL_CMD) run-docs.lisp
@$(SBCL_CMD) scripts/run-docs.lisp

docs-publish:
cd docs/ && git add . && git commit -m "Auto-generated commit from make docs-publish" && git push || true
Expand All @@ -39,10 +39,13 @@ docker-run: docker-build
docker run --rm -it --network=host $(DOCKER_IMG)

docker-docs: docker-build docs-worktree
docker run --rm -t -v $(PWD)/docs:/root/.roswell/local-projects/local/lisp-inference/docs --entrypoint=ros $(DOCKER_IMG) run -l run-docs.lisp
docker run --rm -t \
-v $(PWD)/docs:/root/.roswell/local-projects/local/lisp-inference/docs \
--entrypoint=ros $(DOCKER_IMG) \
run -l scripts/fix-quicklisp.lisp -l run-docs.lisp

docker-check: docker-build
docker run --rm -t --entrypoint=ros $(DOCKER_IMG) run -l run-test.lisp
docker run --rm -t --entrypoint=ros $(DOCKER_IMG) run -l scripts/fix-quicklisp.lisp -l scripts/run-test.lisp

docker-publish: docker-build
docker tag $(DOCKER_IMG) $(PUBLIC_IMG)
Expand Down
26 changes: 16 additions & 10 deletions lisp-inference.asd
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
;; -*- mode: lisp -*-
;; Manoel Vilela


;;;; lisp-inference.asd

(defpackage :lisp-inference/system
(:use :cl :uiop :asdf))

(in-package :lisp-inference/system)

(defun get-all-test-files ()
(mapcar #'(lambda (p) (list :file (pathname-name p)))
(directory-files (system-relative-pathname :lisp-inference "t/")
"*test*.lisp")))

(asdf:defsystem #:lisp-inference

(defsystem #:lisp-inference
:description "An Inference Engine using Propositional Calculus"
:author "Manoel Vilela <manoel_vilela@engineer.com>"
:license "BSD"
Expand All @@ -23,7 +34,7 @@
(:file "truth-table"
:depends-on ("pratt" "parser" "operators" "equivalences"))))

(asdf:defsystem #:lisp-inference/web
(defsystem #:lisp-inference/web
:description "An web interface for Lisp Inference Truth Table"
:author "Manoel Vilela <manoel_vilela@engineer.com>"
:license "BSD"
Expand All @@ -41,20 +52,15 @@
:pathname "web"
:components ((:file "webapp")))

(asdf:defsystem #:lisp-inference/tests
(defsystem #:lisp-inference/tests
:description "Lisp Inference Tests"
:author "Manoel Vilela <manoel_vilela@engineer.com>"
:license "BSD"
:version "0.4.0"
:homepage "https://github.com/ryukinix/lisp-inference"
:serial t
:pathname "t"
:depends-on (:lisp-inference :rove)
:components ((:file "tests")
(:file "test-equivalence-rules")
(:file "test-inference-rules")
(:file "test-infix-parsing")
(:file "test-truth-table")
(:file "test-pratt"))
:pathname "t"
:components #.(get-all-test-files)
:perform (test-op (o c)
(symbol-call :rove :run c)))
1 change: 0 additions & 1 deletion build.lisp → scripts/build.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(load "fix-quicklisp")
(ql:quickload :prove)
(ql:quickload :lisp-inference)
(in-package :lisp-inference)
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion run-docs.lisp → scripts/run-docs.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(load "fix-quicklisp")
;; auto generate docs with staple
(ql:quickload '(:staple :lisp-inference :lisp-inference/tests :lisp-inference/web) :silent t)

Expand Down
1 change: 0 additions & 1 deletion run-server.lisp → scripts/run-server.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(load "fix-quicklisp")
(ql:quickload :lisp-inference/web)
(webapp:start)
(loop do
Expand Down
1 change: 0 additions & 1 deletion run-test.lisp → scripts/run-test.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
(load "fix-quicklisp")
(ql:quickload :lisp-inference/tests :silent t)

(defun rove/utils/reporter::print-source-location-as-file-path (stream file line column)
Expand Down
5 changes: 5 additions & 0 deletions t/test-equivalence-rules.lisp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
(defpackage #:lisp-inference/tests/test-equivalence-rules
(:use #:cl
#:lisp-inference
#:rove))

(in-package #:lisp-inference/tests/test-equivalence-rules)

(deftest test-equivalence-rules
Expand Down
5 changes: 5 additions & 0 deletions t/test-inference-rules.lisp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
(defpackage #:lisp-inference/tests/test-inference-rules
(:use #:cl
#:lisp-inference
#:rove))

(in-package #:lisp-inference/tests/test-inference-rules)


Expand Down
5 changes: 5 additions & 0 deletions t/test-infix-parsing.lisp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
(defpackage #:lisp-inference/tests/test-infix-parsing
(:use #:cl
#:lisp-inference
#:rove))

(in-package #:lisp-inference/tests/test-infix-parsing)

;; deprecated in favor of pratt parser
Expand Down
6 changes: 6 additions & 0 deletions t/test-pratt.lisp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
(defpackage #:lisp-inference/tests/test-pratt
(:use #:cl
#:lisp-inference
#:rove))


(in-package #:lisp-inference/tests/test-pratt)

(deftest test-pratt
Expand Down
6 changes: 6 additions & 0 deletions t/test-truth-table.lisp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
(defpackage #:lisp-inference/tests/test-truth-table
(:use #:cl
#:lisp-inference
#:rove))


(in-package :lisp-inference/tests/test-truth-table)

(deftest truth-table-tests
Expand Down
32 changes: 0 additions & 32 deletions t/tests.lisp

This file was deleted.