[Openmcl-cvs-notifications] r9827 - in /trunk/source/cocoa-ide: build-application.lisp builder-utilities.lisp

mikel at clozure.com mikel at clozure.com
Tue Jun 24 10:49:39 EDT 2008


Author: mikel
Date: Tue Jun 24 10:49:38 2008
New Revision: 9827

Log:
adding support for doctype dictionaries in build-application

Modified:
    trunk/source/cocoa-ide/build-application.lisp
    trunk/source/cocoa-ide/builder-utilities.lisp

Modified: trunk/source/cocoa-ide/build-application.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/cocoa-ide/build-application.lisp (original)
+++ trunk/source/cocoa-ide/build-application.lisp Tue Jun 24 10:49:38 2008
@@ -76,40 +76,7 @@
                       :toplevel-function toplevel-function
                       :prepend-kernel t)))
 =

-;;; BUILD-APPLICATION-PROJECT
-;;; ----------------------------------------------------------------------=
--
-;;; Runs a separate process that builds an application bundle and
-;;; saves an executable lisp image into it. Populates the bundle
-;;; directory with the files needed to run the lisp image when the
-;;; bundle is double-clicked. Pass a lisp source file as the value for
-;;; :project-file; the builder loads that file before saving the
-;;; application. The intended use of the project file is to load any
-;;; Lisp code that should be a part of the image before saving it.
 =

-(defun build-application-project (&key
-                                  (name $default-application-bundle-name)
-                                  (project-file nil)
-                                  (type-string $default-application-type-s=
tring)
-                                  (creator-string $default-application-cre=
ator-string)
-                                  (directory (current-directory))
-                                  (copy-ide-resources t) ; whether to copy=
 the IDE's resources
-                                  (info-plist nil) ; optional user-defined=
 info-plist
-                                  (nibfiles nil) ; a list of user-specifie=
d nibfiles
-                                        ; to be copied into the app bundle
-                                  (main-nib-name) ; the name of the nib th=
at is to be loaded
-                                        ; as the app's main. this name get=
s written
-                                        ; into the Info.plist on the "NSMa=
inNibFile" key
-                                  (application-class 'gui::cocoa-applicati=
on)
-                                  (toplevel-function nil))
-  ;; 1. build the command line for the remote ccl process
-  ;;  - require all the needed subsystems:
-  ;;    - cocoa
-  ;;    - builder-utilities
-  ;;    - build-application
-  ;;  - load the project file
-  ;;  - call build-application
-  ;; 2. run the remote process with the constructed command line
-  )
 =

 #|
 (require :build-application)

Modified: trunk/source/cocoa-ide/builder-utilities.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/cocoa-ide/builder-utilities.lisp (original)
+++ trunk/source/cocoa-ide/builder-utilities.lisp Tue Jun 24 10:49:38 2008
@@ -78,6 +78,18 @@
 =

 (defparameter $ns-principal-class-key #@"NSPrincipalClass")
 (defparameter $default-info-plist-principal-class "LispApplication")
+
+;;; keys for document-types dicts
+(defparameter $cfbundle-type-extensions-key #@"CFBundleTypeExtensions")
+(defparameter $cfbundle-type-icon-file-key #@"CFBundleTypeIconFile")
+(defparameter $cfbundle-type-mime-types-key #@"CFBundleTypeMIMETypes")
+(defparameter $cfbundle-type-name-key #@"CFBundleTypeName")
+(defparameter $cfbundle-type-ostypes-key #@"CFBundleTypeOSTypes")
+(defparameter $cfbundle-type-role-key #@"CFBundleTypeRole")
+(defparameter $ls-item-content-types-key #@"LSItemContentTypes")
+(defparameter $ls-type-is-package-key #@"LSTypeIsPackage")
+(defparameter $ns-document-class-key #@"NSDocumentClass")
+(defparameter $ns-exportable-as-key #@"NSExportableAs")
 =

 ;;; COPY-NIBFILE (srcnib dest-directory &key (if-exists :overwrite))
 ;;; ----------------------------------------------------------------------=
--
@@ -196,6 +208,28 @@
                                    (%temp-nsstring principal-class) $ns-pr=
incipal-class-key
                                    +null-ptr+))
 =

+(defun make-doctype-dict (&key
+                          (extensions nil)
+                          (icon-file "Icons.icns")
+                          (mime-types nil)
+                          (type-name nil)
+                          (ostypes nil)
+                          (role nil)
+                          (ls-item-content-types nil)
+                          (bundlep nil)
+                          (document-class nil)
+                          (exportable-as nil))
+  ;; certain values are required
+  (assert (or ls-item-content-types extensions mime-types ostypes)
+          ()
+          "You must supply a list of strings as the value for one of the k=
eywords :ls-item-content-types, :extensions, :mime-types, or :ostypes")
+  (assert type-name () "You must supply a string as a value for the keywor=
d :type-name")
+  (assert role () =

+          "You must supply one of the strings \"Editor\", \"Viewer\", \"Sh=
ell\", or \"None\" as a value for the keyword :role")
+  (assert document-class ()
+          "You must supply the name of an NSDocument subclass (as a string=
) as the value of the keyword :document-class")
+  )
+
 ;;; READ-INFO-PLIST info-path
 ;;; ----------------------------------------------------------------------=
--
 ;;; returns a newly-created NSDictionary with the contents



More information about the Openmcl-cvs-notifications mailing list