Changeset 11673


Ignore:
Timestamp:
02/20/09 19:56:16 (13 years ago)
Author:
ehuelsmann
Message:

Trade with-current-directory macro for more lispy syntax.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build-abcl.lisp

    r11660 r11673  
    5454  (if (eq *platform* :windows) #\; #\:))
    5555
    56 (defmacro with-current-directory ((directory) &body body)
    57   `(let ((*default-pathname-defaults* ,directory)
    58          #+clisp
    59          (old-directory (ext:cd)))
    60      #+clisp
    61      (ext:cd ,directory)
    62      (unwind-protect
    63          (progn ,@body)
    64        #+clisp
    65        (ext:cd old-directory)
    66        )))
    6756
    6857#+sbcl
     
    257246(defun make-classes (force batch)
    258247  (let* ((source-files
    259           (append (with-current-directory (*abcl-dir*)
    260                     (directory "*.java"))
    261                   (with-current-directory ((merge-pathnames "util/" *abcl-dir*))
    262                     (directory "*.java"))))
     248          (mapcan #'(lambda (default)
     249                      (directory (merge-pathnames "*.java" default)))
     250                  (list *abcl-dir*
     251                        (merge-pathnames "util/" *abcl-dir*))))
    263252         (to-do ()))
    264253    (if force
     
    438427
    439428(defun clean ()
    440   (with-current-directory (*build-root*)
    441     (delete-files (list "abcl.jar")))
    442   (with-current-directory (*abcl-dir*)
    443     (delete-files (directory "*.class"))
    444     (delete-files (directory "*.abcl"))
    445     (delete-files (directory "*.cls"))
    446     (delete-files '("native.h" "libabcl.so" "build")))
    447   (with-current-directory ((merge-pathnames "java/awt/" *abcl-dir*))
    448     (delete-files (directory "*.class"))))
     429  (dolist (f (list (list *build-root* "abcl.jar")
     430                   (list *abcl-dir* "*.class" "*.abcl" "*.cls"
     431                                    "native.h" "libabcl.so" "build")
     432                   (list (merge-pathnames "java/awt/" *abcl-dir*)
     433                         "*.class")))
     434    (let ((default (car f)))
     435      (delete-files (mapcan #'(lambda (name)
     436                                (directory (merge-pathnames name default)))
     437                            (cdr f))))))
    449438
    450439(defun build-abcl (&key force
Note: See TracChangeset for help on using the changeset viewer.