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

mevenson at common-lisp.net mevenson at common-lisp.net
Tue Feb 7 14:53:25 UTC 2012


Author: mevenson
Date: Tue Feb  7 06:53:22 2012
New Revision: 13865

Log:
abcl-asdf: Rename SATISFY to RESOLVE.

Re-jiggle the exported symbols

Sharpen documentation, adding docstrings.  Freshen README.markdown.

Modified:
   trunk/abcl/contrib/abcl-asdf/README.markdown
   trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
   trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp
   trunk/abcl/contrib/abcl-asdf/packages.lisp

Modified: trunk/abcl/contrib/abcl-asdf/README.markdown
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/README.markdown	Tue Feb  7 00:59:24 2012	(r13864)
+++ trunk/abcl/contrib/abcl-asdf/README.markdown	Tue Feb  7 06:53:22 2012	(r13865)
@@ -11,20 +11,36 @@
 ABCL specific contributions to ASDF system definition mainly concerned
 with finding JVM artifacts such as jar archives to be dynamically loaded.
 
-Examples
---------
+Example 1
+---------
+
+For the following ASDF definition stored in a file named "log4j.asd"
+that loadable by ASDF
 
     ;;;; -*- Mode: LISP -*-
     (in-package :asdf)
 
-    (defsystem :log4j
-      :components ((:mvn "log4j/log4j" 
-                    :version "1.4.9")))
+    (defsystem log4j
+      :components ((:mvn "log4j/log4j/1.4.9")))
+
+After issuing 
+
+    CL-USER> (asdf:load-system :log4j)
+    
+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.")))
+ 
+ output the message "Kilroy wuz here" to the log4j logging system.
+      
 
 API
 ---
 
-We define an API as consisting of the following ASDF classes:
+We define an API within the ASDF package consisting of the following
+ASDF classes:
 
 JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts
 that have a currently valid pathname representation 
@@ -32,24 +48,34 @@
 And the MVN and IRI classes descend from ASDF-COMPONENT, but do not
 directly have a filesystem location.
 
-For use outside of ASDF, we currently define one method,
-RESOLVE-DEPENDENCIES which locates, downloads, caches, and then loads
+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.
 
+One can muffle the verbosity of the Maven Aether resolver by setting
+ABCL-ASDF:*MAVEN-VERBOSE* to NIL.
+
 Example 2
 ---------
 
 Bypassing ASDF, one can directly issue requests for the Maven
 artifacts to be downloaded
 
-    CL-USER> (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user")
+    CL-USER> (abcl-asdf:resolve "com.google.gwt:gwt-user")
     WARNING: Using LATEST for unspecified version.
     "/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar"
 
 Notice that all recursive dependencies have been located and installed
 as well.
 
+ABCL-ASDF:RESOLVE does not added the resolved dependencies to the
+current JVM classpath.  Use JAVA:ADD-TO-CLASSPATH as follows to do
+that:
+
+    CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user")))
+
+
 
 Example 3
 ---------
@@ -102,16 +128,21 @@
 	    ((:jar-file "WSML-grammar-20081202")
 	     (:jar-file "wsmo-api-0.6.2")
 	     (:jar-file "wsmo4j-0.6.2")))
-      (:module log4j-libs
-	 :pathname "lib/ext/log4j/" :components
-	      ((:jar-file "log4j-1.2.14")))))
+      (:module log4j-libs 
+         :pathname "lib/ext/log4j/" :components
+	     ((:jar-file "log4j-1.2.14")))))
 
 [1]:  http://www.iris-reasoner.org/
 
-
-Problems
+Releases
 --------
 
+### 0.7.0 2012-02-05
+
+Plausibly work under MSFT operating systems.
+
+Working with maven-3.0.4 and working in more places.
+
 ### 0.5.0 2012-01-22
 
    o  just bless this as a release to stablize its offered API "as is"
@@ -138,5 +169,5 @@
     Mark <evenson.not.org at gmail.com>
     
     Created: 2011-01-01
-    Revised: 2012-01-24
+    Revised: 2012-02-06
     

Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp	Tue Feb  7 00:59:24 2012	(r13864)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp	Tue Feb  7 06:53:22 2012	(r13865)
@@ -17,13 +17,13 @@
 ;;; We intercept compilation to ensure that load-op will succeed
 (defmethod perform ((op compile-op) (c mvn))
   (maybe-parse-mvn c)
-  (abcl-asdf:satisfy c))
+  (abcl-asdf:resolve c))
      
 (defmethod perform ((operation load-op) (c mvn))
   (maybe-parse-mvn c)
   (java:add-to-classpath 
    (abcl-asdf:as-classpath 
-    (abcl-asdf:satisfy c))))
+    (abcl-asdf:resolve c))))
 
 ;;; A Maven URI has the form "mvn:group-id/artifact-id/version"
 ;;;
@@ -54,10 +54,10 @@
 
 (in-package #:abcl-asdf)
 
-(defgeneric satisfy (something)
+(defgeneric resolve (something)
  (:documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string."))
 
-(defmethod satisfy ((mvn-component asdf::mvn))
+(defmethod resolve ((mvn-component asdf::mvn))
   "Resolve all runtime dependencies of MVN-COMPONENT.
 
 Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string."

Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp	Tue Feb  7 00:59:24 2012	(r13864)
+++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp	Tue Feb  7 06:53:22 2012	(r13865)
@@ -3,9 +3,12 @@
 
 #|
 
-# Implementation references
+# Implementation 
+
+Not multi-threaded safe, and unclear how much work that would be.
 
 ## Installing Maven
+http://maven.apache.org/download.html
 
 ## Current Javadoc for Maven Aether connector
 http://sonatype.github.com/sonatype-aether/apidocs/overview-summary.html 
@@ -13,6 +16,10 @@
 ## Incomplete, seemingly often wrong
 https://docs.sonatype.org/display/AETHER/Home 
 
+Note that this is not an implementation of Maven per se, but the use
+of the Maven Aether connector infrastructure.  Among other things, this means
+that the Maven specific "~/.m2/settings.xml" file is NOT parsed for settings.
+
 |#
 
 (in-package :abcl-asdf)
@@ -368,8 +375,15 @@
      #'log)))
 
          
-;;; "log4j:log4j:1.9.2" or "log4j:log4j"
-(defmethod satisfy ((string t))
+(defmethod resolve ((string t))
+  "Resolve a colon separated GROUP-ID:ARTIFACT-ID[:VERSION] reference to a Maven artifact.
+
+Examples of artifact references: \"log4j:log4j:1.2.14\" for
+'log4j-1.2.14.jar'.  Resolving \"log4j:log4j\" would return the latest
+version of the artifact known to the distributed Maven pom.xml graph.
+
+Returns a string containing the necessary classpath entries for this
+artifact and all of its transitive dependencies."
   (let ((result (split-string string ":")))
     (cond 
       ((<= 2 (length result) 3)

Modified: trunk/abcl/contrib/abcl-asdf/packages.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/packages.lisp	Tue Feb  7 00:59:24 2012	(r13864)
+++ trunk/abcl/contrib/abcl-asdf/packages.lisp	Tue Feb  7 06:53:22 2012	(r13865)
@@ -2,7 +2,10 @@
   (:use :cl)
   (:export 
 ;;; Public API
+   #:resolve
+
    #:resolve-dependencies
+   #:resolve-artifact
 
    #:find-mvn
 
@@ -22,7 +25,6 @@
    #:resolve-artifact
    #:resolve-dependencies
 
-   #:satisfy
    #:as-classpath
 
    #:add-directory-jars-to-class-path




More information about the armedbear-cvs mailing list