Generic FunctionPackage: ideToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1. Minimal update since 8.1 release.
8.0 version

build-project

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 embedding 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:

Automating a Project Build Using the startup.cl File

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 (ide:load-project
                   (merge-pathnames
                    "gui-builder-tutorial/final/interface-builder-tutorial.lpr"
                    (translate-logical-pathname "sys:"))
                   :compile nil))
         (destination "c:/tutdist/"))
    (ide: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 ("XX" means the version indicator, e.g. "acl81"):

"c:\Program Files\aclXX\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.

If an automated build fails to complete: An automated build might fail to complete, leaving the build console window on the screen, if you have turned on the "Enable Debugging of Build Errors" option for the project at some time on the Build tab of the Project Manager dialog. If this happens, you could either turn that option back off in the Project Manager, or else make the build script ensure that the option is off during the automated build by adding a line of code like the following to the build script just before it calls build-project:

(setf (ide:build-flags project)
      (remove :allow-build-debug (ide:build-flags project)))

Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.9.4.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1. Minimal update since 8.1 release.
8.0 version