Re: New asdf version
Marco Baringer <[email protected]>
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
Daniel Barlow <[email protected]> writes: > > If you have a test suite define a method on the generic function > > asdf:test specialized to (eql <name of system>), ie: > > > > (defmethod asdf:test ((dummy (eql :my-system))) > > (whatever) > > ...) > > > > asdf:test-op will simply call the generic function asdf:test passing > > the system name as the first arg, this method should print out a > > message like "PASSED" or "FAILED", but isn't actually required to do > > anything. If no such method is found asdf will do nothing. > > Perhaps I'm being dense, but what does this offer over > > (defmethod asdf:perform ((o test-op) (c (eql (find-system 'my-system)))) > (do whatever)) > > in my-system.asd ? nothing, i was being dense. and now for something completely different. when you mistype the name of a file in the system definition (which i do often enough) the error message you get appears to be complelty unrelated to the actual problem (the file not existing). the attached patch fixes this. This patch also introduces a few new component types and two special vars, i'm leaving them in the patch because i'm lazy, but they're not essential. -- -Marco Ring the bells that still can ring. Forget your perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen
asdf.diff
(text/x-patch, 2.7 KB)
Index: asdf.lisp =================================================================== RCS file: /cvsroot/cclan/asdf/asdf.lisp,v retrieving revision 1.65 diff -u -r1.65 asdf.lisp --- asdf.lisp 16 Mar 2003 22:50:54 -0000 1.65 +++ asdf.lisp 18 Mar 2003 23:12:30 -0000 @@ -97,8 +97,24 @@ (parse-integer v :start (1+ dot) :junk-allowed t))))) -(defvar *compile-file-warnings-behaviour* :warn) -(defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn) +(defvar *asdf-warnings-behaviour* :warn + "What ASDF should do in case of warnings (non critical things which go wrong). + +Can be one of: + :IGNORE - silently continue + :WARN - signal a warning and try to continue + :ERROR - signal an error") + +(defvar *asdf-failure-behaviour* #+sbcl :error #-sbcl :warn + "What ASDF should do in case of failures (critical things which go wrong). + +Can be one of: + :IGNORE - silently continue + :WARN - signal a warning and try to continue + :ERROR - signal an error") + +(defvar *compile-file-warnings-behaviour* *asdf-warnings-behaviour*) +(defvar *compile-file-failure-behaviour* *asdf-failure-behaviour*) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; utility stuff @@ -391,18 +407,22 @@ (defclass source-file (component) ()) +(defclass system-file (source-file) ()) (defclass cl-source-file (source-file) ()) (defclass c-source-file (source-file) ()) (defclass java-source-file (source-file) ()) (defclass static-file (source-file) ()) (defclass doc-file (static-file) ()) (defclass html-file (doc-file) ()) +(defclass css-file (html-file) ()) (defgeneric source-file-type (component system)) +(defmethod source-file-type ((c system-file) (s module)) "asd") (defmethod source-file-type ((c cl-source-file) (s module)) "lisp") (defmethod source-file-type ((c c-source-file) (s module)) "c") (defmethod source-file-type ((c java-source-file) (s module)) "java") (defmethod source-file-type ((c html-file) (s module)) "html") +(defmethod source-file-type ((c css-file) (s module)) "css") (defmethod source-file-type ((c static-file) (s module)) nil) (defmethod component-relative-pathname ((component source-file)) @@ -664,6 +683,14 @@ (defmethod perform ((operation operation) (c module)) nil) + +(defmethod perform :around ((op operation) (file source-file)) + (if (probe-file (component-pathname file)) + (call-next-method) + (case *asdf-warnings-behaviour* + (:warn (warn "File ~S doesn't exist (looking form: ~S" file (component-pathname file))) + (:error (error 'operation-error :component file :operation op)) + (:ignore nil)))) (defmethod explain ((operation operation) (component component)) (format *trace-output* "~&;;; ~A on ~A~%"