Commit d64ed287 authored by mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

Promote ABCL-ASDF:ENSURE-MVN-VERSION as primary API that Maven can be executed.

Returns the found (MAJOR MINOR PATCH) as the second value.

Adding support for test framework (use :RT).
parent 3f22c191
......@@ -2,8 +2,8 @@
(asdf:defsystem :abcl-asdf
:author "Mark Evenson"
:version "1.1.0"
:description "<> asdf:defsystem <urn:abcl.org/release/1.1.0/contrib/abcl-asdf#1.1.0>"
:version "1.2.0"
:description "<> asdf:defsystem <urn:abcl.org/release/1.2.0/dev/contrib/abcl-asdf#1.1.0>"
:depends-on (jss)
:components
((:module packages :pathname ""
......@@ -20,25 +20,26 @@
(asdf:defsystem :abcl-asdf-test
:author "Mark Evenson"
:depends-on (abcl abcl-test-lisp abcl-asdf)
:depends-on (abcl abcl-test-lisp abcl-asdf rt)
:components ((:module tests :serial t
:components ((:file "example")
(:file "maven")
(:file "test")))))
#|
(defmethod perform ((o test-op) (c (eql (find-system 'abcl-asdf-test))))
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system 'abcl-asdf-test))))
(funcall (intern (symbol-name 'run) 'abcl-asdf-test)))
(defmethod perform ((o test-op) (c (eql (find-system 'abcl-asdf))))
(asdf:load-system :abcl-asdf-test))
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system 'abcl-asdf))))
(asdf:load-system :abcl-asdf-test)
(asdf:test-system :abcl-asdf-test))
;;; FIXME
(defmethod perform ((o test-op) (c (eql (find-system 'abcl-asdf))))
#+nil
(defmethod asdf:perform ((o asdf:test-op) (c (eql (asdf:find-system 'abcl-asdf))))
"Invoke tests with (asdf:test-system 'abcl-asdf)."
(asdf:load-system 'abcl)
(asdf:load-system 'abcl-test-lisp)
(asdf:load-system 'abcl-asdf-test)
(funcall (intern (symbol-name 'run) 'abcl-asdf-test)))
|#
......@@ -52,6 +52,8 @@ Test:
Returns the path of the Maven executable or nil if none are found.
Returns the version of Maven found as the second value.
Emits warnings if not able to find a suitable executable."
(let ((m2-home (ext:getenv "M2_HOME"))
......@@ -66,7 +68,8 @@ Emits warnings if not able to find a suitable executable."
m2-home))
(mvn (truename mvn-path)))
(if mvn
(return-from find-mvn mvn)
(values (return-from find-mvn mvn)
(ensure-mvn-version))
(warn "M2_HOME was set to '~A' in the process environment but '~A' doesn't exist."
m2-home mvn-path))))
(when (and m2 (probe-file m2))
......@@ -74,7 +77,8 @@ Emits warnings if not able to find a suitable executable."
(mvn-path (merge-pathnames mvn-executable m2))
(mvn (truename mvn-path)))
(if mvn
(return-from find-mvn mvn)
(values (return-from find-mvn mvn)
(ensure-mvn-version))
(warn "M2 was set to '~A' in the process environment but '~A' doesn't exist."
m2 mvn-path))))
(let* ((which-cmd
......@@ -100,7 +104,7 @@ Emits warnings if not able to find a suitable executable."
mvn-path e)))))
(when mvn
(return-from find-mvn mvn)))))))
(warn "Unable to locate Maven executable."))
(warn "Unable to locate Maven executable to find Maven Aether adaptors."))
(defun find-mvn-libs ()
(let ((mvn (find-mvn)))
......@@ -142,12 +146,14 @@ Emits warnings if not able to find a suitable executable."
(major (first version))
(minor (second version))
(patch (third version)))
(or
(and (>= major 3)
(>= minor 1))
(and (>= major 3)
(>= minor 0)
(>= patch 3)))))
(values
(or
(and (>= major 3)
(>= minor 1))
(and (>= major 3)
(>= minor 0)
(>= patch 3)))
(list major minor patch))))
(defparameter *init* nil)
......
......@@ -4,6 +4,9 @@
;;; Public API
#:resolve
#:ensure-mvn-version
;;; Leaning towards deprecation
#:resolve-dependencies
#:resolve-artifact
......@@ -38,5 +41,5 @@
#:*inhibit-add-to-classpath*))
(defpackage #:abcl-asdf-test
(:use :cl #+nil :abcl-test-lisp) ;;; FIXME include some sort of test framework
(:use :cl :abcl-asdf)
(:export #:run))
(in-package :cl-user)
(in-package :abcl-asdf-test)
(defun test-LOG4J.2 ()
"Output a message to the Console.
......@@ -7,6 +7,10 @@ Note: for users of SLIME, this will appear in the associated *inferior-lisp* bu
(#"configure" 'log4j.BasicConfigurator)
(#"info" (#"getRootLogger" 'log4j.Logger) "Kilroy wuz here."))
(rt:deftest LOG4j.2
(test-LOG4J.2)
t)
......
......@@ -9,22 +9,20 @@
(in-package :abcl-asdf-test)
;;;;(deftest LOG4J.1
(defun test-LOG4J.1 ()
(rt:deftest LOG4J.1
(let ((result (abcl-asdf:resolve-dependencies "log4j" "log4j")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons))))
;;; t)
(type-p result 'cons)))
t)
;;;;(deftest ABCL.1
(defun test-ABCL.1 ()
(let ((result (abcl-asdf:resolve-dependencies "org.armedbear.lisp" "abcl")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons))))
;;; t)
(rt:deftest ABCL.1
(let ((result (abcl-asdf:resolve-dependencies "org.armedbear.lisp" "abcl")))
(and result
(format *standard-output* "~&~A~%" result)
(type-p result 'cons)))
t)
(in-package :abcl-asdf-test)
(defun run (&rest args)
(abcl-rt:do-test 'test-log4j.2))
(abcl-rt:do-tests))
(rt:deftest ABCL-ASDF.MAVEN.1
(multiple-value-list (ensure-mvn-version))
(t (3 0 4)))
Supports Markdown
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