Index: /trunk/ccl/cocoa-ide/build-application.lisp
===================================================================
--- /trunk/ccl/cocoa-ide/build-application.lisp	(revision 7783)
+++ /trunk/ccl/cocoa-ide/build-application.lisp	(revision 7784)
@@ -28,4 +28,6 @@
 ;;; dev-environment nibfiles.
 
+#| temporarily removed for debugging
+-------------------------------------
 (defun build-application (&key
                           (name "MyApplication")
@@ -54,8 +56,5 @@
       (assert (integerp autostart-swank-on-port)(autostart-swank-on-port)
               "The port for :autostart-swank-on-port must be an integer or nil, not '~S'"
-              autostart-swank-on-port)
-      ;; if we get this far, setup the swank autostart
-      ;; (however we're going to do that...)
-      ))
+              autostart-swank-on-port)))
   ;;; build the application
   (let* ((ide-bundle (#/mainBundle ns:ns-bundle))
@@ -75,8 +74,7 @@
     (when nibfiles
       (let ((nib-paths (mapcar #'pathname nibfiles)))
-        (assert (and (every #'probe-file nib-paths)
-                     (every #'directoryp nib-paths))
+        (assert (and (every #'probe-file nib-paths))
                 (nibfiles)
-                "The nibfiles parameter must be a list of valid pathnames to existing directories")
+                "The nibfiles parameter must be a list of valid pathnames to existing files or directories")
         ;; for each input nibfile, construct the destination path and copy it to that path
         ;; checking first whether doing so would clobber an existing nib. if it would,
@@ -87,5 +85,7 @@
             (if (probe-file dest)
                 (error "The destination nibfile '~A' already exists" dest)
-                (recursive-copy-directory n dest :if-exists :overwrite))))))
+                (if (directoryp n)
+                    (recursive-copy-directory n dest :if-exists :overwrite)
+                    (copy-file n dest  :if-exists :overwrite)))))))
     ;; save the application image
     (save-application image-path
@@ -93,5 +93,44 @@
                       :toplevel-function toplevel-function
                       :prepend-kernel t)))
+-----------------------------------
+temporarily removed for debugging
+|#
+
+(defun build-application (&key
+                          (name "MyApplication")
+                          (type-string "APPL")
+                          (creator-string "OMCL")
+                          (directory (current-directory))
+                          (nibfiles nil) ; a list of user-specified nibfiles
+                                        ; to be copied into the app bundle
+                          (main-nib-name) ; the name of the nib that is to be loaded
+                                        ; as the app's main. this name gets written
+                                        ; into the Info.plist on the "NSMainNibFile" key
+                          (application-class 'cocoa-application)
+                          (toplevel-function nil))
+
+  (format t "~%building application ~S..." name)
+  ;; ------------------------------------------------------------
+  (let* ((ide-bundle (#/mainBundle ns:ns-bundle))
+         (ide-bundle-path-nsstring (#/bundlePath ide-bundle))
+         (ide-bundle-path (pathname 
+                           (ensure-directory-pathname 
+                            (lisp-string-from-nsstring ide-bundle-path-nsstring))))
+         (app-bundle (make-application-bundle name type-string creator-string directory
+                                              :main-nib-name main-nib-name))
+         (image-path (namestring (path app-bundle "Contents" "MacOS" name))))
+    (recursive-copy-directory (path ide-bundle-path "Contents" "Resources/")
+                              (path app-bundle  "Contents" "Resources/")
+                              :if-exists :overwrite)
+    (when nibfiles
+      (let ((nib-paths (mapcar #'pathname nibfiles)))
+        (assert (and (every #'probe-file nib-paths))
+                (nibfiles)
+                "The nibfiles parameter must be a list of valid pathnames to existing files or directories")
+        (dolist (n nib-paths)
+          (let ((dest (path app-bundle  "Contents" "Resources" "English.lproj/")))
+            (copy-nibfile n dest))))))
+  ;; ------------------------------------------------------------
+  (format t "~%...done~%" name))
 
 
-
Index: /trunk/ccl/cocoa-ide/builder-utilities.lisp
===================================================================
--- /trunk/ccl/cocoa-ide/builder-utilities.lisp	(revision 7783)
+++ /trunk/ccl/cocoa-ide/builder-utilities.lisp	(revision 7784)
@@ -28,4 +28,9 @@
 		   app)
 	 app))
+
+(defun copy-nibfile (srcnib dest-directory)
+  (format t "~%copying nibfile ~S to directory ~S"
+          srcnib dest-directory)
+  (force-output))
 
 ;;; BASENAME path
Index: /trunk/ccl/examples/cocoa/currency-converter/currency-converter.lisp
===================================================================
--- /trunk/ccl/examples/cocoa/currency-converter/currency-converter.lisp	(revision 7783)
+++ /trunk/ccl/examples/cocoa/currency-converter/currency-converter.lisp	(revision 7784)
@@ -43,5 +43,5 @@
   (ccl::build-application :name "CurrencyConverter"
                           :main-nib-name "CurrencyConverter"
-                          :nibfiles '(#P"/Users/mikel/Valise/clozure/openmcl/example-code/currency-converter/CurrencyConverter.nib")))
+                          :nibfiles '(#P"/usr/local/openmcl/trunk/ccl/examples/cocoa/currency-converter/CurrencyConverter.xib")))
 
 TODO NOTES:
Index: /trunk/ccl/lib/pathnames.lisp
===================================================================
--- /trunk/ccl/lib/pathnames.lisp	(revision 7783)
+++ /trunk/ccl/lib/pathnames.lisp	(revision 7784)
@@ -133,4 +133,6 @@
 (defun recursive-copy-directory (source-path dest-path &key test (if-exists :error))
   ;; TODO: Support :if-exists :supersede to blow away any files not in source dir
+  (assert (directoryp source-path)(source-path)
+	  "source-path is not a directory in RECURSIVE-COPY-DIRECTORY")
   (setq if-exists (require-type if-exists '(member :overwrite :error)))
   (setq dest-path (ensure-directory-pathname dest-path))
