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

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

added code to test for swank autostart, and to support correction of errors in the swank-loader and autostart parameters

File size: 2.6 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-on-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)(swank-loader)
29            "Swank loader not found at path '~A'" swank-loader)
30    (load swank-loader)
31    ;; when autostart-swank-on-port is also given, setup
32    ;; swank to start up on launch (still don't know how
33    ;; we're actually going to do this)
34    (when autostart-swank-on-port
35      (assert (integerp autostart-swank-on-port)(autostart-swank-on-port)
36              "The port for :autostart-swank-on-port must be an integer or nil, not '~S'"
37              autostart-swank-on-port)
38      ;; if we get this far, setup the swank autostart
39      ;; (however we're going to do that...)
40      ))
41  ;;; build the application
42  (let* ((ide-bundle (#/mainBundle ns:ns-bundle))
43         (ide-bundle-path-nsstring (#/bundlePath ide-bundle))
44         (ide-bundle-path (pathname 
45                           (ensure-directory-pathname 
46                            (lisp-string-from-nsstring ide-bundle-path-nsstring))))
47         (app-bundle (make-application-bundle name type-string creator-string directory))
48         (image-path (namestring (path app-bundle "Contents" "MacOS" name))))
49    ;; copy IDE resources into the application bundle
50    (recursive-copy-directory (path ide-bundle-path "Contents" "Resources/")
51                              (path app-bundle  "Contents" "Resources/"))
52    ;; save the application image
53    (save-application image-path
54                      :application-class application-class
55                      :toplevel-function toplevel-function
56                      :prepend-kernel t)))
57
58
59
Note: See TracBrowser for help on using the repository browser.