Skip to content
Snippets Groups Projects
asdf.lisp 113 KiB
Newer Older
;;; -*- mode: common-lisp; package: asdf; -*-
;;; This is asdf: Another System Definition Facility.
;;; Feedback, bug reports, and patches are all welcome:
;;; please mail to <asdf-devel@common-lisp.net>.
;;; Note first that the canonical source for asdf is presently
;;; <URL:http://common-lisp.net/project/asdf/>.
;;;
;;; If you obtained this copy from anywhere else, and you experience
;;; trouble using it, or find bugs, you may want to check at the
;;; location above for a more recent version (and for documentation
;;; and test files, if your copy came without them) before reporting
;;; bugs.  There are usually two "supported" revisions - the git HEAD
;;; is the latest development version, whereas the revision tagged
;;; RELEASE may be slightly older but is considered `stable'

;;; -- LICENSE START
;;; (This is the MIT / X Consortium license as taken from
;;;  http://www.opensource.org/licenses/mit-license.html on or about
;;;  Monday; July 13, 2009)
;;;
;;; Copyright (c) 2001-2010 Daniel Barlow and contributors
;;;
;;; Permission is hereby granted, free of charge, to any person obtaining
;;; a copy of this software and associated documentation files (the
;;; "Software"), to deal in the Software without restriction, including
;;; without limitation the rights to use, copy, modify, merge, publish,
;;; distribute, sublicense, and/or sell copies of the Software, and to
;;; permit persons to whom the Software is furnished to do so, subject to
;;; the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
;;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
;;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
;;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;;;
;;; -- LICENSE END
;;; The problem with writing a defsystem replacement is bootstrapping:
;;; we can't use defsystem to compile it.  Hence, all in one file.
Daniel Barlow's avatar
Daniel Barlow committed

#+xcvb (module ())

(declaim (optimize (speed 3) (debug 2) (safety 2)))

#+ecl (require 'cmp)

(defpackage #:asdf-utilities
  (:nicknames :asdf-extensions)
  (:use #:common-lisp)
  (:export
   #:absolute-pathname-p
   #:aif
   #:appendf
   #:asdf-message
   #:coerce-name
   #:directory-pathname-p
   #:ends-with
   #:ensure-directory-pathname
   #:getenv
   #:get-uid
   #:length=n-p
   #:make-collector
   #:pathname-directory-pathname
   #:pathname-sans-name+type ;; deprecated. Use pathname-directory-pathname
   #:read-file-forms
   #:remove-keys
   #:remove-keyword
   #:resolve-symlinks
   #:split
   #:split-path-string
   #:system-registered-p
   #:truenamize))
;;;; -------------------------------------------------------------------------
;;;; Cleanups in case of hot-upgrade.
;;;; Things to do in case we're upgrading from a previous version of ASDF.
;;;; See https://bugs.launchpad.net/asdf/+bug/485687
;;;; These must come *before* the defpackage form.
;;;; See more at the end of the file.

(eval-when (:compile-toplevel :load-toplevel :execute)
  (block nil
    (let ((asdf (or (find-package :asdf) (return))))
      (flet ((frob (name)
               (let ((sym (find-symbol (string name) asdf)))
                 (when sym
                   (unexport sym asdf)
                   (unintern sym asdf)))))
        (frob '#:*asdf-revision*)
        (do-external-symbols (sym (or (find-package :asdf-utilities) (return)))
          (unless (eq sym (find-symbol (string sym) asdf))
            (frob sym)))))))
Daniel Barlow's avatar
Daniel Barlow committed
(defpackage #:asdf
  (:documentation "Another System Definition Facility")
  (:use :common-lisp :asdf-utilities)
Daniel Barlow's avatar
Daniel Barlow committed
  (:export #:defsystem #:oos #:operate #:find-system #:run-shell-command
           #:system-definition-pathname #:find-component ; miscellaneous
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:compile-system #:load-system #:test-system
           #:compile-op #:load-op #:load-source-op
           #:test-op
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:operation                 ; operations
           #:feature                 ; sort-of operation
           #:version                 ; metaphorically sort-of an operation
           #:input-files #:output-files #:perform ; operation methods
           #:operation-done-p #:explain

           #:component #:source-file
           #:c-source-file #:cl-source-file #:java-source-file
           #:static-file
           #:doc-file
           #:html-file
           #:text-file
           #:source-file-type
           #:module                     ; components
           #:system
           #:unix-dso

           #:module-components          ; component accessors
           #:component-pathname
           #:component-relative-pathname
           #:component-name
           #:component-version
           #:component-parent
           #:component-property
           #:component-system

           #:component-depends-on

           #:system-description
           #:system-long-description
           #:system-author
           #:system-maintainer
           #:system-license
           #:system-licence
           #:system-source-file
           #:system-relative-pathname
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:map-systems

           #:operation-on-warnings
           #:operation-on-failure

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
                                        ;#:*component-parent-pathname*
           #:*system-definition-search-functions*
           #:*central-registry*         ; variables
           #:*compile-file-warnings-behaviour*
           #:*compile-file-failure-behaviour*
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:*resolve-symlinks*
           #:operation-error #:compile-failed #:compile-warned #:compile-error
           #:error-name
           #:error-pathname
           #:missing-definition
           #:error-component #:error-operation
           #:system-definition-error
           #:missing-component
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:missing-component-of-version
           #:missing-dependency
           #:circular-dependency        ; errors
           #:duplicate-names

Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:try-recompiling
           #:retry
           #:accept                     ; restarts
Francois-Rene Rideau's avatar
Francois-Rene Rideau committed
           #:coerce-entry-to-directory
           #:remove-entry-from-registry

           #:standard-asdf-method-combination
           #:around                     ; protocol assistants
           #:initialize-output-translations
           #:clear-output-translations
           #:ensure-output-translations
           #:apply-output-translations
           #:*default-source-registries*
           #:compute-source-registry
           #:clear-source-registry
           #:ensure-source-registry
           #:process-source-registry))
(error "The author of this file habitually uses #+nil to comment out ~
        forms. But don't worry, it was unlikely to work in the New ~
        Implementation of Lisp anyway")
Loading
Loading full blame...