Changeset 14233


Ignore:
Timestamp:
11/09/12 14:42:42 (8 years ago)
Author:
Mark Evenson
Message:

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.

Location:
trunk/abcl/contrib/abcl-asdf
Files:
2 edited

Legend:

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

    r14195 r14233  
    33(asdf:defsystem :abcl-asdf
    44  :author "Mark Evenson"
    5   :version "0.9.0"
     5  :version "0.9.1"
    66  :depends-on (jss)
    77  :components
     
    2020(asdf:defsystem :abcl-asdf-test
    2121  :author "Mark Evenson"
    22   :defsystem-depends-on (abcl-asdf)
    23   :components
    24   ((:module tests :serial t :components
    25             ((:file "example")
    26              (:file "maven")
    27              (:file "test")))))
     22  :defsystem-depends-on (abcl abcl-test-lisp abcl-asdf)
     23  :components ((:module tests :serial t
     24                        :components ((:file "example")
     25                                     (:file "maven")
     26                                     (:file "test")))))
    2827
    2928#|
  • trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp

    r14205 r14233  
    115115(defun mvn-version ()
    116116  "Return the Maven version used by the Aether connector."
    117   (let* ((line
    118          (read-line (sys::process-output
    119                      (sys::run-program
    120                       (namestring (find-mvn)) '("-version")))))
    121          (pattern (#"compile"
    122                    'regex.Pattern
    123                    "Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)"))
    124          (matcher (#"matcher" pattern line))
    125          (found (#"find" matcher)))
    126     (unless found
    127       (return-from mvn-version nil))
    128     (mapcar #'parse-integer
    129             `(,(#"group" matcher 1)
    130               ,(#"group" matcher 2)
    131               ,(#"group" matcher 3)))))
     117  (let ((stream (sys::process-output
     118                 (sys::run-program (truename (find-mvn)) '("-version"))))
     119        (pattern (#"compile"
     120                  'regex.Pattern
     121                  "Apache Maven ([0-9]+)\\.([0-9]+)\\.([0-9]+)")))
     122    (do ((line (read-line stream nil :eof)
     123              (read-line stream nil :eof)))
     124        ((or (not line) (eq line :eof)) nil)
     125      (let ((matcher (#"matcher" pattern line)))
     126        (when (#"find" matcher)
     127          (return-from mvn-version
     128            (handler-case
     129                (mapcar #'parse-integer
     130                        `(,(#"group" matcher 1)
     131                           ,(#"group" matcher 2)
     132                           ,(#"group" matcher 3)))
     133              (t (e)
     134                (error "Failed to parse Maven version from ~A because~&~A." line e)))))))))
    132135
    133136(defun ensure-mvn-version ()
Note: See TracChangeset for help on using the changeset viewer.