Using the Console Compiler
The console compiler (DFCompConsole) is designed to be used in automated build processes.
There are two versions:
- 32-bit in the Bin folder
- 64-bit in the Bin64 folder
Both support the same command line options, similar to those supported by the compiler with the full user interface (DFComp).
Usage
dfcompconsole {sourcefile} -x {workspace_path} -{opts_on} -{opts_off}
{sourcefile}- Path to DataFlex source file{workspace_path}- Path to DataFlex workspace (.sws) file{opts_on}- Turns compiler options on{opts_off}- Turns compiler options off
Options
I#- Console output level (0: no output, 1: compact output, 2: default)C- Force recompileE#- Error notification level (0: quiet, 1: default, 2: each)F- Intermediate coding (.prn) fileV#- Verbosity of intermediate coding (.prn) fileP- PrecompileW- Write error file (.err)
Example
At the start of your build process, you may want to precompile the system library to ensure it's up to date. This example will use both the 32-bit and 64-bit versions to produce a full set of precompiles. We used the following options:
-x-to use default build pathing (instead of pathing represented in the workspace configuration)-cpwto force recompile, precompile, and write an error file
{path}\bin\dfcompconsole "{path}\pkg\Windows.pkg" -x- -cpw || goto :error
{path}\bin\dfcompconsole "{path}\pkg\DfAllEnt.pkg" -x- -cpw || goto :error
{path}\bin\dfcompconsole "{path}\pkg\AllWebAppClasses.pkg" -x- -cpw || goto :error
{path}\bin64\dfcompconsole "{path}\pkg\Windows.pkg" -x- -cpw || goto :error
{path}\bin64\dfcompconsole "{path}\pkg\DfAllEnt.pkg" -x- -cpw || goto :error
{path}\bin64\dfcompconsole "{path}\pkg\AllWebAppClasses.pkg" -x- -cpw || goto :error
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%
For your applications, you'll usually specify the workspace configuration file. Here’s an example that compiles both 32-bit and 64-bit versions of the Order Entry example included with DataFlex:
{path}\bin\dfcompconsole "OrderPrecompile.pkg" -x"{path}\DataFlex 20.1 Examples\Order Entry\Order Entry.sws" -cpw || goto :error
{path}\bin64\dfcompconsole "OrderPrecompile.pkg" -x"{path}\DataFlex 20.1 Examples\Order Entry\Order Entry.sws" -cpw || goto :error
{path}\bin\dfcompconsole "Order.src" -x"{path}\DataFlex 20.1 Examples\Order Entry\Order Entry.sws" -cw || goto :error
{path}\bin64\dfcompconsole "Order.src" -x"{path}\DataFlex 20.1 Examples\Order Entry\Order Entry.sws" -cw || goto :error
:error
echo Failed with error #%errorlevel%.
exit /b %errorlevel%