Changeset 13350


Ignore:
Timestamp:
06/20/11 14:37:10 (10 years ago)
Author:
Mark Evenson
Message:

Document the use of the ASDF-JAR contrib.

ASDF:ADD-TO-ASDF provides a mechanism to add the contents of a
pathname specifying an jar package to be subequently loaded by ASDF.

Generalize mechanism to specifiy contrib contents while including
"README.markdown" files.

Location:
trunk/abcl
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build.xml

    r13317 r13350  
    470470    </target>
    471471
     472    <patternset id="abcl.contrib.source">
     473          <include name="**/*.asd"/>
     474          <include name="**/*.lisp"/>
     475          <include name="**/README.markdown"/>
     476    </patternset>
     477
    472478    <property name="abcl-contrib.jar"
    473479              value="${dist.dir}/abcl-contrib.jar"/>
     
    475481      <uptodate targetfile="${abcl-contrib.jar}">
    476482        <srcfiles dir="contrib">
    477           <include name="**/*.asd"/>
    478           <include name="**/*.lisp"/>
     483          <patternset refid="abcl.contrib.source"/>
    479484        </srcfiles>
    480485      </uptodate>
     
    485490           compress="true"
    486491           basedir="contrib">
    487         <patternset>
    488           <include name="**/*.asd"/>
    489           <include name="**/*.lisp"/>
    490         </patternset>
     492        <patternset refid="abcl.contrib.source"/>
    491493      </jar>
    492494      <echo>
  • trunk/abcl/contrib/asdf-jar/asdf-jar.asd

    r13348 r13350  
    77  :components
    88  ((:module base :pathname "" :components
    9       ((:file "asdf-jar")))))
     9      ((:file "asdf-jar")
     10             (:static-file "README.markdown))))
  • trunk/abcl/contrib/asdf-jar/asdf-jar.lisp

    r13348 r13350  
     1;;; This file is part of ABCL contrib
     2;;;
     3;;; Copyright 2011 Mark <evenson@panix.com>
     4
    15(defpackage #:asdf-jar
    26  (:use :cl)
    3   (:export #:package))
     7  (:export #:package
     8           #:add-to-asdf))
    49
    510(in-package :asdf-jar)
     
    1015                &key (out #p"/var/tmp/")
    1116                     (recursive t)          ; whether to package dependencies
    12                      (force nil)              ; whether to force ASDF compilation
     17                     (force nil)             ; whether to force ASDF compilation
    1318                     (verbose t))
    1419"Compile and package the asdf SYSTEM-NAME in a jar.
     
    1722dependencies into the same jar.
    1823
    19 Place the resulting packaging in the OUT directory.
     24Place the resulting packaged jar in the OUT directory.
    2025
    21 Returns the pathname of the created jar archive.
     26If FORCE is true, force asdf to recompile all the necessary fasls.
     27
     28Returns the pathname of the packaged jar archive.
    2229"
    2330  (let* ((system
     
    107114                       (list name)))))
    108115
     116(defun add-to-asdf (jar &key (use-jar-fasls t))
     117  "Make a given JAR output by the package mechanism loadable by asdf.
     118
     119The parameter passed to :USE-JAR-FASLS determines whether to instruct
     120asdf to use the fasls packaged in the jar.  If this is nil, the fasls
     121will be compiled with respect to the ususual asdf output translation
     122conventions."
     123  (when (not (typep jar 'pathname))
     124    (setf jar (pathname jar)))
     125  (when (null (pathname-device jar))
     126    (setf jar (make-pathname :device (list jar))))
     127
     128  ;;; Inform ASDF of all the system definitions in the jar
     129  (loop :for asd
     130     :in (directory (merge-pathnames "*/*.asd" jar))
     131     :do (pushnew (make-pathname :defaults asd
     132                                 :name nil :type nil)
     133                  asdf:*central-registry*))
     134
     135  ;;; Load the FASLs directly from the jar
     136  (when use-jar-fasls                   
     137    (asdf:initialize-output-translations
     138     `(:output-translations (,(merge-pathnames "/**/*.*" jar))
     139                            :inherit-configuration))))
    109140
    110141
Note: See TracChangeset for help on using the changeset viewer.