BS2000 Remote Build Projects

BS2000 Remote Build Projects are Eclipse projects with a nature able to perform builds (i.e. compiling and binding) on a remote BS2000 system. Project resources to be involved in remote builds can either be links to resources on BS2000 (see Linked resources) or can be local resources with associated delegates on BS2000 (see Defining a delegate).

Creating a BS2000 Remote Build Project

In the main menu File > New > Project... or the context menu New > Project... select BS2000 > Remote Build Project. This wizard helps you to create a new BS2000 Remote Build Project.
  1. Enter a Project name
  2. Best to use the default location. However never chose a location on your BS2000 system (.project files cannot be stored on BS2000).
  3. If you have installed the P3/COBOL editor from EasiRun and you intent to use it for editing COBOL sources in your project, then keep the check box Using P3/COBOL editor selected. You can also change the name of the compiler configuration path. BS2IDE will create the configuration file with a template as initial contents and add its path to the project properties.
  4. If preferred, you may select working sets.

  5. In the next wizard page you may define Referenced projects if your project depends on other projects in your workspace.
  6. In the next wizard page you can define Delegate rules valid for the entire project, see Remote compilation of local source files. If you prefer to define delegate rules for individual folders click Next to skip this page.

  7. In the next wizard page you can select those Compile rules which should be used to build this project. Note, for each compilable source in your project there must be a unique compile rule. Thus, keeping all available compile rules selected will likely lead to ambiguous rules.

  8. In the next three wizard pages you may define a Project Clean Command, a Project Pre-Build Command, and a Project Post-Build Command. These commands can also be /CALL-PROCEDURE to delegate the work to a command procedure. However they must neither be /ENTER-JOB nor /ENTER-PROCEDURE as BS2IDE expects synchronous execution.
    Here is an example of a very simple Project Clean Command. It assumes that object modules and listings generated by the compiler are also stored in the PLAM library MYPROJECT.DELEGATES and deletes the entire library. In most practical cases it will be a /CALL-PROCEDURE command.

  9. When you click Finish an initially empty Remote Build Project will be created. In the Project or Navigator view icons of Remote Build Projects are decorated in the right top corner with .
  10. Now you can add resources like folders and files to your project. Files and folders can either be links to resources on your BS2000 system, see Linked resources, or can be local files. Links to resources on a BS2000 system and local files with associated delegates (see Remote compilation of local source files) will be considered by the Incremental Project Builder established for the Remote Build Project nature.
To modify the project properties set with the Project Creation wizard select the project and open the context menu Properties. After those modifications it is recommended to run the next build as a full build. Perform command link Project > Clean... to enforce a full build.

Incremental Project Builder

To be able to build your project on the remote BS2000 system you need to define compile rules and compile commands as described in Defining Compile Commands and Defining Compile Rules and select those you want to be active for your project in the project properties as described above. The active compile commands must define a unique compile command for each compilable source file (primary source file). There must be no active compile rule for non-compilable secondary source files like C/C++ header files, COBOL copy books, or ASSEMBH macros.

Furthermore, if you have decided to store your source files locally, e.g. in a local source control system like Git or CVS, then you need to define delegate rules for all source files, whether compilable primary sources or non-compilable secondary sources, see Defining a delegate. And, of course, your compile commands or SDF procedures called for compilation must know where to find the secondary sources, whether they are delegates or linked resources.

Remote Build Projects provide an Incremental Project Builder. If you have selected a Remote Build Project in the Project View you can perform the main menu action command link Project > Build Project. You can watch the tasks performed by the Incremental Project Builder in the progress monitor, or in the Remote BS2000 Compilations view (to be opened via command link Window > Show View > Other... > BS2000 > Remote BS2000 Compilations).

The first time you are doing this, a full build is performed. A full build first transfers all primary and secondary source files for which a delegate is defined to their delegates. Then Remote Compile is invoked for all compilable primary source files, whether linked or having a delegate.

Subsequent builds are usually incremental builds, except Eclipse decides to perform a full build, anyway. Occasionally Eclipse starts a full build even if it is not necessary. That might be a great time delay, especially in large projects.
Therefore BS2IDE offers the optimized build option which is enabled as default. If the optimized build option is active, BS2IDE verifies for each project resource whether the changes since the last build requires a new build for this resource or not. Thereby most of the full builds are transformed into an incremental build. Incremental builds only transfer changed primary and secondary source files to their delegates, determine the affected primary source files (e.g. a C source file including a changed header file will be affected even if it has not been changed itself) and invoke Remote Compile for all affected primary source files. Changes made in dependent projects are also taken into consideration (e.g. changes made in a header file of a dependent project affect primary sources of the current project including this header file).

You can disable the optimized build option in command link Window > Preferences > BS2000 Remote IDE > Project by disabling Enable BS2IDE optimized project build. In this case BS2IDE leaves the decision to start a full build to Eclipse.

Alternatively you may enforce a full build by cleaning the project via command link Project > Clean... before.

Of course, this can only work well if Eclipse is able to track all changes. Thus never modify a delegate or linked source directly on your BS2000 system.
If you should have accidently done so, perform command link Project > Clean... to enforce a full build.
Furthermore, if your compile command is a call of an SDF procedure and you modify this procedure you also must perform command link Project > Clean... to enforce a full build.
It is recommended to frequently build your project or even better the entire workspace ( command link Project > Build All or Ctrl+B) to avoid accumulating too many changes so that Eclipse decides to perform a long lasting full build next time. Note, Remote Compile (Ctrl+Alt+C) of a changed source is not sufficient since it does not involve the incremental builder, hence the source will nevertheless be recompiled during the next build.
Ensure that all compilable source files in your project have unique PROGRAM-IDs or lead to unique CSECT names, even if some of them should only be experimental and will never be bound to the final program. Unique CSECT names are essential for BS2IDE during debugging to maintain the association of sections to source files (used for toggling breakpoints or showing suspend locations).

Auto Build

Automatically building your project every time you save changes (e.g. by pressing CTRL+S) would likely overload your BS2000 system and the network traffic. Therefore, for Remote Build Projects automatically building is ignored by default, even if you have ticked Build Automatically in the Project menu. Other projects in your workspace may still automatically invoke builds.

If you like to enable automatic builds, open the context menu Properties > Builders, select BS2000 Remote Builder and click Edit... to open the dialog Configure Builder in which you can tick During auto builds:

Remote BS2000 Compilations View and Remote BS2000 Procedure Call View

The Remote BS2000 Compilations view (to be opened via command link Window > Show View > Other... > BS2000 > Remote BS2000 Compilations) shows the remote compilations performed during this session.

The Remote BS2000 Procedure Calls view (to be opened via command link Window > Show View > Other... > BS2000 > Remote BS2000 Procedure Calls) shows the remote procedure calls, e.g. the clean, pre-build, of post-build procedures, performed during this session.

If an entry in these views is selected (by clicking on its Date/Time field) the view menu provides Show Console Output. The console output is only available during the current Eclipse session, it is not persistently saved. In the BS2000 Remote Compilations view the listing files can also be inspected via Open Listing File.

Remote BS2000 Project Files View

The Remote BS2000 Project Files view (to be opened via command link Window > Show View > Other... > BS2000 > Remote BS2000 Project Files) shows a table of all files belonging to the selected project and their associated compile and delegate rules.