Changeset 7784
- Timestamp:
- Nov 29, 2007, 3:00:43 PM (17 years ago)
- Location:
- trunk/ccl
- Files:
-
- 4 edited
-
cocoa-ide/build-application.lisp (modified) (5 diffs)
-
cocoa-ide/builder-utilities.lisp (modified) (1 diff)
-
examples/cocoa/currency-converter/currency-converter.lisp (modified) (1 diff)
-
lib/pathnames.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/cocoa-ide/build-application.lisp
r7494 r7784 28 28 ;;; dev-environment nibfiles. 29 29 30 #| temporarily removed for debugging 31 ------------------------------------- 30 32 (defun build-application (&key 31 33 (name "MyApplication") … … 54 56 (assert (integerp autostart-swank-on-port)(autostart-swank-on-port) 55 57 "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))) 60 59 ;;; build the application 61 60 (let* ((ide-bundle (#/mainBundle ns:ns-bundle)) … … 75 74 (when nibfiles 76 75 (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)) 79 77 (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") 81 79 ;; for each input nibfile, construct the destination path and copy it to that path 82 80 ;; checking first whether doing so would clobber an existing nib. if it would, … … 87 85 (if (probe-file dest) 88 86 (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))))))) 90 90 ;; save the application image 91 91 (save-application image-path … … 93 93 :toplevel-function toplevel-function 94 94 :prepend-kernel t))) 95 ----------------------------------- 96 temporarily 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)) 95 135 96 136 97 -
trunk/ccl/cocoa-ide/builder-utilities.lisp
r7494 r7784 28 28 app) 29 29 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)) 30 35 31 36 ;;; BASENAME path -
trunk/ccl/examples/cocoa/currency-converter/currency-converter.lisp
r7435 r7784 43 43 (ccl::build-application :name "CurrencyConverter" 44 44 :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"))) 46 46 47 47 TODO NOTES: -
trunk/ccl/lib/pathnames.lisp
r7518 r7784 133 133 (defun recursive-copy-directory (source-path dest-path &key test (if-exists :error)) 134 134 ;; 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") 135 137 (setq if-exists (require-type if-exists '(member :overwrite :error))) 136 138 (setq dest-path (ensure-directory-pathname dest-path))
Note:
See TracChangeset
for help on using the changeset viewer.
