abcl-asdf: Rename SATISFY to RESOLVE.

Re-jiggle the exported symbols

Sharpen documentation, adding docstrings.  Freshen README.markdown.
parent 876bb037
......@@ -11,20 +11,36 @@ To use:
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 @@ that have a currently valid pathname representation
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 @@ The following ASDF defintion loads enough JVM artifacts to use the
((: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 @@ Problems
Mark <evenson.not.org@gmail.com>
Created: 2011-01-01
Revised: 2012-01-24
Revised: 2012-02-06
......@@ -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."
......
......@@ -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 @@ http://sonatype.github.com/sonatype-aether/apidocs/overview-summary.html
## 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 @@ in Java CLASSPATH representation."
#'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)
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment