source: branches/ide-1.0/ccl/cocoa-ide/build-application.lisp @ 6967

Last change on this file since 6967 was 6967, checked in by mikel, 13 years ago

some experimentation with initialization and swank

File size: 2.1 KB
Line 
1;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: cl-user -*-
2;;;; ***********************************************************************
3;;;; FILE IDENTIFICATION
4;;;;
5;;;; Name:          build-application.lisp
6;;;; Version:       0.9
7;;;; Project:       Cocoa application builder
8;;;; Purpose:       the in-process application builder
9;;;;
10;;;; ***********************************************************************
11
12(require "builder-utilities")
13
14(in-package :ccl)
15
16(defun build-application (&key
17                          (name "MyApplication")
18                          (type-string "APPL")
19                          (creator-string "OMCL")
20                          (directory (current-directory))
21                          (application-class 'cocoa-application)
22                          (toplevel-function nil)
23                          (swank-loader nil)
24                          (autostart-swank-port nil))
25  ;;; if the path to swank-loader.lisp is given, then load
26  ;;; swank before building the application
27  (when swank-loader
28    (assert (probe-file swank-loader)()
29            "Swank loader not found at path '~A'" swank-loader)
30    (load swank-loader))
31  ;;; build the application
32  (let* ((ide-bundle (#/mainBundle ns:ns-bundle))
33         (ide-bundle-path-nsstring (#/bundlePath ide-bundle))
34         (ide-bundle-path (pathname 
35                           (ensure-directory-pathname 
36                            (lisp-string-from-nsstring ide-bundle-path-nsstring))))
37         (app-bundle (make-application-bundle name type-string creator-string directory))
38         (image-path (namestring (path app-bundle "Contents" "MacOS" name))))
39    ;; copy IDE resources into the application bundle
40    (recursive-copy-directory (path ide-bundle-path "Contents" "Resources/")
41                              (path app-bundle  "Contents" "Resources/"))
42    ;; save the application image
43    (save-application image-path
44                      :application-class application-class
45                      :toplevel-function toplevel-function
46                      :prepend-kernel t)))
47
48
49
Note: See TracBrowser for help on using the repository browser.