Skip to content
Snippets Groups Projects
Commit a6b4786a authored by Robert P. Goldman's avatar Robert P. Goldman
Browse files

Add OPERATION-DEFINITION-ERROR class to make testing easier.

parent 8fa22cd5
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
#:component-operation-time #:mark-operation-done #:compute-action-stamp #:component-operation-time #:mark-operation-done #:compute-action-stamp
#:perform #:perform-with-restarts #:retry #:accept #:perform #:perform-with-restarts #:retry #:accept
#:traverse-actions #:traverse-sub-actions #:required-components ;; in plan #:traverse-actions #:traverse-sub-actions #:required-components ;; in plan
#:action-path #:find-action #:stamp #:done-p)) #:action-path #:find-action #:stamp #:done-p
;; condition
#:operation-definition-error
))
(in-package :asdf/action) (in-package :asdf/action)
(eval-when (#-lispworks :compile-toplevel :load-toplevel :execute) ;; LispWorks issues spurious warning (eval-when (#-lispworks :compile-toplevel :load-toplevel :execute) ;; LispWorks issues spurious warning
...@@ -205,6 +208,10 @@ dependencies."))) ...@@ -205,6 +208,10 @@ dependencies.")))
;;;--------------------------------------------------------------------------- ;;;---------------------------------------------------------------------------
;;; Help programmers catch obsolete OPERATION subclasses ;;; Help programmers catch obsolete OPERATION subclasses
;;;--------------------------------------------------------------------------- ;;;---------------------------------------------------------------------------
(define-condition operation-definition-error (simple-error)
()
(:documentation "Error conditions related to incorrect definitions of
OPERATION objects."))
(defmethod initialize-instance :before ((obj operation) &key) (defmethod initialize-instance :before ((obj operation) &key)
(unless (unless
(loop :for x :in '(downward-operation upward-operation sideway-operation (loop :for x :in '(downward-operation upward-operation sideway-operation
...@@ -214,9 +221,11 @@ dependencies."))) ...@@ -214,9 +221,11 @@ dependencies.")))
:when (typep obj x) :when (typep obj x)
:return t :return t
:finally (return nil)) :finally (return nil))
(error "No dependency propagating scheme specified for operation ~a.~ (error 'operation-definition-error
"No dependency propagating scheme specified for operation ~a.~
This is likely because the OPERATION subclass of this object has not been ~ This is likely because the OPERATION subclass of this object has not been ~
updated for ASDF 3." obj))) updated for ASDF 3."
obj)))
(defmethod initialize-instance :before ((obj non-propagating-operation) &key) (defmethod initialize-instance :before ((obj non-propagating-operation) &key)
(when (when
...@@ -225,7 +234,8 @@ updated for ASDF 3." obj))) ...@@ -225,7 +234,8 @@ updated for ASDF 3." obj)))
:when (typep obj x) :when (typep obj x)
:return t :return t
:finally (return nil)) :finally (return nil))
(error "Inconsistent class: ~a No class should have both NON-PROPAGATING-OPERATION and a propagating (error 'operation-definition-error
"Inconsistent class: ~a No class should have both NON-PROPAGATING-OPERATION and a propagating
operation class as superclasses." (class-name (class-of obj))))) operation class as superclasses." (class-name (class-of obj)))))
;;;--------------------------------------------------------------------------- ;;;---------------------------------------------------------------------------
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
#:circular-dependency ; errors #:circular-dependency ; errors
#:duplicate-names #:non-toplevel-system #:non-system-system #:duplicate-names #:non-toplevel-system #:non-system-system
#:package-system-missing-package-error #:package-system-missing-package-error
#:operation-definition-error
#:try-recompiling #:try-recompiling
#:retry #:retry
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment