Last change
on this file since 13308 was
13308,
checked in by Mark Evenson, 11 years ago
|
Implementation of a utility to package ASDF systems in jars.
The recursive dependencies are just recorded, not packaged.
|
File size:
991 bytes
|
Rev | Line | |
---|
[13308] | 1 | (defpackage :asdf-jar |
---|
| 2 | (:use :cl) |
---|
| 3 | (:export #:package)) |
---|
| 4 | |
---|
| 5 | (in-package :asdf-jar) |
---|
| 6 | |
---|
| 7 | (defvar *systems*) |
---|
| 8 | (defmethod asdf:perform :before ((op asdf:compile-op) (c asdf:system)) |
---|
| 9 | (push c *systems*)) |
---|
| 10 | |
---|
| 11 | (defun package (system-name &key (recursive t) (verbose t)) |
---|
| 12 | (declare (ignore recursive)) |
---|
| 13 | (asdf:disable-output-translations) |
---|
| 14 | (let* ((system (asdf:find-system system-name)) |
---|
| 15 | (name (slot-value system 'asdf::name))) |
---|
| 16 | (when verbose |
---|
| 17 | (format verbose "Packaging ASDF definition of~A~%" system)) |
---|
| 18 | (setf *systems* nil) |
---|
| 19 | (asdf:compile-system system :force t) |
---|
| 20 | (let* ((dir (asdf:component-pathname system)) |
---|
| 21 | (wild-contents (merge-pathnames "**/*" dir)) |
---|
| 22 | (contents (directory wild-contents)) |
---|
| 23 | (output (format nil "/var/tmp/~A.jar" name)) |
---|
| 24 | (topdir (truename (merge-pathnames "../" dir)))) |
---|
| 25 | (when verbose |
---|
| 26 | (format verbose "Packaging contents in ~A.~%" output)) |
---|
| 27 | (system:zip output contents topdir))) |
---|
| 28 | (asdf:initialize-output-translations)) |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.