[armedbear-cvs] r14373 - in branches/1.1.x/contrib/abcl-asdf: . tests

mevenson at common-lisp.net mevenson at common-lisp.net
Wed Feb 13 19:29:32 UTC 2013


Author: mevenson
Date: Wed Feb 13 11:29:31 2013
New Revision: 14373

Log:
Backport r14364 | mevenson | 2013-01-31 11:02:29 +0100 (Thu, 31 Jan 2013) | 9 lines

ASDF systems using the MVN component now load again.

log4j.asd example corrected as well.

FIND-MVN now emits a warning if it cannot actually find a Maven exectuable.

Thanks to Milos Negovanovic for identifying the problem with a patch.

Fixes #299.

Modified:
   branches/1.1.x/contrib/abcl-asdf/abcl-asdf.lisp
   branches/1.1.x/contrib/abcl-asdf/maven-embedder.lisp
   branches/1.1.x/contrib/abcl-asdf/tests/example.lisp
   branches/1.1.x/contrib/abcl-asdf/tests/log4j.asd

Modified: branches/1.1.x/contrib/abcl-asdf/abcl-asdf.lisp
==============================================================================
--- branches/1.1.x/contrib/abcl-asdf/abcl-asdf.lisp	Wed Feb 13 11:28:12 2013	(r14372)
+++ branches/1.1.x/contrib/abcl-asdf/abcl-asdf.lisp	Wed Feb 13 11:29:31 2013	(r14373)
@@ -131,13 +131,13 @@
         (java:java-exception (e)
           (unless (java:jinstance-of-p (java:java-exception-cause e)
                                   "java.lang.ClassNotFoundException")
-            (error "Unexpected Java exception~&~A.~&" e))
-          (if (find-mvn)
-              (resolve-dependencies group-id artifact-id version)
-              (if alternate-uri
-                  (values (namestring alternate-uri) alternate-uri)
-                  (t 
-                   (error "Failed to resolve MVN component name ~A." name)))))))))
+            (error "Unexpected Java exception~&~A.~&" e))))
+      (if (find-mvn)
+          (resolve-dependencies group-id artifact-id version)
+          (if alternate-uri
+              (values (namestring alternate-uri) alternate-uri)
+              (t 
+               (error "Failed to resolve MVN component name ~A." name)))))))
   
 (defun as-classpath (classpath)
   "Break apart the JVM CLASSPATH string into a list of its consituents."

Modified: branches/1.1.x/contrib/abcl-asdf/maven-embedder.lisp
==============================================================================
--- branches/1.1.x/contrib/abcl-asdf/maven-embedder.lisp	Wed Feb 13 11:28:12 2013	(r14372)
+++ branches/1.1.x/contrib/abcl-asdf/maven-embedder.lisp	Wed Feb 13 11:29:31 2013	(r14373)
@@ -50,7 +50,9 @@
 (defun find-mvn () 
   "Attempt to find a suitable Maven ('mvn') executable on the hosting operating system.
 
-Returns the path of the Maven executable or nil if none are found."
+Returns the path of the Maven executable or nil if none are found.
+
+Emits warnings if not able to find a suitable executable."
 
   (let ((m2-home (ext:getenv "M2_HOME"))
         (m2 (ext:getenv "M2"))
@@ -97,7 +99,8 @@
                              "~&Failed to find Maven executable '~A' in PATH because~&~A" 
                              mvn-path e)))))
             (when mvn
-              (return-from find-mvn mvn))))))))
+              (return-from find-mvn mvn)))))))
+  (warn "Unable to locate Maven executable."))
 
 (defun find-mvn-libs ()
   (let ((mvn (find-mvn)))

Modified: branches/1.1.x/contrib/abcl-asdf/tests/example.lisp
==============================================================================
--- branches/1.1.x/contrib/abcl-asdf/tests/example.lisp	Wed Feb 13 11:28:12 2013	(r14372)
+++ branches/1.1.x/contrib/abcl-asdf/tests/example.lisp	Wed Feb 13 11:29:31 2013	(r14373)
@@ -1,12 +1,14 @@
-(in-package :abcl-asdf-test)
+(in-package :cl-user)
 
-;;;(deftest LOG4J.2
-;;;    (progn
 (defun test-LOG4J.2 ()
-  (asdf:load-system "log4j")
-  (let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym)))))
-    (#"trace" logger "Kilroy wuz here.")))
-;;;  t)
+  "Output a message to the Console. 
+
+Note:  for users of SLIME, this will appear in the associated *inferior-lisp* buffer."
+  (#"configure" 'log4j.BasicConfigurator)
+  (#"info" (#"getRootLogger" 'log4j.Logger) "Kilroy wuz here."))
+
+
+
 
 
 

Modified: branches/1.1.x/contrib/abcl-asdf/tests/log4j.asd
==============================================================================
--- branches/1.1.x/contrib/abcl-asdf/tests/log4j.asd	Wed Feb 13 11:28:12 2013	(r14372)
+++ branches/1.1.x/contrib/abcl-asdf/tests/log4j.asd	Wed Feb 13 11:29:31 2013	(r14373)
@@ -1,12 +1,13 @@
 ;;;; -*- Mode: LISP -*-
-(in-package :asdf)
 
-(defsystem :log4j
-  :components 
-  ((:module log4j.jar :components 
+(asdf:defsystem :log4j  
+  :defsystem-depends-on (abcl-asdf)
+  :components ((:module log4j.jar :components 
             ((:mvn "log4j/log4j/1.2.15")))
    (:module source :pathname "" :components
             ((:file "example"))
             :depends-on (log4j.jar))))
 
-  
+(defmethod perform ((o asdf:test-op) (s (eql (asdf:find-system :log4j))))
+  (asdf:load-system :log4j)
+  (eval (read-from-string "(cl-user::test-log4j.2)")))




More information about the armedbear-cvs mailing list