Changeset 9827


Ignore:
Timestamp:
Jun 24, 2008, 2:49:38 PM (11 years ago)
Author:
mikel
Message:

adding support for doctype dictionaries in build-application

Location:
trunk/source/cocoa-ide
Files:
2 edited

Legend:

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

    r9477 r9827  
    7777                      :prepend-kernel t)))
    7878
    79 ;;; BUILD-APPLICATION-PROJECT
    80 ;;; ------------------------------------------------------------------------
    81 ;;; Runs a separate process that builds an application bundle and
    82 ;;; saves an executable lisp image into it. Populates the bundle
    83 ;;; directory with the files needed to run the lisp image when the
    84 ;;; bundle is double-clicked. Pass a lisp source file as the value for
    85 ;;; :project-file; the builder loads that file before saving the
    86 ;;; application. The intended use of the project file is to load any
    87 ;;; Lisp code that should be a part of the image before saving it.
    8879
    89 (defun build-application-project (&key
    90                                   (name $default-application-bundle-name)
    91                                   (project-file nil)
    92                                   (type-string $default-application-type-string)
    93                                   (creator-string $default-application-creator-string)
    94                                   (directory (current-directory))
    95                                   (copy-ide-resources t) ; whether to copy the IDE's resources
    96                                   (info-plist nil) ; optional user-defined info-plist
    97                                   (nibfiles nil) ; a list of user-specified nibfiles
    98                                         ; to be copied into the app bundle
    99                                   (main-nib-name) ; the name of the nib that is to be loaded
    100                                         ; as the app's main. this name gets written
    101                                         ; into the Info.plist on the "NSMainNibFile" key
    102                                   (application-class 'gui::cocoa-application)
    103                                   (toplevel-function nil))
    104   ;; 1. build the command line for the remote ccl process
    105   ;;  - require all the needed subsystems:
    106   ;;    - cocoa
    107   ;;    - builder-utilities
    108   ;;    - build-application
    109   ;;  - load the project file
    110   ;;  - call build-application
    111   ;; 2. run the remote process with the constructed command line
    112   )
    11380
    11481#|
  • trunk/source/cocoa-ide/builder-utilities.lisp

    r9822 r9827  
    7979(defparameter $ns-principal-class-key #@"NSPrincipalClass")
    8080(defparameter $default-info-plist-principal-class "LispApplication")
     81
     82;;; keys for document-types dicts
     83(defparameter $cfbundle-type-extensions-key #@"CFBundleTypeExtensions")
     84(defparameter $cfbundle-type-icon-file-key #@"CFBundleTypeIconFile")
     85(defparameter $cfbundle-type-mime-types-key #@"CFBundleTypeMIMETypes")
     86(defparameter $cfbundle-type-name-key #@"CFBundleTypeName")
     87(defparameter $cfbundle-type-ostypes-key #@"CFBundleTypeOSTypes")
     88(defparameter $cfbundle-type-role-key #@"CFBundleTypeRole")
     89(defparameter $ls-item-content-types-key #@"LSItemContentTypes")
     90(defparameter $ls-type-is-package-key #@"LSTypeIsPackage")
     91(defparameter $ns-document-class-key #@"NSDocumentClass")
     92(defparameter $ns-exportable-as-key #@"NSExportableAs")
    8193
    8294;;; COPY-NIBFILE (srcnib dest-directory &key (if-exists :overwrite))
     
    197209                                   +null-ptr+))
    198210
     211(defun make-doctype-dict (&key
     212                          (extensions nil)
     213                          (icon-file "Icons.icns")
     214                          (mime-types nil)
     215                          (type-name nil)
     216                          (ostypes nil)
     217                          (role nil)
     218                          (ls-item-content-types nil)
     219                          (bundlep nil)
     220                          (document-class nil)
     221                          (exportable-as nil))
     222  ;; certain values are required
     223  (assert (or ls-item-content-types extensions mime-types ostypes)
     224          ()
     225          "You must supply a list of strings as the value for one of the keywords :ls-item-content-types, :extensions, :mime-types, or :ostypes")
     226  (assert type-name () "You must supply a string as a value for the keyword :type-name")
     227  (assert role ()
     228          "You must supply one of the strings \"Editor\", \"Viewer\", \"Shell\", or \"None\" as a value for the keyword :role")
     229  (assert document-class ()
     230          "You must supply the name of an NSDocument subclass (as a string) as the value of the keyword :document-class")
     231  )
     232
    199233;;; READ-INFO-PLIST info-path
    200234;;; ------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.