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

mevenson at common-lisp.net mevenson at common-lisp.net
Tue Sep 6 14:02:24 UTC 2011


Author: mevenson
Date: Tue Sep  6 07:02:22 2011
New Revision: 13575

Log:
Update ABCL-ASDF contrib to 0.4.1.

Document functions a bit better.  Include an example that can be used
without reference to ASDF.

Modified:
   trunk/abcl/contrib/abcl-asdf/README.markdown
   trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd
   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 Sep  6 04:39:04 2011	(r13574)
+++ trunk/abcl/contrib/abcl-asdf/README.markdown	Tue Sep  6 07:02:22 2011	(r13575)
@@ -1,13 +1,15 @@
 ABCL-ASDF
 =========
 
+To use:
+
     CL-USER> (require 'abcl-contrib)
 
     CL-USER> (require 'abcl-asdf)
     
     
 ABCL specific contributions to ASDF system definition mainly concerned
-with finding JVM artifiacts such as jar archives to be loaded.
+with finding JVM artifacts such as jar archives to be dynamically loaded.
 
 Examples
 --------
@@ -22,50 +24,66 @@
 API
 ---
 
-We define out API as consisting of the following ASDF classes:
+We define an API as consisting of the following ASDF classes:
 
 JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts
 that have a currently valid pathname representation 
 
-mvn
+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
+into the currently executing JVM process all recursive dependencies
+annotated in the Maven pom.xml graph.
+
+Example 2
+---------
 
-iri 
+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")
+    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.
 
-Example 2
+
+Example 3
 ---------
 
 For a filesystem of jar archives:
 
-./lib/ext/flora2-reasoner/XSBFlora.jar
-./lib/ext/iris-reasoner/iris/iris-0.58.jar
-./lib/ext/iris-reasoner/jgrapht/jgrapht-jdk1.5-0.7.1.jar
-./lib/ext/log4j/log4j-1.2.14.jar
-./lib/ext/mandrax-reasoner/commons-collections-2.1.jar
-./lib/ext/mandrax-reasoner/jdom-b10.jar
-./lib/ext/mandrax-reasoner/log4j-1.2.8.jar
-./lib/ext/mandrax-reasoner/mandarax-3.4.jar
-./lib/ext/mins-reasoner/mins-v0_3.jar
-./lib/ext/pellet-reasoner/aterm/1.6/aterm-java-1.6.jar
-./lib/ext/pellet-reasoner/commons-logging/1.1/commons-logging-1.1.jar
-./lib/ext/pellet-reasoner/kaon/1.2.9/rdfapi.jar
-./lib/ext/pellet-reasoner/owl-api/1.4.3/abstractparser.jar
-./lib/ext/pellet-reasoner/owl-api/1.4.3/io.jar
-./lib/ext/pellet-reasoner/owl-api/1.4.3/rdfparser.jar
-./lib/ext/pellet-reasoner/owl-api/1.4.3/validation.jar
-./lib/ext/pellet-reasoner/owl-api/owl-api-econn/2006-04-27/api.jar
-./lib/ext/pellet-reasoner/owl-api/owl-api-econn/2006-04-27/impl.jar
-./lib/ext/pellet-reasoner/pellet/pellet.jar
-./lib/ext/pellet-reasoner/relaxng/1.0/relaxngDatatype.jar
-./lib/ext/pellet-reasoner/xsdlib/xsdlib.jar
-./lib/ext/wsmo/WSML-grammar-20081202.jar
-./lib/ext/wsmo/wsmo-api-0.6.2.jar
-./lib/ext/wsmo/wsmo4j-0.6.2.jar
-./lib/ext/xsb-system/interprolog.jar
+    ./lib/ext/flora2-reasoner/XSBFlora.jar
+    ./lib/ext/iris-reasoner/iris/iris-0.58.jar
+    ./lib/ext/iris-reasoner/jgrapht/jgrapht-jdk1.5-0.7.1.jar
+    ./lib/ext/log4j/log4j-1.2.14.jar
+    ./lib/ext/mandrax-reasoner/commons-collections-2.1.jar
+    ./lib/ext/mandrax-reasoner/jdom-b10.jar
+    ./lib/ext/mandrax-reasoner/log4j-1.2.8.jar
+    ./lib/ext/mandrax-reasoner/mandarax-3.4.jar
+    ./lib/ext/mins-reasoner/mins-v0_3.jar
+    ./lib/ext/pellet-reasoner/aterm/1.6/aterm-java-1.6.jar
+    ./lib/ext/pellet-reasoner/commons-logging/1.1/commons-logging-1.1.jar
+    ./lib/ext/pellet-reasoner/kaon/1.2.9/rdfapi.jar
+    ./lib/ext/pellet-reasoner/owl-api/1.4.3/abstractparser.jar
+    ./lib/ext/pellet-reasoner/owl-api/1.4.3/io.jar
+    ./lib/ext/pellet-reasoner/owl-api/1.4.3/rdfparser.jar
+    ./lib/ext/pellet-reasoner/owl-api/1.4.3/validation.jar
+    ./lib/ext/pellet-reasoner/owl-api/owl-api-econn/2006-04-27/api.jar
+    ./lib/ext/pellet-reasoner/owl-api/owl-api-econn/2006-04-27/impl.jar
+    ./lib/ext/pellet-reasoner/pellet/pellet.jar
+    ./lib/ext/pellet-reasoner/relaxng/1.0/relaxngDatatype.jar
+    ./lib/ext/pellet-reasoner/xsdlib/xsdlib.jar
+    ./lib/ext/wsmo/WSML-grammar-20081202.jar
+    ./lib/ext/wsmo/wsmo-api-0.6.2.jar
+    ./lib/ext/wsmo/wsmo4j-0.6.2.jar
+    ./lib/ext/xsb-system/interprolog.jar
 
 The following ASDF defintion loads enough JVM artifacts to use the
-IRIS reasoner:
+[IRIS reasoner][1]:
 
     (defsystem :wsml2reasoner-jars
       :version "0.6.4"  ;; last sync with SVN
@@ -87,3 +105,18 @@
       (:module log4j-libs
 	 :pathname "lib/ext/log4j/" :components
 	      ((:jar-file "log4j-1.2.14")))))
+
+[1]:  http://www.iris-reasoner.org/
+
+
+Problems
+-------
+
+0.4.1 2011-09-06 
+
+o  locating the proper Maven3 libraries could work in more places
+   
+o  untested under Windows
+   
+o  more information should be optionally available when downloading
+   as this process can potentially take a long time.

Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd	Tue Sep  6 04:39:04 2011	(r13574)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd	Tue Sep  6 07:02:22 2011	(r13575)
@@ -3,7 +3,7 @@
 
 (defsystem :abcl-asdf
   :author "Mark Evenson"
-  :version "0.4.0"
+  :version "0.4.1"
   :depends-on (jss)
   :components 
   ((:module packages :pathname "" 

Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp	Tue Sep  6 04:39:04 2011	(r13574)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp	Tue Sep  6 07:02:22 2011	(r13575)
@@ -52,12 +52,16 @@
 (in-package #:abcl-asdf)
 
 (defun satisfy (mvn-component)
+  "Resolve all runtime dependencies of MVN-COMPONENT.
+
+Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string."
+  
   (with-slots (asdf::group-id asdf::artifact-id asdf::version) mvn-component
     (resolve-dependencies asdf::group-id asdf::artifact-id asdf::version)))
 
 (defun as-classpath (classpath)
-  "For a given MVN entry, return a list of loadable archives 
- suitable for addition to the classpath."
+  "Break apart the JVM CLASSPATH string into a list of its consituents."
+  ;;; XXX Maybe doesn't work under Windows?
   (split-string classpath ":"))
 
 (defun split-string (string split-char)

Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp	Tue Sep  6 04:39:04 2011	(r13574)
+++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp	Tue Sep  6 07:02:22 2011	(r13575)
@@ -132,7 +132,18 @@
      session
      (#"newLocalRepositoryManager" repository-system local-repository))))
 
-(defun resolve-artifact (group-id artifact-id version)
+(defun resolve-artifact (group-id artifact-id &optional (version "LATEST" versionp))
+  "Dynamically resolve Maven dependencies for item with GROUP-ID and ARTIFACT-ID at VERSION.
+
+Declared dependencies are not attempted to be located.
+
+If unspecified, the string \"LATEST\" will be used for the VERSION.
+
+Returns a string containing the necessary jvm classpath entries packed
+in Java CLASSPATH representation."
+
+  (unless versionp
+    (warn "Using LATEST for unspecified version."))
   (let* ((system 
           (repository-system))
          (session 
@@ -150,8 +161,18 @@
     (#"addRepository" artifact-request repository)
     (#"resolveArtifact" system session artifact-request)))
 
-(defun resolve-dependencies (group-id artifact-id version)
+(defun resolve-dependencies (group-id artifact-id &optional (version "LATEST" versionp))
+  "Dynamically resolve Maven dependencies for item with GROUP-ID and ARTIFACT-ID at VERSION.
+
+All recursive dependencies will be visited before resolution is successful.
+
+If unspecified, the string \"LATEST\" will be used for the VERSION.
+
+Returns a string containing the necessary jvm classpath entries packed
+in Java CLASSPATH representation."
   (unless *init* (init))
+  (unless versionp
+    (warn "Using LATEST for unspecified version."))
   (let* ((system 
           (repository-system))
          (session 

Modified: trunk/abcl/contrib/abcl-asdf/packages.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/packages.lisp	Tue Sep  6 04:39:04 2011	(r13574)
+++ trunk/abcl/contrib/abcl-asdf/packages.lisp	Tue Sep  6 07:02:22 2011	(r13575)
@@ -1,11 +1,14 @@
 (defpackage #:abcl-asdf
   (:use :cl)
   (:export 
+;;; Public API
+   #:resolve-dependencies
+
+;;; "Internal" API
    #:satisfy
    #:as-classpath
 
    #:resolve-artifact
-   #:resolve-dependencies
 
    #:add-directory-jars-to-class-path
    #:need-to-add-directory-jar?




More information about the armedbear-cvs mailing list