[armedbear-cvs] r13342 - trunk/abcl/contrib/abcl-asdf
mevenson at common-lisp.net
mevenson at common-lisp.net
Fri Jun 17 10:11:24 UTC 2011
Author: mevenson
Date: Fri Jun 17 03:11:24 2011
New Revision: 13342
Log:
Implementation strategy: use the Maven Ant tasks to drive via build.xml.
Modified:
trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp
==============================================================================
--- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Fri Jun 17 02:34:07 2011 (r13341)
+++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Fri Jun 17 03:11:24 2011 (r13342)
@@ -2,6 +2,10 @@
(:use :cl)
(:export #:package))
+(defpackage #:mvn
+ (:use :cl)
+ (:export #:satisfy))
+
(in-package :asdf-jar)
(in-package :asdf)
@@ -9,6 +13,7 @@
(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)))
@@ -29,4 +34,46 @@
(:version "1.4.10")))
(defun mvn:satisfy (name &key (version :latest))
- ;;; XXX either invoke mvn in the same jvm or fork a process)
+ (let ((build.xml (make-temp-file)))
+ (with-open-file (s build.xml :direction :output)
+ (write-string *ant-build-template* s ))
+ (run-program
+ (format nil "ant -find ~A" build.xml))))
+
+#|
+
+Ant with Maven tasks would add the following
+
+ <artifact:dependencies pathId="abcl.dynamic.classpath">
+ <dependency groupId="junit" artifactId="junit" version="3.8.2"/>
+ </artifact:dependencies>
+|#
+
+(defvar *ant-build-template*
+ (format nil
+ "<?xml version='1.0' encoding='UTF-8'?>
+<project xmlns='antlib:org.apache.tools.ant'
+ name='abcl-mvn-~A' default='install'>
+
+ <artifact:dependencies pathId='abcl.dynamic.classpath'>
+ <dependency groupId='~A' artifactId='~A' version='~A'/>
+ </artifact:dependencies>
+
+ <path id='abcl.jar'>
+ <pathelement location='/export/home/evenson/work/abcl/dist/abcl.jar'/>
+ </path>
+
+ <target name='install'>
+ <java classname='org.armedbear.lisp.Main'>
+ <classpath refid='abcl.jar'>
+ <classpath refid='abcl.dynamic.classpath'>
+ </java>
+ </target>
+</project>
+" (symbol-name (gensym)) "junit" "junit" "3.8.2"))
+
+
+
+
+
+
More information about the armedbear-cvs
mailing list