prepare project - JeffBerman/Bob GitHub Wiki

Preparing and updating a project for use

This page describes the steps you take to get source code onto your PC, define it to RDi as a project, and configure Bob build settings. It only applies if Bob is being used with RDi.

Overview

When using RDi and Bob to edit and build your code, your code is brought into RDi as a project. A project is basically a directory of source files, plus some RDi and Bob metadata. Before Bob can build your project, it needs to be told where the project's source code should be pushed to on the IBM i and what library should receive the compiled objects.

Step 1: Get source code onto your PC

  • If this is a new project with no source code yet, simply create a directory to hold the future source files.

  • If your source code already exists on the IBM i in source physical file members, they need to be converted into text files and brought to a directory on your PC.

  • If a project already exists in a Git repository and you want to work on it for the first time, clone the repository to a directory on your PC, either by using a graphical Git client or by command line. As an example, let's clone the Better Object Builder repository via command line.

    $ cd Source
    $ git clone https://github.com/s4isystems/Bob.git

    The Bob project contains a sample project in a subdirectory named sample-project. For demonstration purposes, let's use that for our project.

Step 2: Define an RDi project

Now that you have a directory of source code on your PC, add it to RDi as a project.

  1. In RDi, select the Project Explorer view.

  2. Select File -> New -> Project..., choose type General -> Project, and click Next.

  3. Enter a name for your project and set the location to that of your new source code directory. You will likely need to uncheck the "Use default location" checkbox. Click Finish.

  4. Verify the project has correct settings for text file encodings (e.g., UTF-8) and Unix-style (LF) end-of-line characters, by right clicking on the project name and selecting Properties.

  5. Expanding your new project in the Project Explorer view reveals the source files.

Step 3: Create and configure project build settings

Once a project has been defined to RDi, a build settings file is created to specify values specific to the project. The values set in the build settings file are used by the client tools, and are how the tools know, for example, what directory on the i will contain a copy of the source code when compiling. Every project contains its own build settings file.

Create the build settings file by selecting the project in RDi's Project Explorer view and choosing RunExternal ToolsEdit build settings. If no .buildsettings file exists in the project directory, one will be created and populated with some default values, and the file will open in a text editor:

Change the default values to fit your environment. If you're using Windows, all paths should be from the context of the Bash shell. For example, if using Cygwin then the path to your develop directory might be /cygdrive/c/Users/username/Develop instead of C:\Users\username\Develop. When all values have been set, exit and save by typing control-x, y, Enter.

If at any time these settings need to change, simply choose Run → External Tools → Edit build settings again, change the values, and save the file.


Tip

To show invisible items (like the .deps directory) in RDi projects, click the triangle button in the Project Explorer toolbar, then select Customize View.... On the subsequent window, uncheck the .* resources item.


Your project is now set up in RDi and Bob. If a makefile hasn't yet been created, you can create one now if you wish.

⚠️ **GitHub.com Fallback** ⚠️