[armedbear-cvs] r13340 - in trunk/abcl/contrib/abcl-asdf: . tests
mevenson at common-lisp.net
mevenson at common-lisp.net
Fri Jun 17 09:25:53 UTC 2011
Author: mevenson
Date: Fri Jun 17 02:25:53 2011
New Revision: 13340
Log:
Rough cut of what declaring Maven dependencies in ASDF would be like.
Added:
trunk/abcl/contrib/abcl-asdf/
trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd
trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
trunk/abcl/contrib/abcl-asdf/tests/
trunk/abcl/contrib/abcl-asdf/tests/example.lisp
trunk/abcl/contrib/abcl-asdf/tests/log4j.asd
Added: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd Fri Jun 17 02:25:53 2011 (r13340)
@@ -0,0 +1,9 @@
+;;;; -*- Mode: LISP -*-
+(in-package :asdf)
+
+(defsystem :abcl-asdf
+ :author "Mark Evenson"
+ :version "0.1.0"
+ :components
+ ((:module base :pathname "" :components
+ ((:file "abcl-asdf")))))
\ No newline at end of file
Added: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Fri Jun 17 02:25:53 2011 (r13340)
@@ -0,0 +1,32 @@
+(defpackage #:abcl-asdf
+ (:use :cl)
+ (:export #:package))
+
+(in-package :asdf-jar)
+
+(in-package :asdf)
+(defclass iri (static-class) ())
+
+(defclass mvn (iri) ())
+
+;;; We interpret compilation to ensure that load-op will succeed
+(defmethod perform ((operation compile-op) (component mvn))
+ (let ((version (component-version mvn)))
+ (mvn:satisfy (component-name mvn)
+ :version (if version version :latest))))
+
+(defmethod perform ((operation load-op) (component mvn))
+ (let ((version (component-version mvn)))
+ (java:add-to-classpath
+ (as-classpath (mvn:satisfy (component-name mvn)
+ :version (if version version :latest))))))
+
+(defun decompose (iri)
+ ;;; XXX test
+ `((:scheme :jvm)
+ (:authority :mvn)
+ (:host "log4j")
+ (:version "1.4.10")))
+
+(defun mvn:satisfy (name &key (version :latest))
+ ;;; XXX either invoke mvn in the same jvm or fork a process)
Added: trunk/abcl/contrib/abcl-asdf/tests/example.lisp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/abcl/contrib/abcl-asdf/tests/example.lisp Fri Jun 17 02:25:53 2011 (r13340)
@@ -0,0 +1,5 @@
+(require :jss)
+
+(let ((logger (#"getLogger" 'Logger (symbol-name (gensym)))))
+ (#"log" logger "Kilroy wuz here."))
+
Added: trunk/abcl/contrib/abcl-asdf/tests/log4j.asd
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/abcl/contrib/abcl-asdf/tests/log4j.asd Fri Jun 17 02:25:53 2011 (r13340)
@@ -0,0 +1,10 @@
+;;;; -*- Mode: LISP -*-
+(in-package :asdf)
+
+(defsystem :log4j
+ :components
+ ((:mvn "log4j" :version "1.4.9")
+ (:module src :pathname "")
+ ((:file "example"))))
+
+
More information about the armedbear-cvs
mailing list