[armedbear-cvs] r14233 - trunk/abcl/contrib/abcl-asdf

mevenson at common-lisp.net mevenson at common-lisp.net
Fri Nov 9 14:43:34 UTC 2012


Author: mevenson
Date: Fri Nov  9 06:42:42 2012
New Revision: 14233

Log:
Re #262 in abcl-asdf: use first matching line if the first line doesn't work out.

Further work needed as something more meaningful should be returned
other than "The value NIL is not of type REAL" when abcl-asdf can't
parse the Maven version string.

Initial patch by Christoph.

Modified:
   trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd
   trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp

Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd	Wed Nov  7 10:00:29 2012	(r14232)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd	Fri Nov  9 06:42:42 2012	(r14233)
@@ -2,7 +2,7 @@
 
 (asdf:defsystem :abcl-asdf
   :author "Mark Evenson"
-  :version "0.9.0"
+  :version "0.9.1"
   :depends-on (jss)
   :components 
   ((:module packages :pathname "" 
@@ -19,12 +19,11 @@
 
 (asdf:defsystem :abcl-asdf-test
   :author "Mark Evenson"
-  :defsystem-depends-on (abcl-asdf)
-  :components
-  ((:module tests :serial t :components
-            ((:file "example")
-             (:file "maven")
-             (:file "test")))))
+  :defsystem-depends-on (abcl abcl-test-lisp abcl-asdf)
+  :components ((:module tests :serial t 
+                        :components ((:file "example")
+                                     (:file "maven")
+                                     (:file "test")))))
 
 #|
 (defmethod perform ((o test-op) (c (eql (find-system 'abcl-asdf-test))))

Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp	Wed Nov  7 10:00:29 2012	(r14232)
+++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp	Fri Nov  9 06:42:42 2012	(r14233)
@@ -114,21 +114,24 @@
 
 (defun mvn-version ()
   "Return the Maven version used by the Aether connector."
-  (let* ((line
-         (read-line (sys::process-output 
-                     (sys::run-program 
-                      (namestring (find-mvn)) '("-version")))))
-         (pattern (#"compile" 
-                   'regex.Pattern
-                   "Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)"))
-         (matcher (#"matcher" pattern line))
-         (found (#"find" matcher)))
-    (unless found 
-      (return-from mvn-version nil))
-    (mapcar #'parse-integer
-            `(,(#"group" matcher 1)
-              ,(#"group" matcher 2)
-              ,(#"group" matcher 3)))))
+  (let ((stream (sys::process-output
+                 (sys::run-program (truename (find-mvn)) '("-version"))))
+        (pattern (#"compile"
+                  'regex.Pattern
+                  "Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)")))
+    (do ((line (read-line stream nil :eof) 
+              (read-line stream nil :eof)))
+        ((or (not line) (eq line :eof)) nil)
+      (let ((matcher (#"matcher" pattern line)))
+        (when (#"find" matcher)
+          (return-from mvn-version
+            (handler-case 
+                (mapcar #'parse-integer 
+                        `(,(#"group" matcher 1) 
+                           ,(#"group" matcher 2) 
+                           ,(#"group" matcher 3)))
+              (t (e) 
+                (error "Failed to parse Maven version from ~A because~&~A." line e)))))))))
 
 (defun ensure-mvn-version ()
   "Return t if Maven version is 3.0.3 or greater."




More information about the armedbear-cvs mailing list