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

abcl-contrib: Fix whitespace.

parent bf90b9ca
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
(require :asdf) (require :asdf)
(defconstant +get-classloader+ (java:jmethod "java.lang.Class" "getClassLoader")) (defconstant +get-classloader+
(java:jmethod "java.lang.Class" "getClassLoader"))
(defun boot-classloader () (defun boot-classloader ()
(let ((boot-class (java:jclass "org.armedbear.lisp.Main"))) (let ((boot-class (java:jclass "org.armedbear.lisp.Main")))
(java:jcall +get-classloader+ boot-class))) (java:jcall +get-classloader+ boot-class)))
(defun system-jar-p (p) (defun system-jar-p (p)
(named-jar-p "abcl" p)) (named-jar-p "abcl" p))
...@@ -16,16 +18,16 @@ ...@@ -16,16 +18,16 @@
(defun named-jar-p (name p) (defun named-jar-p (name p)
(and (pathnamep p) (and (pathnamep p)
(equal (pathname-type p) "jar") (equal (pathname-type p) "jar")
(or (or
(java:jstatic "matches" (java:jstatic "matches"
"java.util.regex.Pattern" "java.util.regex.Pattern"
(concatenate 'string name "(-[0-9]\\.[0-9]\\.[0-9]([+~-].+)?)?") (concatenate 'string name "(-[0-9]\\.[0-9]\\.[0-9]([+~-].+)?)?")
(pathname-name p)) (pathname-name p))
(java:jstatic "matches" (java:jstatic "matches"
"java.util.regex.Pattern" "java.util.regex.Pattern"
(concatenate 'string name "(-[0-9]\\.[0-9]\\.[0-9]\\.[0-9]([+~-]+)?)?") (concatenate 'string name "(-[0-9]\\.[0-9]\\.[0-9]\\.[0-9]([+~-]+)?)?")
(pathname-name p))) (pathname-name p)))
(make-pathname :defaults p :name name))) (make-pathname :defaults p :name name)))
(defun find-system () (defun find-system ()
"Find the location of the system. "Find the location of the system.
...@@ -33,16 +35,16 @@ ...@@ -33,16 +35,16 @@
Used to determine relative pathname to find 'abcl-contrib.jar'." Used to determine relative pathname to find 'abcl-contrib.jar'."
(or (or
(ignore-errors (ignore-errors
(find-system-jar)) (find-system-jar))
(ignore-errors (ignore-errors
(some (some
(lambda (u) (lambda (u)
(probe-file (make-pathname (probe-file (make-pathname
:defaults (java:jcall "toString" u) :defaults (java:jcall "toString" u)
:name "abcl"))) :name "abcl")))
(java:jcall "getURLs" (boot-classloader)))) (java:jcall "getURLs" (boot-classloader))))
(ignore-errors (ignore-errors
#p"http://abcl.org/releases/current/abcl.jar"))) #p"http://abcl.org/releases/current/abcl.jar")))
(defun find-system-jar () (defun find-system-jar ()
"Return the pathname of the system jar, one of `abcl.jar` or `abcl-m.n.p.jar` or `abcl-m.n.p[.~-]something.jar`." "Return the pathname of the system jar, one of `abcl.jar` or `abcl-m.n.p.jar` or `abcl-m.n.p[.~-]something.jar`."
...@@ -53,53 +55,53 @@ Used to determine relative pathname to find 'abcl-contrib.jar'." ...@@ -53,53 +55,53 @@ Used to determine relative pathname to find 'abcl-contrib.jar'."
(defvar *abcl-contrib* nil (defvar *abcl-contrib* nil
"Pathname of the ABCL contrib. "Pathname of the ABCL contrib.
Initialized via SYSTEM:FIND-CONTRIB") Initialized via SYSTEM:FIND-CONTRIB.")
(defparameter *verbose* t) (defparameter *verbose* t)
(defun add-contrib (abcl-contrib-jar) (defun add-contrib (abcl-contrib-jar)
"Introspects ABCL-CONTRIB-JAR for asdf systems to add to ASDF:*CENTRAL-REGISTRY*" "Introspects ABCL-CONTRIB-JAR for asdf systems to add to ASDF:*CENTRAL-REGISTRY*"
(when abcl-contrib-jar (when abcl-contrib-jar
(dolist (asdf-file (dolist (asdf-file
(directory (make-pathname :device (list abcl-contrib-jar) (directory (make-pathname :device (list abcl-contrib-jar)
:directory '(:absolute :wild) :directory '(:absolute :wild)
:name :wild :name :wild
:type "asd"))) :type "asd")))
(let ((asdf-directory (make-pathname :defaults asdf-file :name nil :type nil))) (let ((asdf-directory (make-pathname :defaults asdf-file :name nil :type nil)))
(unless (find asdf-directory asdf:*central-registry* :test #'equal) (unless (find asdf-directory asdf:*central-registry* :test #'equal)
(push asdf-directory asdf:*central-registry*) (push asdf-directory asdf:*central-registry*)
(format *verbose* "~&Added ~A to ASDF.~&" asdf-directory)))))) (format *verbose* "~&Added ~A to ASDF.~&" asdf-directory))))))
(defun find-and-add-contrib (&key (verbose nil)) (defun find-and-add-contrib (&key (verbose nil))
"Attempt to find the ABCL contrib jar and add its contents to ASDF. "Attempt to find the ABCL contrib jar and add its contents to ASDF.
Returns the pathname of the contrib if it can be found." Returns the pathname of the contrib if it can be found."
(if *abcl-contrib* (if *abcl-contrib*
(format verbose "~&Using already initialized value of abcl-contrib:~&'~A'.~%" (format verbose "~&Using already initialized value of abcl-contrib:~&'~A'.~%"
*abcl-contrib*) *abcl-contrib*)
(progn (progn
(setf *abcl-contrib* (find-contrib)) (setf *abcl-contrib* (find-contrib))
(format verbose "~&Using probed value of abcl-contrib:~&'~A'.~%" (format verbose "~&Using probed value of abcl-contrib:~&'~A'.~%"
*abcl-contrib*))) *abcl-contrib*)))
(add-contrib *abcl-contrib*)) (add-contrib *abcl-contrib*))
(defun find-contrib () (defun find-contrib ()
"Introspect runtime classpaths to find a loadable ABCL-CONTRIB." "Introspect runtime classpaths to find a loadable ABCL-CONTRIB."
(or (or (ignore-errors
(ignore-errors (when (find-system-jar) (when (find-system-jar)
(probe-file (probe-file
(make-pathname :defaults (find-system-jar) (make-pathname :defaults (find-system-jar)
:name "abcl-contrib")))) :name "abcl-contrib"))))
(some (some
(lambda (u) (lambda (u)
(probe-file (make-pathname (probe-file (make-pathname
:defaults (java:jcall "toString" u) :defaults (java:jcall "toString" u)
:name "abcl-contrib"))) :name "abcl-contrib")))
(java:jcall "getURLs" (boot-classloader))))) (java:jcall "getURLs" (boot-classloader)))))
(export `(find-system (export `(find-system
find-contrib find-contrib
*abcl-contrib*)) *abcl-contrib*))
(when (find-and-add-contrib :verbose t) (when (find-and-add-contrib :verbose t)
(provide :abcl-contrib)) (provide :abcl-contrib))
...@@ -109,5 +111,5 @@ Returns the pathname of the contrib if it can be found." ...@@ -109,5 +111,5 @@ Returns the pathname of the contrib if it can be found."
Markdown is supported
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