Remote compilation of local source files

Remote compilation of a local source file requires a corresponding delegate on your BS2000 host. The local file will then be transferred to its delegate and compiled there.

The delegate must either be an existing file or library element of contents type text (see BS2000 file and library element content types), or it will be automatically created when needed. A delegate can be defined for each individual file, or via generic rules. If a delegate has been defined, remote compilation can be invoked.

For defining delegates see

For remote compilation of local source files compile commands and compile rules are applied on the delegate (see Defining Compile Commands and Defining Compile Rules) similar to the remote compilation within the remote resources (see Starting Remote Compilation).

For treating single sources, open the context menu BS2000. There you find the following actions for compiling:
Transfer local file to BS2000 Delegate File Ctrl + Alt + T
Open Remote Listing File Ctrl + Alt + L
Assign Remote Build Rule
Remote Compile With (Temporarily)
Compile with last temporary compile rule Ctrl + Shift + C

You first need to transfer the source file to the BS2000 delegate file with BS2000 > Transfer local file to BS2000 Delegate File or Ctrl+Alt+T.

Secondary sources like C/C++ header files or COBOL copy books are usually not compilable by their own. They need, however, also be transferred to a delegate on the BS2000 system to allow its inclusion during compilation of primary sources. Non-compilable secondary sources can be transfered to their delegates via the context menu BS2000 > Transfer Local File to BS2000 Delegate File or CTRL+ALT+T. For transferring files to BS2000 multiple selection is possible as well. In addition when selecting a container or a project all included files are transferred.

Note that for treating single sources you must make sure that all other local resources needed for compilation (like procedure files called in compiling rules) are transferred to their BS2000 delegate files.

Then you can compile the source file with BS2000 > Remote Compile With (Temporarily) and choose one of the compile rules offered in the sub menu. Also you can compile the source file via BS2000 > Compile with last temporary compile rule. The file will be compiled using last used temporary rule or assigned compile rule (if not available). These actions don't change the default rule for the resource. Compilation with last used temporary compile rule can be done on multiple files, so you can choose more than one file in Project Explorer and select from context menu BS2000 > Compile with last temporary compile rule or use shortcut.

As usual, problem marker decorations are also set in the project view to indicate which remote resources have errors or warnings. Note, however, problem marker decorations are only set for those remote resources which have been manually re-compiled. There is no Auto Build automatically performing remote compilation on remote resources. If the listing could not be interpreted, you can open the corresponding listing file with the context menu BS2000 > Open Remote Listing File or by pressing Ctrl+Alt+L.

Before building a project make sure that a default compile rule is assigned for every source to be compiled. This can be done via the context menu BS2000 > Assign Remote Build Rule. For this multiple selection is possible as well. This default build rule is valid within this project and, if it is a compile rule, also for the BS2000 Explorer view.

Within a BS2000 Remote Build Project you should prefer command link Project > Build All or Ctrl+B or command link Project > Build Project to build the project rather than compiling individual sources (see Incremental Project Builder).

Should the context menu BS2000 not be available in your specific project view try the general command link Project Explorer or command link Navigator view.

Defining a delegate for an individual file

  1. Select the local file in the Project View and open the context menu BS2000 > Define BS2000 Delegate File Property or press the key combination CTRL+ALT+D.
  2. Select an existing connection to a BS2000 host (if your desired connection does not yet exist, see Creating a connection to a BS2000 system).
  3. Select Specific file as Delegate Rule.

  4. Click Select existing BS2000 file... and browse through the files and/or PLAM library elements to select the delegate to be associated with your local file.
    Alternatively you can manually enter the path to the remote resource in field File name and optionally specify a prefix in field File prefix and Catalog ID The resulting remote path would then be composed as prefix.path. The delegate need not exist; it will be created when needed.
  5. Click OK.
The so defined delegate association is stored as persistent property of the local file. It can be redefined or deleted at any time via the context menu BS2000 > Define BS2000 Delegate File (for deletion select <No delegate rule> in the Delegate rule drop-down field). It can also be deleted via context menu BS2000 > Remove BS2000 Delegate File Property.

In the Project View nodes for files with an individually defined delegate association are decorated in the left top corner with . Furthermore, the delegate of a file is displayed in brackets behind the file name, e.g. [-> /$userid/prefix.main.c] or [-> /$userid:catid/prefix.main.c] if different pubset than default has been chosen.

Defining a generic delegate rule

Generic delegate rules can be defined for a container which can either be an entire project or a sub-folder at any level within a project. Generic rules are then active for all files (directly or indirectly) below the selected container. For selected files, inherited generic rules can be overridden by individual rules. Furthermore, for selected sub-folders, inherited generic rules can be overridden by other generic rules.

