How Automatic Build Configuration Works in the DVT Eclipse IDE
Overview
Effortlessly bring up a project in DVT using the automatic build configuration feature.
Instead of manually specifying lists of files, incdirs etc., you can simply use one or more +dvt_init_auto directives in the project's build configuration file. Depending on the project layout and particularities you can further tune the auto-configuration to achieve a cleaner compilation.
Explore the design and verification tools: https://www.dvteclipse.com
Or request a license: https://www.dvteclipse.com/request-license
This video was shot using DVT 21.1.3
Details
Introduction
In order to simplify project configuration, instead of explicitly specifying source files, include directories, and various other compilation directives, you can simply use one or more +dvt_init_auto
directives in the build configuration file. By default, DVT scans the project directory and automatically detects how to compile the source code files.
Configuring the Auto-Configuration
For large, complex projects, especially those employing unusual topologies, further fine-tuning might be required. This can be achieved by adding extra auto-configuration-related directives within the +dvt_init_auto
section.
Use the +dvt_compilation_root
directive to point to a different location in case your sources reside elsewhere.
In addition, if source files are located in multiple, scattered directories, you can specify them using the +dvt_autoconfig_scan_root
directive.
Dealing with Scanning Timeout Issues
If the specified directories contain large file system hierarchies, or if the file system access is rather slow, the scanning process might time out, by default after 40 seconds. Most likely, scanning spends time in folders containing non-source files, such as documentation, simulation, or regression artifacts.
Add the +dvt_autoconfig_debug_scan
directive to get progress information printed in the console view and easily pinpoint the bottleneck.
In such a case, you may consider a more fine-grained and precise selection of scan roots, or use the +dvt_skip_compile
directive to skip irrelevant directories.
Ultimately, you can increase the timeout using the +dvt_autoconfig_timeout
directive.
Handling Stray Source Files
Stray source files residing alongside the relevant ones, such as backup copies, old unmaintained files, drafts, and so on, could impact the auto-configuration result. To address this issue, simply add one or more +dvt_skip_compile
directives.
Understanding the Generated default.build.auto
File
When building the project, for each +dvt_init_auto
directive, a corresponding default.build.auto
file is created. It contains the compilation directives resulting from the autoconfig, such as +incdir
s or -top
files, which are eventually used by DVT to compile the code.
If the compilation result is not as expected, you should consult the generated configuration flags, as some decisions taken by the autoconfiguration algorithm are documented via embedded comments. For example, we can define a preprocessing symbol to activate particular sections of the code.
Note: Some of the directives specified within the +dvt_init_auto
section are used to steer the autoconfig algorithm, while regular compilation directives are directly reused in the generated auto file.