build-project

Generic Function

Package: common-graphics

Arguments: project &key distribution-directory replace-if-exists exe-only autoload-warning completion-dialog

Calls either build-lisp-image or generate-application, passing various properties of the project as arguments in order to build a standalone executable for the project. This is the programmatic equivalent of the File | Build Project Distribution and the File | Build Project Exe menu commands. This function also emulates certain other functionality of these IDE commands that is not provided by build-lisp-image or generate-application, such as imbedding the project's icon file in the generated executable, and recompiling it with :runtime-system in the *features* list if the property's full-recompile-for-runtime-conditionalizations property is turned on. This function may be useful for automating the building of standalone executables for a project.

The arguments are:

Here's a technique to automate starting up an IDE, loading a project, generating a standalone distribution, and exiting: Place code similar to the following at the top of your startup.cl file. (If this file does not exist, simply create one. startup.cl is used here because it is loaded only after the IDE has finished coming up.) This particular example will make a distribution for the IDE's form-building tutorial.

(in-package :cg-user)

(when (member "build-tutorial" (sys:command-line-arguments
                                :application t)
              :test #'string-equal)
  (let* ((project (load-project
                   (merge-pathnames
                    "tutorial/final/interface-builder-tutorial.lpr"
                    (translate-logical-pathname "sys:"))
                   :compile nil))
         (destination "c:/tutdist/"))
    (build-project project
                   :distribution-directory destination
                   :replace-if-exists t))
  (exit))

The above code will run whenever "build-tutorial" is passed as an "application argument" in the command line that is used to start up lisp. ("Application arguments" are all those following a "--" in the command line.) Such a command line, which could either be placed in a .bat batch file to be double-clicked or be used in a Windows Start Menu command, could be as simple as this:

c:\acl6\allegro.exe -- build-tutorial

To build your own projects this way, simply replace the pathnames and command-line argument name in the sample code above, or customize it further as desired. Multiple application arguments could even be used to build the distributions for a set of projects automatically.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.