All Manuals > Delivery User Guide > 13 Example: Delivering CAPI Othello

13.1 Preparing for delivery

With our ready-written application we can move straight to delivery. But first, try the application out in an ordinary image so that you can see what it does.

To do this:

  1. Create a directory called othello and copy the example file into it.
  2. Start up LispWorks and its environment.
  3. Compile and load the example file.
    CL-USER 1 > (compile-file "othello.lisp" :load t)
    [compilation messages elided]
    
  4. Start up the application with the following form:
    CL-USER 2 > (play-othello)
    
  5. Play Othello!

Once you are familiar with this implementation of Othello, you can move on to delivery preparations.

13.1.1 Writing a delivery script

The next task is to create a delivery script. This is a Lisp file that, when loaded into the image, loads your compiled application code into the image, then calls the delivery function deliver to produce a standalone image.

The first delivery should be at delivery level 0. A successful delivery at this level proves that the code is suitable for delivery as a standalone application. After assuring yourself of this, you can look into removing code from the image to make it smaller.

If the delivered image is small enough for your purposes, there is no need to pursue a smaller image. An application delivered at level 0 contains a lot more in the way of debugging information and aids, and so is in some ways preferable to a leaner image.

The startup function in the Othello game is cl-user::play-othello. The initial delivery script therefore looks like this:

(in-package "CL-USER")
(load-all-patches)
;; Load the compiled file othello. Should be in the same 
;; directory as this script.
(load (current-pathname "othello" nil))
;; Now deliver the application itself to create the image othello
(deliver 'play-othello "othello" 0 :interface :capi)

Save this script in the newly created othello directory as script.lisp.

Note: Alternatively you can create a delivery script using the Application Builder tool in the LispWorks IDE. The Application Builder is a windowing interface offering another way to performs the steps described the following sections. For full instructions on using the Application Builder tool, see the LispWorks IDE User Guide.

The remainder of this section shows you how to complete delivery of the othello application using a command shell.


Delivery User Guide - 01 Dec 2021 19:35:06