Changeset 14631


Ignore:
Timestamp:
02/24/14 10:48:07 (3 years ago)
Author:
mevenson
Message:

abcl-asdf: cache Maven dependency resolution to avoid repeated lookups.

Instead of calling ABCL-ASDF:RESOLVE in both the ASDF COMPILE-OP and
LOAD-OP, we now cache the result of invocation in COMPILE-OP and add
this value in the LOAD-OP phase.

Contributed by Cyrus Harmon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp

    r14630 r14631  
    11;;;; The ABCL specific overrides in ASDF. 
    22;;;;
    3 ;;;; Done separate from asdf.lisp for stability.
     3;;;; Done separately from asdf.lisp for stability.
    44(require :asdf)
    55(in-package :asdf)
     
    1515  ((group-id :initarg :group-id :initform nil)
    1616   (artifact-id :initarg :artifact-id :initform nil)
    17    (repository :initform "http://repo1.maven.org/maven2/") ;;; XXX unimplmented
     17   (repository :initform "http://repo1.maven.org/maven2/") ;;; XXX unimplemented
     18   (resolved-classpath :initform nil :accessor resolved-classpath)
    1819   (classname :initarg :classname :initform nil)
    1920   (alternate-uri :initarg :alternate-uri :initform nil)
     
    2829;;; We intercept compilation to ensure that load-op will succeed
    2930(defmethod perform ((op compile-op) (c mvn))
    30   (abcl-asdf:resolve   
    31    (ensure-parsed-mvn c)))
     31  (unless (resolved-classpath c)
     32    (setf (resolved-classpath c)
     33          (abcl-asdf:resolve   
     34           (ensure-parsed-mvn c)))))
    3235
    3336(defmethod perform ((operation load-op) (c mvn))
    34   (let ((resolved-path
    35          (abcl-asdf:resolve (ensure-parsed-mvn c))))
    36     (when (stringp resolved-path)
    37       (java:add-to-classpath (abcl-asdf:as-classpath resolved-path)))))
     37  (let ((resolved-classpath (resolved-classpath c)))
     38    (when (stringp resolved-classpath)
     39      (java:add-to-classpath (abcl-asdf:as-classpath resolved-classpath)))))
    3840
    3941;;; A Maven URI has the form "mvn:group-id/artifact-id/version"
Note: See TracChangeset for help on using the changeset viewer.