Highlighted
Trusted Contributor.
Trusted Contributor.
375 views

Visual COBOL 4.0 Eclipse Windows Incremental Build with ant

We're working with a large native procedural COBOL code base and have automated the build with Bamboo and ant.  On our build server, we only want to compile programs that have been changed since the last buld (all source is pulled from Git for the build).  Are incremental builds possible in this scenario?  Can someone provide more detail be provided  about how VC Eclipse tracks changes and copybook dependencies when building incrementally.

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Visual COBOL 4.0 Eclipse Windows Incremental Build with ant

Hi StompinBob,

 

As you probably know, Visual COBOL for Eclipse will use incremental builds by default for Native code when working inside of Eclipse. That is, if a Native COBOL project contains multiple programs and copy files, and only a certain program has been changed, only that program will be rebuilt.

 

The same extends to copy files - if a copy file used by only one of the programs is modified, only the affected program will be rebuilt. For Eclipse to be aware of the change, the copy file must be in a project. The copy file can be the Native COBOL project, or a COBOL Copybook project that is referenced by the Native COBOL project. This assumes that you have changed the file using the Eclipse editor. If you change the file externally (as might happen with a source control system fetching a new version) I don't believe Eclipse will be automatically aware of the change. In that case, you can do a Refresh of the project, and Eclipse will notice the changes, and build incrementally based on them.

 

A special note about copy files. Visual COBOL for Eclipse offers the option of pointing to an external (non-project) location for copy files (using Project->Properties, and then Micro Focus->Build Path, and then Adding the location under Copybooks. If you use this option Eclipse will not be aware of a change made to copy files in the external location. This is one of the reasons we recommend that copy files be placed into a project where possible.

 

Regarding your question about using Ant and doing incremental builds, there is an option you can specify as part of the ant command:

 

-DforceCompile=false

 

to request an incremental build. Here is a link to a page in the documentation that describes building using Ant, and shows the option for incremental builds:

 

https://www.microfocus.com/documentation/visual-cobol/vc40pu8/EclWin/HHDVTHDEVT06.html

 

Hope this helps…

Blair McDonald

Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Visual COBOL 4.0 Eclipse Windows Incremental Build with ant

Thanks @Blair McDonald .  I think we need to better understand the "refresh" capability of Eclipse and if we can somehow use it within an automated build.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.