1.104: add support for :around-compile
authorFrancois-Rene Rideau <tunes@google.com>
Sun, 20 Nov 2011 19:41:09 +0000 (14:41 -0500)
committerFrancois-Rene Rideau <tunes@google.com>
Sun, 20 Nov 2011 19:41:09 +0000 (14:41 -0500)
asdf-classes.lisp
asdf-dependency-grovel.asd
asdf-ops.lisp
package.lisp

index cf42e76..d0e2fa4 100644 (file)
   ()
   (:default-initargs :default-component-class 'instrumented-cl-source-file))
 
+(defun escaped-around-compile-hook (component)
+  (let ((around-compile (asdf::around-compile-hook component)))
+    (etypecase around-compile
+      ((or null string) around-compile)
+      (function (error "Can't convert around-compile hook ~S because it's a function object.~%Maybe you should use a lambda-expression instead?"
+                       around-compile))
+      ((or symbol cons)
+       (with-standard-io-syntax
+         (let ((*package* (find-package :cl)))
+           (write-to-string around-compile :readably t)))))))
+
 (defmethod additional-initargs :around ((comp instrumented-component))
   (flet ((slot-when-bound (slot-name initarg)
            (when (slot-boundp comp slot-name)
              `(,initarg ,(slot-value comp slot-name)))))
     `(,@(call-next-method)
+        ,@(when (asdf::around-compile-hook comp)
+            `(:around-compile (escaped-around-compile comp)))
         ,@(slot-when-bound 'translated-name :translated-name)
         ,@(slot-when-bound 'translated-pathname :translated-pathname-form))))
index bc03b9d..bb451ff 100644 (file)
@@ -2,7 +2,7 @@
 
 (cl:in-package :asdf)
 
-(unless (or #+asdf2 (asdf:version-satisfies (asdf:asdf-version) "2.014.8"))
+(unless (or #+asdf2 (version-satisfies (asdf-version) "2.014.8"))
   (error "Not only is your ASDF version is too old for ASDF-DEPENDENCY-GROVEL,
        you must upgrade it *before* you try to load any system."))
 
      ((%components :accessor %handler-components)))
 
 (defun handler-input-file-list (pathname parent)
-  (map 'list
-       (lambda (f)
-         (make-instance 'cl-source-file
-            :name (pathname-name f)
-            :parent parent
-            :pathname f))
-       (sort (directory (make-pathname :defaults pathname
-                                       :name :wild
-                                       :type "lisp"
-                                       :version :newest))
-             #'string<
-             :key #'namestring)))
+  (mapcar
+   (lambda (f)
+     (make-instance 'cl-source-file
+                    :name (pathname-name f)
+                    :parent parent
+                    :pathname f))
+   (sort (directory (make-pathname :defaults pathname
+                                   :name :wild
+                                   :type "lisp"
+                                   :version :newest))
+         #'string<
+         :key #'namestring)))
 
 (defmethod module-components ((c grovel-handlers))
   (if (slot-boundp c '%components)
             (handler-input-file-list (component-pathname c) c))))
 
 (defsystem :asdf-dependency-grovel
-  :depends-on ((:version :asdf "2.017"))
+  :description "Analyse the dependencies in an ASDF system"
+  :long-description "ASDF-DEPENDENCY-GROVEL will analyse the actual dependencies in an ASDF system.
+Based on an analysis with file granularity ,
+it can output an optimized system definition,
+based on which compilation can be parallelized.
+Based on an analysis with form granularity,
+it can output a summary from which you can untangle
+the circularities in your build."
+  :depends-on ((:version :asdf "2.018.12")) ;; for full :around-compile support
   :components ((:file "package")
                (:file "variables" :depends-on ("package"))
                (:file "classes" :depends-on ("package" "variables"))
index 27a4d11..6ab907b 100644 (file)
@@ -12,7 +12,6 @@ to the base of the system."
                                               (pathname-directory system-base-dir)
                                               :test #'equal)
                                     (length (pathname-directory output-file))))))
-    
     (list
      (if (or *current-constituent*
              (and (boundp '*old-macroexpand-hook*) *old-macroexpand-hook*))
index a697623..760af86 100644 (file)
@@ -31,8 +31,8 @@
 
 (in-package #:asdf-dependency-grovel)
 
-(defparameter *asdf-dependency-grovel-version* "1.103")
-(defparameter *asdf-version-required-by-adg* "2.008")
+(defparameter *asdf-dependency-grovel-version* "1.104")
+(defparameter *asdf-version-required-by-adg* "2.018.12")
 
 #-asdf2
 (error "ASDF-DEPENDENCY-GROVEL requires ASDF2.")