Configuring Large Projects

Micro Focus has the following recommendations for configuring your projects in Eclipse for a large code base:

Define fewer lookup paths

Ensure only the folders which are required are enabled on the Build Path pages in the project's properties. This reduces the time it takes Eclipse to search for files.

Set Compiler directives at project level

Set Compiler directives at project level rather than at file level where possible. This is because file-level settings override any settings specified at project level settings, and it can be difficult to track, maintain and manage them, especially with a larger code base.

Tip: To access a file's properties when the file is opened in the editor, right-click the code in the editor and click Properties. This would be easier than having to search for the file in COBOL Explorer.

Use the IDE settings to specify Compiler directives

The project's and file's IDE property pages in Visual COBOL provide a wide range of COBOL settings.

The IDE settings are easy to edit and easy to port. Once you use them to configure your projects, they apply both inside Eclipse and when you build the projects outside of Eclipse.

Micro Focus recommends that to set Compiler directives you use the IDE property pages in preference to any other method. Specifically, you should avoid the following:

  • Manually editing the COBOL project file, .cobolProj.
  • Mixing .bat files with build scripts.
  • Manually entering a Compiler directive in Additional directives in either the file or the project's properties, if an IDE setting for the directive exists. Use the GUI setting instead.

    You might end up setting the same directive using both the GUI controls and Additional Directives which could lead to errors.

    For example, you could manually type CICSECM in Additional Directives at the project level. At the same time, it could also be set to None in a file's GUI controls. As a result, there's an ambiguity as to which of the settings actually applies.

    You should only specify a directive in Additional Directives when no corresponding IDE setting exists.

Note: The Determine Directives command sets any required directives on file level only and not at project level. Micro Focus recommends that you move any file directives to project level, if possible, to help avoid any confusion.

Avoid $SET statements in the source files

Avoid setting any $SET statements directly in the source files. Instead, use the project's properties pages inside the IDE to set the corresponding Compiler directive. The reasons for this are:

  • $SET statements in the code are not easily visible, especially when you are working with a large number of files.
  • Eclipse visualizes the directives that are specified at the project or file level. However, it does not show any of the $SET statements that are in the code. This could lead to unexpected behavior, if your source code has any Compiler directives set with $SET statements that are different from the ones set using the GUI properties.

Avoid external files with Compiler directives

Micro Focus recommends that you avoid using any external files (such as .dir) to store any required Compiler directives. The reasons for this are:

  • There is no easy way to see the contents of a .dir file from within Eclipse. In scenarios where there are multiple projects, it is not easy to see which of the projects use a directives file.
  • A mix of directives specified as both projects' properties and in a .dir file could lead to confusion.