Generic rules are stored as persistent properties. They can be removed via context menu BS2000 > Remove BS2000 Delegate File Property or redefined via BS2000 > Define BS2000 Delegate File Property.

To define a generic rule proceed as follows:

  1. Select the project or sub-folder (the container) in the Project View and open the context menu BS2000 > Define BS2000 Delegate File Property
  2. In the opened dialog select an existing connection to a BS2000 host (if your desired connection does not yet exist see Creating a connection to a BS2000 system).

  3. Select a generic Delegate rule from the drop-down field, optionally fill the then displayed other fields, and click OK:
    Rule name How delegates are generated by this rule Sample delegate for project/src/main.c
    Simple Flat The container relative path of each local file within the selected container (project or sub-folder) is flattened (by replacing '/' by '.' and removing blanks) and prefixed with the name of the container.
    Optionally you can specify an additional File prefix which will be prepended with '.' as separator.
    You can also specify a comma separated list of extensions which will be removed to build the delegate file name.
    This rule could easily lead to file names exceeding the BS2000 file name length limit, thus use it with care.
    prefix.project.src.main.c
    Simple Flat (without project path) The simple path of each local file within the selected container (project or sub-folder).
    Optionally you can specify an additional File prefix which will be prepended with '.' as separator.
    You can also specify a comma separated list of extensions which will be removed to build the delegate file name.
    You have to take care that this rule don't create the same delegate for different files.
    prefix.main.c
    PLAM library For the selected container a PLAM library is created. The delegate is than an element with the flattened container relative path as name.
    By default the name of the PLAM library is the name of the selected container. However, you can specify your own name as Library name. Optionally you can specify an additional Library name prefix.
    You can also specify a comma separated list of extensions which will be removed to build the delegate file name.
    By default the element type is S, but you can specify another Element type.
    prefix.project/s/src.main.c
    Folder PLAM library For the container relative path of the directory immediately containing the local file a PLAM library is created. The delegate is than an element with the same name as the local file.
    Optionally you can specify a Library name prefix.
    You can also specify a comma separated list of extensions which will be removed to build the delegate file name.
    By default the element type is S, but you can specify another Element type.
    prefix.project.src/s/main.c
    Ignore inheritance Excludes this file or folder from inheriting, see Excluding individual files or folders below.  
    <No delegate rule> Removes the rule.  

Containers in the Project View for which generic delegate rules are defined are decorated in the left top corner with . Folders and files below this container are decorated with symbolizing that the generic rule is inherited and active for them. Furthermore, the delegate path of each file is displayed in brackets behind the file name, e.g. [-> /$userid:2os6/prefix.project.src/s/main.c]. Should the path of an inherited delegate be invalid, e.g. since it exceeds file name length limitations on BS2000, the decoration would be changed to .

When Remote Compile or Transfer Local File to BS2000 Delegate File is invoked for a local file for which an inherited delegate rule is active, the remote delegate file or library element specified by this rule will be created on the connected BS2000 system, if it does not yet exist.
If an inherited delegate rule specifies an already existing file or library element on BS2000, it will be used and overwritten by the transfer of the local file's contents to its delegate without further notice.
Thus, to avoid accidental overwrites, it is highly recommended to specify a unique prefix with the generic delegation rule, especially with Simple Flat rules.

Defining a delegate for specific PLAM element version

To define a delegate that will be transferred to PLAM element at specific version, the source file must contain version number in brackets at the end of target file name.

Below you can find example of defined 3 different project file versions using simple PLAM Library delegate rule:

File source.c(100) will be uploaded to PLAM element source.c file at version 100.
Second file source.c(101) will work in the same way but will transfer file at version 101.
The last file source.c - without provided version in its name - will transfer the file to as currently highest existing:

You can also combine element versions in delegate rules with comma separated list of extensions which will be removed during the build:

In the example the delegate rule has specified to remove c extension and version in file file name is moved before its extension. Such file will be transferred as source at version 100. Extension will be ignored but it will be possible to easy work with Eclipse file association based on file extension in BS2000 Remote Build Project.

Excluding individual files or folders

To exclude an individual file or folder from an inherited generic delegate rule perform as described above under Defining a delegate for an individual file or Defining a generic delegate rule, resp., but select Ignore inheritance as Delegate Rule. An excluded file or folder does not have an associated delegate rule. Excluded files or folders will be decorated by .

Summary of delegate decorations

Nodes in the Project View or Navigator View for which delegate rules are defined or inherited are decorated in the left top corner as follows. Note, it may take a while till all decorators have been set on the nodes in a Project View or Navigator View.

Decoration Meaning
Individual delegate defined for that file
Generic delegate rule defined for that folder
Inherited delegate rule active for that file or folder
File excluded from inheriting a generic delegate rule, does not have a delegate
Invalid delegate path resulting from inherited delegate rule