Build settings file - JeffBerman/Bob GitHub Wiki

This page describes the contents of the .buildsettings file.

Overview

A directory of related source code is considered a project by Eclipse (and thus RDi). Bob's client tools create a .buildsettings file in each project directory to store its settings. Individual settings are actually shell variables, so they are in the format setting="some value".

Build settings can be configured by running Edit build settings.sh, which is done in RDi via Run -> External Tools -> Edit build settings. This will be done once per project on each development PC, but can also be done any time, such as when it is desired to build a product into a different library.

Client tools build settings fields

Following are descriptions of the various .buildsettings fields. All fields are required.

system

The network name of the IBM i on which the project should build. This is the name by which a PC can access the i, such as by an ssh command.

Example:

system=DEVSYS01

user

The IBM i user profile with which client tools should connect to the i.

Example:

user=JBERMAN

localSourceDir

The location of the project's source code on your PC. Put another way, the location of the RDi project directory. The path must end with a slash.

Special note for Windows:
Because the client tools are Bash scripts, this path needs to be from a Bash point of view. If using Cygwin, this means specifying the path to get to your source code from inside the Cygwin "container", meaning the path will likely start with /cygdrive/c/, which is how Cygwin references the C: drive. As an example, /cygdrive/c/Users/jberman/Documents is the Cygwin equivalent to Windows' C:\Users\jberman\Documents. Note that Bash paths use forward slashes.

Windows example:

localSourceDir="/cygdrive/c/Users/jberman/Develop/Source/my-project/"

macOS example:

localSourceDir="~/Develop/Source/my-project/"

remoteSourceDir

The location of the build directory on the IBM i. This is where code will actually be compiled from, and is also the directory on the i that will receive the project's source code when it is pushed from your PC.

Example:

remoteSourceDir="/Build/my-project/jeff"

buildLib

The library on the IBM i in which objects will be compiled. This is the goal of the entire build system -- the location of your built product.

Example:

buildLib=MYBUILDLIB

makefile

The name of the makefile that should be used to build the project. This is not the generic IBMiMake makefile that contains recipes for building types of objects -- this is the project-specific makefile located in the project source code directory that lists out each object in your project plus its source code and dependencies.

Example:

makefile=Makefile

privateKey

The location on your PC of the private key file that will be used to authenticate connections to the IBM i. The file can be located anywhere, but it is customary for it to reside in a directory called .ssh in a user directory (e.g., C:\Users\jberman\.ssh).

Instructions for creating and deploying private and public keys are here.
This article has a terrific explanation of how SSH key-based authentication works.

Special note for Windows:
Because the client tools are Bash scripts, this path needs to be from a Bash point of view. If using Cygwin, this means specifying the path to get to your private key from inside the Cygwin "container", meaning the path will likely start with /cygdrive/c/, which is how Cygwin references the C: drive. As an example, /cygdrive/c/Users/jberman/Documents is the Cygwin equivalent to Windows' C:\Users\jberman\Documents. Note that *nix paths use forward slashes.

Windows example:

privateKey="/cygdrive/c/Users/jberman/.ssh/id_rsa"

macOS example:

privateKey="~/.ssh/id_rsa"

Build settings template file

When build settings are edited for the very first time for a project, the .buildsettings file doesn't yet exist. Therefore, a generic settings file is copied into the project directory so it can be customized. This template file exists in the Client-tools directory and is called buildsettings.sh.dist.

.gitignore

.gitignore is a file used by Git to allow users to specify items that should be excluded from Git's source control. When Bob creates a project's .buildsettings file, it also defines that file to .gitignore. .gitignore is created if it doesn't yet exist, if Bob detects that the project is under Git control.