-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
173 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
;;;; cmds/core/install.lisp --- Build executable | ||
|
||
;;; Commentary | ||
;; | ||
;; The `install' command definition. | ||
;; | ||
|
||
;;; Code | ||
|
||
(defpackage qob/install | ||
(:use cl) | ||
(:export command)) | ||
|
||
(in-package :qob/install) | ||
|
||
(defun options () | ||
"Options for `install' command." | ||
(list )) | ||
|
||
(defun handler (cmd) | ||
"Handler for `list' command." | ||
(declare (ignore cmd)) | ||
(qob:call-lisp "core/install")) | ||
|
||
(defun command () | ||
"List command." | ||
(clingon:make-command | ||
:name "install" | ||
:description "Install packages" | ||
:usage "[names..]" | ||
:options (options) | ||
:handler #'handler)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
;;; _prepare.el --- Prepare for command tasks | ||
;;; Commentary: Prepare to setup Qob environment for sandboxing | ||
;;; Code: | ||
|
||
(format t "Preparing...") | ||
|
||
(defmacro qob-start (&rest body) | ||
"Execute BODY with workspace setup." | ||
(declare (indent 0) (debug t))) | ||
|
||
(defun setup () | ||
"Setup the system." | ||
(let ((files (asd-files t))) | ||
(mapc (lambda (file) | ||
(load-system file) | ||
(-info "Load ASD file ~A" file)) | ||
files))) | ||
|
||
(defun load-system (filename) | ||
"Load the system from ASD's FILENAME; and return the registered name." | ||
(let ((dir (uiop:pathname-parent-directory-pathname filename)) | ||
(file (pathname-name filename))) | ||
(push dir asdf:*central-registry*) | ||
(asdf:load-system file) | ||
file)) ; registered name | ||
|
||
(defun find-system (name) | ||
"Return a system of given NAME." | ||
(asdf/system-registry:registered-system name)) | ||
|
||
(defun asd-files (&optional with-test) | ||
"Return a list of ASD files. | ||
If optional argument WITH-TEST is non-nil; include test ASD files as well." | ||
(uiop:if-let ((files (directory "*.asd")) | ||
(_ (not with-test)) | ||
(tests (asd-test-files))) | ||
(remove-if (lambda (filename) (el-lib:el-memq filename tests)) files) | ||
files)) | ||
|
||
(defun asd-test-files () | ||
"Return a list of ASD test files." | ||
(directory "*-test*.asd")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
;;;; lisp/core/build.lisp --- Build executable | ||
|
||
;;; Commentary | ||
;; | ||
;; Command use to build the executable | ||
;; | ||
;; $ qob build | ||
;; | ||
;; | ||
;; Optional arguments: | ||
;; | ||
;; --name, -n path to the ASD file | ||
;; --output, -o output directory | ||
;; | ||
|
||
;;; Code | ||
|
||
(qob-start | ||
(let* ((name (clingon:getopt cmd :name)) | ||
(output (clingon:getopt cmd :output))) | ||
;; Delete if exists to prevent errors. | ||
(when (uiop:file-exists-p output) | ||
(delete-file output)) | ||
;; TODO: Change build path. | ||
(qob:setup) | ||
(asdf:operate :build-op name))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
;;;; lisp/core/install.lisp --- Build executable | ||
|
||
;;; Commentary | ||
;; | ||
;; Command use to install packages, | ||
;; | ||
;; $ qob install [names..] | ||
;; | ||
;; | ||
;; Optional arguments: | ||
;; | ||
;; [names..] name of the package(s) to install | ||
;; | ||
|
||
;;; Code | ||
|
||
(format t "Installlllll") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
;;;; lisp/core/list.lisp --- Build executable | ||
|
||
;;; Commentary | ||
;; | ||
;; Command use to list the registered system | ||
;; | ||
;; $ qob list | ||
;; | ||
|
||
;;; Code | ||
|
||
(format t "Listing...") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters