[armedbear-cvs] r13867 - in trunk/abcl/contrib/abcl-asdf: . tests

mevenson at common-lisp.net mevenson at common-lisp.net
Wed Feb 8 08:21:39 UTC 2012


Author: mevenson
Date: Wed Feb  8 00:21:35 2012
New Revision: 13867

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

Modified:
   trunk/abcl/contrib/abcl-asdf/README.markdown
   trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
   trunk/abcl/contrib/abcl-asdf/tests/log4j.asd

Modified: trunk/abcl/contrib/abcl-asdf/README.markdown
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/README.markdown	Tue Feb  7 08:36:32 2012	(r13866)
+++ trunk/abcl/contrib/abcl-asdf/README.markdown	Wed Feb  8 00:21:35 2012	(r13867)
@@ -21,7 +21,7 @@
     (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 @@
 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 @@
 
     CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user")))
 
-
-
 Example 3
 ---------
 
@@ -141,7 +140,7 @@
 
 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
 

Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp	Tue Feb  7 08:36:32 2012	(r13866)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp	Wed Feb  8 00:21:35 2012	(r13867)
@@ -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)

Modified: trunk/abcl/contrib/abcl-asdf/tests/log4j.asd
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/tests/log4j.asd	Tue Feb  7 08:36:32 2012	(r13866)
+++ trunk/abcl/contrib/abcl-asdf/tests/log4j.asd	Wed Feb  8 00:21:35 2012	(r13867)
@@ -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))))




More information about the armedbear-cvs mailing list