diff --git a/contrib/abcl-build/build/abcl-build.lisp b/contrib/abcl-build/build/abcl-build.lisp index e85db3faf4a7ed6d56e1adfa1c00f0e8a759d4da..06d0bc2300b0e00ffe36ab518c25fa9dbe6f8262 100644 --- a/contrib/abcl-build/build/abcl-build.lisp +++ b/contrib/abcl-build/build/abcl-build.lisp @@ -3,13 +3,22 @@ (defun make-dist (version-string) (warn "Unimplemented")) -(defun build-abcl (&key force - (batch t) - compile-system - jar - clean - full) - (warn "Unimplemented")) +(defun build-abcl (&key + force ;; DEPRECATED: not sure of meaning in new underlying API + (batch t) ;; DEPRECATED: lack of meaning + compile-system ;; DEPRECATED: COMPILE-SYSTEM is always invoked + jar ;; DEPRECATED: a jar archive is always built + clean + full) ;; DEPRECATED: a full build is always performed + (unless (ignore-errors (asdf:find-system :abcl)) + (return-from build-abcl + nil)) + (let ((targets '("abcl"))) + (when clean + (push "abcl.clean" targets)) + (ant/call (asdf:system-relative-pathname :abcl "build.xml") + (nreverse targets)))) + diff --git a/contrib/abcl-build/build/ant.lisp b/contrib/abcl-build/build/ant.lisp index d200106b7a97d06e9b10aec588b24511719c22ae..c5b13d8defa9638fb4ec8caca3fab94ff61b8a3b 100644 --- a/contrib/abcl-build/build/ant.lisp +++ b/contrib/abcl-build/build/ant.lisp @@ -10,18 +10,29 @@ #+(or) ;; need apache-ant-1.9 for JVM version 49.0 #p"http://www-eu.apache.org/dist/ant/binaries/apache-ant-1.10.1-bin.zip") +(defun xdg/ant-executable () + (xdg/executable (ant-zip-uri) "bin/ant")) + +#+(or) (defun xdg/ant-executable () (let* ((uri (ant-zip-uri)) (directory (xdg/abcl-install-root uri)) (ant-root-name (let ((name (pathname-name uri))) (subseq name 0 (- (length name) (length "-bin"))))) (ant-home (merge-pathnames (make-pathname :directory `(:relative ,ant-root-name)) - directory))) + directory)) + (ant (merge-pathnames #p"bin/ant" ant-home)) + result) + (dolist (p (possible-executable-names ant)) + (when (probe-file p) + (return-from xdg/ant-executable + (values + (probe-file p) + ant)))) + ;; failure (values - (probe-file - (localize-executable-name - (merge-pathnames #p"bin/ant" ant-home))) - ant-home))) + nil + ant))) (defun ant/install () (unless (xdg/ant-executable) diff --git a/contrib/abcl-build/build/install.lisp b/contrib/abcl-build/build/install.lisp index 25dafadfbca1ad55832a7d280721798c3081a3c7..8cdd6fe2782b35b49a5c14dc893f1814bab1496a 100644 --- a/contrib/abcl-build/build/install.lisp +++ b/contrib/abcl-build/build/install.lisp @@ -31,7 +31,7 @@ (let ((archive (download uri)) (root - (xdg/abcl-download-root :for-uri uri))) + (xdg/abcl-install-root uri))) (ensure-directories-exist root) (sys:unzip archive root) (values @@ -51,6 +51,27 @@ Returns the local pathname of the download artifact." destination) destination) +(defun xdg/executable (uri relative-path) + (let* ((directory (xdg/abcl-install-root uri)) + (root (let ((name (pathname-name uri))) + (subseq name 0 (- (length name) (length "-bin"))))) + (home (merge-pathnames (make-pathname :directory `(:relative ,root)) + directory)) + (path (merge-pathnames relative-path home))) + (dolist (p (possible-executable-names path)) + (when (probe-file p) + (return-from xdg/executable + (values + (probe-file p) + path)))) + ;; failure + (values + nil + path))) + + + + diff --git a/contrib/abcl-build/build/maven.lisp b/contrib/abcl-build/build/maven.lisp index d1d729b6393abf15bee3d2920c89de50de20d328..307ca461f20c8c2d0879638cedd06669243bc957 100644 --- a/contrib/abcl-build/build/maven.lisp +++ b/contrib/abcl-build/build/maven.lisp @@ -4,10 +4,7 @@ #p"http://www-eu.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.zip") (defun xdg/mvn-executable () - (probe-file - (localize-executable-name - (merge-pathnames "bin/mvn" - (xdg/abcl-install-root (maven-zip-uri)))))) + (xdg/executable (maven-zip-uri) "bin/mvn")) (defparameter *maven-install-root* nil) diff --git a/contrib/abcl-build/build/t/abcl-build.lisp b/contrib/abcl-build/build/t/abcl-build.lisp index 0fb22bb672f11eaa14127d74abb86e5b91085f8b..0e93b7d217cd074d2ad16879b45a2da89e61f186 100644 --- a/contrib/abcl-build/build/t/abcl-build.lisp +++ b/contrib/abcl-build/build/t/abcl-build.lisp @@ -7,7 +7,6 @@ (prove:ok (abcl-build:build-abcl) "Testing BUILD-ABCL…") - (prove:diag ) (prove:ok (abcl-build:make-dist (format nil "test-" (random (expt 2 32)))) "Testing MAKE-DIST…") diff --git a/contrib/abcl-build/build/t/ant.lisp b/contrib/abcl-build/build/t/ant.lisp index a1aa068a8f8c5ac78d74ae04f1496ba5d6467cac..4704f122f15b73c15919249ac69ad21c500f7f6e 100644 --- a/contrib/abcl-build/build/t/ant.lisp +++ b/contrib/abcl-build/build/t/ant.lisp @@ -1,8 +1,9 @@ (in-package :abcl/build/t) (prove:plan 1) -(prove:diag "Testing private installation of Ant…") -(prove:ok (build-abcl:ant/install)) +(prove:ok + (build-abcl:ant/install) + "Testing ABCL-specific Ant installation of Ant into XDG hierarchy…") (if (not (ignore-errors (asdf:find-system :abcl))) (prove:diag "Unable to find 'abcl.asd'.~&Enable ASDF to find 'abcl.asd' by adding symlink to ~~/common-lisp/ to ABCL source directory.") diff --git a/contrib/abcl-build/build/t/maven.lisp b/contrib/abcl-build/build/t/maven.lisp index e3876ab3a6f527b91acd88d470b6cf6d8c7fdf01..7c4dd7724ffff497181372c05b1f09e2e28658ea 100644 --- a/contrib/abcl-build/build/t/maven.lisp +++ b/contrib/abcl-build/build/t/maven.lisp @@ -1,9 +1,9 @@ (in-package :abcl/build/t) (prove:plan 1) -(prove:diag "Testing private installation of Maven…") (prove:ok - (abcl/build:mvn/install)) + (abcl/build:mvn/install) + "Testing ABCL-specific Ant installation of Maven into XDG hierarchy…") (if (not (ignore-errors (asdf:find-system :abcl))) (prove:diag "Unable to find 'abcl.asd'.~&Enable ASDF to find 'abcl.asd' by adding symlink to ~~/common-lisp/ to ABCL source directory.") diff --git a/contrib/abcl-build/build/t/util.lisp b/contrib/abcl-build/build/t/util.lisp index 20a3d9658a0579aaa233e4826c21a0786d424793..54ca1add4467d7bdcc15d2800754c3d321a510ef 100644 --- a/contrib/abcl-build/build/t/util.lisp +++ b/contrib/abcl-build/build/t/util.lisp @@ -1,14 +1,12 @@ (in-package :abcl/build/t) -(let ((possible-executables - (abcl/build:possible-executable-names "java"))) - (prove:plan 1) - (prove:is-type possible-executables - 'cons)) +(prove:plan 1) +(prove:is-type (abcl/build:possible-executable-names "java") + 'cons) (prove:plan 1) (prove:is (length (abcl/build:split-string "one.two.three." #\.)) - 3) + 4) (prove:finalize)