Loading action.lisp +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ (:recycle :asdf/action :asdf) (:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/component :asdf/system #:asdf/cache :asdf/find-system :asdf/find-component :asdf/operation) (:import-from :asdf/operation #:check-operation-constructor) (:export #:action #:define-convenience-action-methods #:action-description Loading Loading @@ -232,6 +233,7 @@ dependencies."))) (:documentation "Error condition related to definition of incorrect OPERATION objects.")) (defmethod initialize-instance :before ((o operation) &key) (check-operation-constructor) (unless (typep o '(or downward-operation upward-operation sideway-operation selfward-operation non-propagating-operation)) (warn 'operation-definition-warning Loading operation.lisp +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,13 @@ and support for them may be discontinued at any moment. (unless (slot-boundp o 'original-initargs) (setf (operation-original-initargs o) initargs))) (defvar *in-make-operation* nil) (defun check-operation-constructor () "Enforce that OPERATION instances must be created with MAKE-OPERATION." (unless *in-make-operation* (sysdef-error "OPERATION instances must only be created through MAKE-OPERATION."))) (defmethod print-object ((o operation) stream) (print-unreadable-object (o stream :type t :identity nil) (ignore-errors Loading @@ -58,7 +65,8 @@ All operation instances MUST be created through this function. Use of INITARGS is for backward compatibility and may be discontinued at any time." (let ((class (coerce-class operation-class :package :asdf/interface :super 'operation :error 'sysdef-error))) :package :asdf/interface :super 'operation :error 'sysdef-error)) (*in-make-operation* t)) (ensure-gethash (cons class initargs) *operations* (list* 'make-instance class initargs)))) Loading test/test-operation-classes.script +5 −1 Original line number Diff line number Diff line Loading @@ -75,4 +75,8 @@ (operate 'trivial-operation 'test-asdf/test-module-depend) ;;; this test intended to catch a bug in operate :around method in operate.lisp, ;;; thanks to Jan Moringen [2014/08/10:rpg] (operate (make-instance 'trivial-operation) 'test-asdf/test-module-depend) (operate (make-operation 'trivial-operation) 'test-asdf/test-module-depend) ;;; operations should only be made by MAKE-OPERATION, and now we enforce this. (signals system-definition-error (make-instance 'load-op)) Loading
action.lisp +2 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ (:recycle :asdf/action :asdf) (:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/component :asdf/system #:asdf/cache :asdf/find-system :asdf/find-component :asdf/operation) (:import-from :asdf/operation #:check-operation-constructor) (:export #:action #:define-convenience-action-methods #:action-description Loading Loading @@ -232,6 +233,7 @@ dependencies."))) (:documentation "Error condition related to definition of incorrect OPERATION objects.")) (defmethod initialize-instance :before ((o operation) &key) (check-operation-constructor) (unless (typep o '(or downward-operation upward-operation sideway-operation selfward-operation non-propagating-operation)) (warn 'operation-definition-warning Loading
operation.lisp +9 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,13 @@ and support for them may be discontinued at any moment. (unless (slot-boundp o 'original-initargs) (setf (operation-original-initargs o) initargs))) (defvar *in-make-operation* nil) (defun check-operation-constructor () "Enforce that OPERATION instances must be created with MAKE-OPERATION." (unless *in-make-operation* (sysdef-error "OPERATION instances must only be created through MAKE-OPERATION."))) (defmethod print-object ((o operation) stream) (print-unreadable-object (o stream :type t :identity nil) (ignore-errors Loading @@ -58,7 +65,8 @@ All operation instances MUST be created through this function. Use of INITARGS is for backward compatibility and may be discontinued at any time." (let ((class (coerce-class operation-class :package :asdf/interface :super 'operation :error 'sysdef-error))) :package :asdf/interface :super 'operation :error 'sysdef-error)) (*in-make-operation* t)) (ensure-gethash (cons class initargs) *operations* (list* 'make-instance class initargs)))) Loading
test/test-operation-classes.script +5 −1 Original line number Diff line number Diff line Loading @@ -75,4 +75,8 @@ (operate 'trivial-operation 'test-asdf/test-module-depend) ;;; this test intended to catch a bug in operate :around method in operate.lisp, ;;; thanks to Jan Moringen [2014/08/10:rpg] (operate (make-instance 'trivial-operation) 'test-asdf/test-module-depend) (operate (make-operation 'trivial-operation) 'test-asdf/test-module-depend) ;;; operations should only be made by MAKE-OPERATION, and now we enforce this. (signals system-definition-error (make-instance 'load-op))