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 and 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).

You can call it from a command prompt, Windows PowerShell or a batch file.

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 recompile

E# - Error notification level (0:quiet, 1:default, 2:each)

F  - Intermediate coding (.prn) file

V# - Verbosity of intermediate coding (.prn) file

P  - Precompile

W  - Write error file (.err)

R - Adds replacements to the compiler, which can be either symbols or a definition.

/? Shows the argument list

Symbol Replacement

Option R adds replacements to the compiler, which can be either symbols or a definition.

If a symbol is not definined in code, the symbol will be defined as| CI1:

-RPRODUCTION_BUILD

You may also specify the definition, such as:

-RVERSION=1.0

If you want to define a string, it needs to be encapsulated in single or double quotes (‘'' or '“’).

Example

You can replace symbols defined in your code. For example, if you add this code at the top of Order.src in the Order Entry sample workspace:

#IFNDEF DFUNIT_VERSION

Define DFUNIT_VERSION for 1.0

#ENDIF

And use that symbol as a replacement for the version in Procedure Activate_About near the bottom of Order.src.

Send DoAbout "Order Entry Sample Application" DFUNIT_VERSION "Copyright 2005-2023 Data Access Corporation. All rights reserved." "Data Access Worldwide" ""

Then compile using the console compiler like this to replace the symbol.

Note that you have to replace a numeric symbol using |CN1.1

"C:\DataFlex 23.0\Bin64\DfCompConsole" "C:\DataFlex 23.0 Examples\Order Entry\AppSrc\Order.src" -x "C:\DataFlex 23.0 Examples\Order Entry\Order Entry.sws" "-rDFUNIT_VERSION=|CN1.1"

Examples

At the start of your build process, you may want to precompile the system library to make sure it's up to date. This example will use both the 32 and 64-bit versions to produce a full set of precompiles. We used the following options:

{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, like this example that compiles both 32 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%

 

See Also

Compiling Applications