Builder - The Build Process

Initiate Build Process

There are several ways to initiate the build process... this includes:

The Build Process

In any case, the actual process that occurs is the same...

For each file in the list to build

  1. Execute each registered pre-process observer for the build process
  2. If file is a tokenized ProvideX program, convert to text file; skip remainder or process
  3. Do incremental build for file...
  4. Execute each registered post-process observer for the build process

A Simple Example Observer

The showtext.pvc class is simple observer that will output messages to the console view during the build process. This observer will be triggered during the build pre-process and the build post-process.

The source code for the class can be viewed by clicking on the link.

Reading Source Files

All observer actions that need to read a source file should use the program_reader class as shown in the following sample code:

! Create a new instance of the ProgramReader for the source file
aReader=new("program_reader",theSourceFile$)

while not(aReader'getEOF())
    ! Get the next source file line
    aLine$=aReader'read$()
    ! logic to process the program line
wend 
drop object aReader

What should not be attempted by an observer during the build process?

An observer cannot change the original source file - this will trigger a new build process. Any modifications to source files should be implemented in a contributed tool to avoid a run-away build process caused by continuously changing source files.