Changeset 7784


Ignore:
Timestamp:
Nov 29, 2007, 3:00:43 PM (17 years ago)
Author:
mikel
Message:

debugging build-application

Location:
trunk/ccl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/cocoa-ide/build-application.lisp

    r7494 r7784  
    2828;;; dev-environment nibfiles.
    2929
     30#| temporarily removed for debugging
     31-------------------------------------
    3032(defun build-application (&key
    3133                          (name "MyApplication")
     
    5456      (assert (integerp autostart-swank-on-port)(autostart-swank-on-port)
    5557              "The port for :autostart-swank-on-port must be an integer or nil, not '~S'"
    56               autostart-swank-on-port)
    57       ;; if we get this far, setup the swank autostart
    58       ;; (however we're going to do that...)
    59       ))
     58              autostart-swank-on-port)))
    6059  ;;; build the application
    6160  (let* ((ide-bundle (#/mainBundle ns:ns-bundle))
     
    7574    (when nibfiles
    7675      (let ((nib-paths (mapcar #'pathname nibfiles)))
    77         (assert (and (every #'probe-file nib-paths)
    78                      (every #'directoryp nib-paths))
     76        (assert (and (every #'probe-file nib-paths))
    7977                (nibfiles)
    80                 "The nibfiles parameter must be a list of valid pathnames to existing directories")
     78                "The nibfiles parameter must be a list of valid pathnames to existing files or directories")
    8179        ;; for each input nibfile, construct the destination path and copy it to that path
    8280        ;; checking first whether doing so would clobber an existing nib. if it would,
     
    8785            (if (probe-file dest)
    8886                (error "The destination nibfile '~A' already exists" dest)
    89                 (recursive-copy-directory n dest :if-exists :overwrite))))))
     87                (if (directoryp n)
     88                    (recursive-copy-directory n dest :if-exists :overwrite)
     89                    (copy-file n dest  :if-exists :overwrite)))))))
    9090    ;; save the application image
    9191    (save-application image-path
     
    9393                      :toplevel-function toplevel-function
    9494                      :prepend-kernel t)))
     95-----------------------------------
     96temporarily removed for debugging
     97|#
     98
     99(defun build-application (&key
     100                          (name "MyApplication")
     101                          (type-string "APPL")
     102                          (creator-string "OMCL")
     103                          (directory (current-directory))
     104                          (nibfiles nil) ; a list of user-specified nibfiles
     105                                        ; to be copied into the app bundle
     106                          (main-nib-name) ; the name of the nib that is to be loaded
     107                                        ; as the app's main. this name gets written
     108                                        ; into the Info.plist on the "NSMainNibFile" key
     109                          (application-class 'cocoa-application)
     110                          (toplevel-function nil))
     111
     112  (format t "~%building application ~S..." name)
     113  ;; ------------------------------------------------------------
     114  (let* ((ide-bundle (#/mainBundle ns:ns-bundle))
     115         (ide-bundle-path-nsstring (#/bundlePath ide-bundle))
     116         (ide-bundle-path (pathname
     117                           (ensure-directory-pathname
     118                            (lisp-string-from-nsstring ide-bundle-path-nsstring))))
     119         (app-bundle (make-application-bundle name type-string creator-string directory
     120                                              :main-nib-name main-nib-name))
     121         (image-path (namestring (path app-bundle "Contents" "MacOS" name))))
     122    (recursive-copy-directory (path ide-bundle-path "Contents" "Resources/")
     123                              (path app-bundle  "Contents" "Resources/")
     124                              :if-exists :overwrite)
     125    (when nibfiles
     126      (let ((nib-paths (mapcar #'pathname nibfiles)))
     127        (assert (and (every #'probe-file nib-paths))
     128                (nibfiles)
     129                "The nibfiles parameter must be a list of valid pathnames to existing files or directories")
     130        (dolist (n nib-paths)
     131          (let ((dest (path app-bundle  "Contents" "Resources" "English.lproj/")))
     132            (copy-nibfile n dest))))))
     133  ;; ------------------------------------------------------------
     134  (format t "~%...done~%" name))
    95135
    96136
    97 
  • trunk/ccl/cocoa-ide/builder-utilities.lisp

    r7494 r7784  
    2828                   app)
    2929         app))
     30
     31(defun copy-nibfile (srcnib dest-directory)
     32  (format t "~%copying nibfile ~S to directory ~S"
     33          srcnib dest-directory)
     34  (force-output))
    3035
    3136;;; BASENAME path
  • trunk/ccl/examples/cocoa/currency-converter/currency-converter.lisp

    r7435 r7784  
    4343  (ccl::build-application :name "CurrencyConverter"
    4444                          :main-nib-name "CurrencyConverter"
    45                           :nibfiles '(#P"/Users/mikel/Valise/clozure/openmcl/example-code/currency-converter/CurrencyConverter.nib")))
     45                          :nibfiles '(#P"/usr/local/openmcl/trunk/ccl/examples/cocoa/currency-converter/CurrencyConverter.xib")))
    4646
    4747TODO NOTES:
  • trunk/ccl/lib/pathnames.lisp

    r7518 r7784  
    133133(defun recursive-copy-directory (source-path dest-path &key test (if-exists :error))
    134134  ;; TODO: Support :if-exists :supersede to blow away any files not in source dir
     135  (assert (directoryp source-path)(source-path)
     136          "source-path is not a directory in RECURSIVE-COPY-DIRECTORY")
    135137  (setq if-exists (require-type if-exists '(member :overwrite :error)))
    136138  (setq dest-path (ensure-directory-pathname dest-path))
Note: See TracChangeset for help on using the changeset viewer.