abcl-asdf: fix logic for dealing with ASDF::MVN entries without ASDF::VERSION.

parent 84d6da10
......@@ -21,7 +21,7 @@ that loadable by ASDF
(in-package :asdf)
(defsystem log4j
:components ((:mvn "log4j/log4j/1.4.9")))
:components ((:mvn "log4j/log4j/1.2.13")))
After issuing
......@@ -31,27 +31,28 @@ all the Log4j libraries would be dynamically added to the classpath so
that the following code would
(let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym)))))
(#"trace" logger "Kilroy wuz here.")))
(#"trace" logger "Kilroy wuz here."))
output the message "Kilroy wuz here" to the log4j logging system.
output the message "Kilroy wuz here" to the log4j logging system.
API
---
We define an API within the ASDF package consisting of the following
ASDF classes:
ASDF classes derived from ASDF:COMPONENT:
JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts
that have a currently valid pathname representation
that have a currently valid pathname representation (i.e. they exist
on the local filesystem).
And the MVN and IRI classes descend from ASDF-COMPONENT, but do not
And we define MVN and IRI classes descend from ASDF-COMPONENT, but do not
directly have a filesystem location.
For use outside of ASDF, we currently define the generic function
ABCL-ASDF:RESOLVE which locates, downloads, caches, and then loads
into the currently executing JVM process all recursive dependencies
annotated in the Maven pom.xml graph.
annotated in the ditributed Maven pom.xml graph.
One can muffle the verbosity of the Maven Aether resolver by setting
ABCL-ASDF:*MAVEN-VERBOSE* to NIL.
......@@ -75,8 +76,6 @@ that:
CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user")))
Example 3
---------
......@@ -141,7 +140,7 @@ Releases
Plausibly work under MSFT operating systems.
Working with maven-3.0.4 and working in more places.
Working with maven-3.0.4.
### 0.5.0 2012-01-22
......
......@@ -31,20 +31,25 @@
;;; use the component 'version' for the version string.
(defun maybe-parse-mvn (component)
(with-slots (asdf::name asdf::group-id asdf::artifact-id
asdf::version asdf::schema asdf::path) component
asdf::version asdf::schema asdf::path)
component
(when (null asdf::artifact-id)
(let ((slash (search "/" name)))
(unless (and (integerp slash)
asdf::version)
(let ((parsed (abcl-asdf::split-string name "/")))
(unless (or (= (length parsed) 3)
(and (= (length parsed) 2)
asdf::version))
(error "Failed to construct a mvn reference from name '~A' and version '~A'"
asdf::name asdf::version))
(setf asdf::group-id (subseq asdf::name 0 slash)
asdf::artifact-id (subseq asdf::name (1+ slash))
asdf::schema "mvn"
asdf::version (if (eq asdf::version :latest)
"LATEST"
asdf::version)
asdf::path (format nil "~A/~A" asdf::name asdf::version))))))
asdf::name
(if asdf::version
asdf::version
"UNSPECIFED")))
(setf asdf::group-id (first parsed)
asdf::artifact-id (second parsed)
asdf::schema "mvn"
asdf::version (if (third parsed)
(third parsed)
"LATEST"))
(setf asdf::path (format nil "~A/~A" asdf::name asdf::version))))))
(defmethod source-file-type ((component iri) (system system))
nil)
......
......@@ -4,7 +4,7 @@
(defsystem :log4j
:components
((:module log4j.jar :components
((:mvn "log4j/log4j" :version "1.2.15")))
((:mvn "log4j/log4j/1.2.15")))
(:module source :pathname "" :components
((:file "example"))
:depends-on (log4j.jar))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment