Alpha Technical Note #001
How to update the core


Introduction

This note is intended for developers who want to update the core of the application each time a modification concerning the core sources has been committed. As you will see, this can be done very easily with a single command from a terminal window. So, no need anymore to wait for the next release...
This note is not about compiling the application from scratch: this has been explained in the following help page
Compiling Alpha and precisely is not necessary here. Since we now have preview binaries for Alpha, there is no need to recompile everything.
Ditto, this note is not about updating the AlphaTcl library from the Subversion repository. This can be done as usual using the commands of the Alpha ↣ Global Setup ↣ Update AlphaTcl submenu. See also TN #3: How to update the AlphaTcl library ?.

Requisites

Xcode

You need to have Xcode installed on your machine in order to have all the necessary compiling environment. Go to the Xcode download page at the Apple Developer Site to get and install Xcode. Xcode is obtained via the AppStore and is free.
You also need to install the command line developer tools which are not included in the Xcode package. On Mac OS X 10.9 (Mavericks), you just have to type the following command in a Terminal window to get them (once Xcode itself is installed):
    xcode-select --install

Working copy

Finally, you must download a working copy of the Alpha sources if you do not have one already. To do so, first create a directory named Alpha (or any name you want) somewhere on your machine. Now open a Terminal window and change directory to be inside the Alpha folder you just created. Then execute the following command:
    svn checkout https://svn.code.sf.net/p/alphacocoa/code/Current 

Build folders

Now, here is the important trick in order not to compile everything from scratch. Inside the Current folder, create a new subfolder named build containing itself two subfolders named Debug and Release respectively. In these Debug and Release folders, put a copy of a prebuilt Alpha (you can get the latest development binary from the download section at SourceForge).
The build/Debug and build/Release folders are the destination expected by the Xcode project when you compile the binary: which one is actually used depends on the build configuration set in the Xcode project. All development binaries during the alpha and beta stages were built with the Debug configuration, but since version 9.0rc1 (first release candidate of the final product, as of Feb' 2018) the Release configuration is now used.
To make things clear, here is the structure of this build folder:
    --- Current
       |--- build
           |--- Debug
           |   |--- Alpha.app
           |--- Release
               |--- Alpha.app
The build folder is at the same level as the Core, Doc, Libraries, Tests, Tools and Utils folders.

Remark

It is very important that you put a copy of a prebuilt Alpha in the build/Debug and build/Release folders. The whole point of this note is precisely to avoid rebuilding everything from scratch (which can be tricky) and to have a structure with everything already in place. Only the core will thus need to be recompiled when its sources are modified, as explained in the next section.
Alpha in the build folder

Updating and recompiling the sources

Make sure you have prepared everything as explained in the previous section.
Now, if you know that some changes have been made in the core sources and want to update your copy of Alpha, there are two things that need to be done:
  1. update your working copy;
  2. compile the binary.
There is one single instruction for this. In a Terminal window, change directory in order to be positionned in the Current folder. Then execute the following command :
    make core-update
That's all there is to it. You'll see a lot of messages from the compiler and hopefully this will end with a "** BUILD SUCCEEDED **" message. You can now launch your updated Alpha (once again, located inside Current/build/Debug).
If you know that there have also been changes in the AlphaTcl library, there is an even stronger command which will additionally checkout and install the AlphaTcl changes in the application bundle:
    make sf-update
If you want to update only AlphaTcl, rather than the core, see
TN #3: How to update the AlphaTcl library ?.

Related Links