Implementation of a utility to package ASDF systems in jars.

The recursive dependencies are just recorded, not packaged.
parent 875535e7
;;;; -*- Mode: LISP -*-
(in-package :Asdf)
(defsystem :asdf-jar
:author "Mark Evenson"
:version "0.1.0"
((:module base :pathname "" :components
((:file "asdf-jar")))))
\ No newline at end of file
(defpackage :asdf-jar
(:use :cl)
(:export #:package))
(in-package :asdf-jar)
(defvar *systems*)
(defmethod asdf:perform :before ((op asdf:compile-op) (c asdf:system))
(push c *systems*))
(defun package (system-name &key (recursive t) (verbose t))
(declare (ignore recursive))
(let* ((system (asdf:find-system system-name))
(name (slot-value system 'asdf::name)))
(when verbose
(format verbose "Packaging ASDF definition of~A~%" system))
(setf *systems* nil)
(asdf:compile-system system :force t)
(let* ((dir (asdf:component-pathname system))
(wild-contents (merge-pathnames "**/*" dir))
(contents (directory wild-contents))
(output (format nil "/var/tmp/~A.jar" name))
(topdir (truename (merge-pathnames "../" dir))))
(when verbose
(format verbose "Packaging contents in ~A.~%" output))
(system:zip output contents topdir)))
(defun init-test ()
(require :quicklisp)
(ql:quickload :cl-ppcre))
(defun package-test ()
(package :cl-ppcre))
(defun load-test ()
(push "jar:file:/var/tmp/cl-ppcre.jar!/cl-ppcre-2.0.3/"
(setf asdf::*verbose-out* t)
(asdf:load-system :cl-ppcre))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment