Changeset 13865
- Timestamp:
- 02/07/12 14:53:22 (11 years ago)
- Location:
- trunk/abcl/contrib/abcl-asdf
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/contrib/abcl-asdf/README.markdown
r13804 r13865 12 12 with finding JVM artifacts such as jar archives to be dynamically loaded. 13 13 14 Examples 15 -------- 14 Example 1 15 --------- 16 17 For the following ASDF definition stored in a file named "log4j.asd" 18 that loadable by ASDF 16 19 17 20 ;;;; -*- Mode: LISP -*- 18 21 (in-package :asdf) 19 22 20 (defsystem :log4j 21 :components ((:mvn "log4j/log4j" 22 :version "1.4.9"))) 23 (defsystem log4j 24 :components ((:mvn "log4j/log4j/1.4.9"))) 25 26 After issuing 27 28 CL-USER> (asdf:load-system :log4j) 29 30 all the Log4j libraries would be dynamically added to the classpath so 31 that the following code would 32 33 (let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym))))) 34 (#"trace" logger "Kilroy wuz here."))) 35 36 output the message "Kilroy wuz here" to the log4j logging system. 37 23 38 24 39 API 25 40 --- 26 41 27 We define an API as consisting of the following ASDF classes: 42 We define an API within the ASDF package consisting of the following 43 ASDF classes: 28 44 29 45 JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts … … 33 49 directly have a filesystem location. 34 50 35 For use outside of ASDF, we currently define one method,36 RESOLVE-DEPENDENCIESwhich locates, downloads, caches, and then loads51 For use outside of ASDF, we currently define the generic function 52 ABCL-ASDF:RESOLVE which locates, downloads, caches, and then loads 37 53 into the currently executing JVM process all recursive dependencies 38 54 annotated in the Maven pom.xml graph. 55 56 One can muffle the verbosity of the Maven Aether resolver by setting 57 ABCL-ASDF:*MAVEN-VERBOSE* to NIL. 39 58 40 59 Example 2 … … 44 63 artifacts to be downloaded 45 64 46 CL-USER> (abcl-asdf:resolve -dependencies "com.google.gwt" "gwt-user")65 CL-USER> (abcl-asdf:resolve "com.google.gwt:gwt-user") 47 66 WARNING: Using LATEST for unspecified version. 48 67 "/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" … … 50 69 Notice that all recursive dependencies have been located and installed 51 70 as well. 71 72 ABCL-ASDF:RESOLVE does not added the resolved dependencies to the 73 current JVM classpath. Use JAVA:ADD-TO-CLASSPATH as follows to do 74 that: 75 76 CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user"))) 77 52 78 53 79 … … 103 129 (:jar-file "wsmo-api-0.6.2") 104 130 (:jar-file "wsmo4j-0.6.2"))) 105 (:module log4j-libs 106 107 131 (:module log4j-libs 132 :pathname "lib/ext/log4j/" :components 133 ((:jar-file "log4j-1.2.14"))))) 108 134 109 135 [1]: http://www.iris-reasoner.org/ 110 136 137 Releases 138 -------- 111 139 112 Problems 113 -------- 140 ### 0.7.0 2012-02-05 141 142 Plausibly work under MSFT operating systems. 143 144 Working with maven-3.0.4 and working in more places. 114 145 115 146 ### 0.5.0 2012-01-22 … … 139 170 140 171 Created: 2011-01-01 141 Revised: 2012-0 1-24172 Revised: 2012-02-06 142 173 -
trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
r13863 r13865 18 18 (defmethod perform ((op compile-op) (c mvn)) 19 19 (maybe-parse-mvn c) 20 (abcl-asdf: satisfyc))20 (abcl-asdf:resolve c)) 21 21 22 22 (defmethod perform ((operation load-op) (c mvn)) … … 24 24 (java:add-to-classpath 25 25 (abcl-asdf:as-classpath 26 (abcl-asdf: satisfyc))))26 (abcl-asdf:resolve c)))) 27 27 28 28 ;;; A Maven URI has the form "mvn:group-id/artifact-id/version" … … 55 55 (in-package #:abcl-asdf) 56 56 57 (defgeneric satisfy(something)57 (defgeneric resolve (something) 58 58 (:documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string.")) 59 59 60 (defmethod satisfy((mvn-component asdf::mvn))60 (defmethod resolve ((mvn-component asdf::mvn)) 61 61 "Resolve all runtime dependencies of MVN-COMPONENT. 62 62 -
trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp
r13863 r13865 4 4 #| 5 5 6 # Implementation references 6 # Implementation 7 8 Not multi-threaded safe, and unclear how much work that would be. 7 9 8 10 ## Installing Maven 11 http://maven.apache.org/download.html 9 12 10 13 ## Current Javadoc for Maven Aether connector … … 13 16 ## Incomplete, seemingly often wrong 14 17 https://docs.sonatype.org/display/AETHER/Home 18 19 Note that this is not an implementation of Maven per se, but the use 20 of the Maven Aether connector infrastructure. Among other things, this means 21 that the Maven specific "~/.m2/settings.xml" file is NOT parsed for settings. 15 22 16 23 |# … … 369 376 370 377 371 ;;; "log4j:log4j:1.9.2" or "log4j:log4j" 372 (defmethod satisfy ((string t)) 378 (defmethod resolve ((string t)) 379 "Resolve a colon separated GROUP-ID:ARTIFACT-ID[:VERSION] reference to a Maven artifact. 380 381 Examples of artifact references: \"log4j:log4j:1.2.14\" for 382 'log4j-1.2.14.jar'. Resolving \"log4j:log4j\" would return the latest 383 version of the artifact known to the distributed Maven pom.xml graph. 384 385 Returns a string containing the necessary classpath entries for this 386 artifact and all of its transitive dependencies." 373 387 (let ((result (split-string string ":"))) 374 388 (cond -
trunk/abcl/contrib/abcl-asdf/packages.lisp
r13841 r13865 3 3 (:export 4 4 ;;; Public API 5 #:resolve 6 5 7 #:resolve-dependencies 8 #:resolve-artifact 6 9 7 10 #:find-mvn … … 23 26 #:resolve-dependencies 24 27 25 #:satisfy26 28 #:as-classpath 27 29
Note: See TracChangeset
for help on using the changeset viewer.