Setting up the Environment

In most cases, your Jenkins projects execute tasks in a command line environment and not inside the Visual COBOL IDE. This means that the COBOL environment is not automatically preconfigured as it would be if you used the IDE. As a result, when you use Jenkins projects you typically need to manually set the COBOL environment for your projects.

Note: If you use scripts to build your applications, then the scripts might already include the commands for setting the COBOL environment. In this case, you do not need to specify the environment in Jenkins - you only need to configure Jenkins to run the scripts.

To configure the environment for applications created with Visual COBOL for Visual Studio:

  1. Ensure Visual COBOL is installed on the machine you are going to build, test or analyze the COBOL sources.
  2. In Jenkins, in the Build section of the project's configuration page, click Add build step > Execute Windows batch command.
  3. Enter the following in the Command field:
    call "VSCMDpath\VsDevCmd.bat"

    Where VSCMDpath is the location of the Visual Studio command prompt batch file. For example, for Visual Studio 2019 Professional this is C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools. Visual COBOL integrates with the Visual Studio development environment so executing this sets the environment for building COBOL projects created with Visual Studio.

  4. In the same Command field, specify any commands that you want to be executed in this environment. For example, use MSBuild to compile your projects.