automated compiling

KrisM

Member
As I understand it, the compile statement can only be used to compile a single file, not an entire folder.
You can use 'run _comp.p.' to run the application compiler but this will only start the tool and not compile anything.
Is there a way to pass parameters to the application compiler and make it start compiling directly, or is there another way to compile an entire folder (with subfolders) ?
 
Hi Krism,

it isn't possible. but there are other ways to achieve it.

The source code for the _comp.p procedure and other Progress Application Compiler related files is not included in the media distributed by Progress. However, these are available from PSDN Code Share for download as part of the Progress POSSENET Development Tools. These downloads (zip & tar formats) contain the source files of the Progress 9.x Development products including the Progress Application Compiler as well as other Progress development tools.
Another free download available from PSDN Code Share is the third party "Directory Tools" application, which can compile programs in a directory tree and save the resulting r-code to a target directory tree, among other useful applications.
 

gnome

Member
If you know how to use the compile statement, then I'm sure you can create your own Procedure to accomplish what you want. You just have to create a recursive reading of a directory in 4gl, usage of OS-commands. If you're done with that you might consider adding that tool in your Protools for quick access.

Cheers.
 

FrancoisL

Member
Here you go... It will recursively compile sub directory.
Code:
PROCEDURE Compile-Dir:
DEF INPUT PARAMETER pcDir AS CHAR.

DEF VAR cFichier AS CHAR FORMAT 'X(25)'.
DEF VAR cFullpath AS CHAR FORMAT 'X(40)'.
DEF VAR cType AS CHAR.

INPUT FROM OS-DIR(pcDir).
REPEAT:
    IMPORT cFichier cFullPath cType.

    IF NUM-ENTRIES(cFichier,'.') > 1 AND LOOKUP(ENTRY(NUM-ENTRIES(cFichier,'.'),cFichier,'.'),'p,w') > 0 AND cType = 'F' THEN DO:        
       COMPILE VALUE (cFullPath) SAVE=TRUE NO-ERROR. 
    END.

    IF cType = 'D' AND LOOKUP(cFichier,'.,..') = 0 THEN DO:        
        RUN Compile-dir(cFullPath).
    END.
        

END.
INPUT CLOSE. 


END PROCEDURE.
 
Top