Permalink
Browse files

Two-pass compilation when using 11.7 COMPILER options (#229)

  • Loading branch information...
gquerret committed Apr 18, 2017
1 parent 3fda1ed commit 293b7fe9d01e1ffb26eac7e481b0bf8468862180
@@ -3,7 +3,7 @@ stage('Class documentation build') {
gitClean()
checkout scm
def antHome = tool name: 'Ant 1.9', type: 'hudson.tasks.Ant$AntInstallation'
def dlc11 = tool name: 'OE-11.6', type: 'jenkinsci.plugin.openedge.OpenEdgeInstallation'
def dlc11 = tool name: 'OE-11.7', type: 'jenkinsci.plugin.openedge.OpenEdgeInstallation'
def jdk = tool name: 'JDK 1.8 64b', type: 'hudson.model.JDK'

withEnv(["JAVA_HOME=${jdk}"]) {
@@ -163,7 +163,7 @@
<arg value="empty" />
<env key="DLC" value="${dlcHome}" />
</exec>
<bootstrapCompile destdir="${buildDir}" preprocess="true" debugListing="true" flattenDebugListing="false" listing="true" listingSource="preprocessor" keepXref="true" xmlXref="${xmlxref}" md5="true" minSize="false" graphicalMode="false" dlcHome="${dlcHome}" includedPL="false" compileUnderscore="true" cpstream="utf-8">
<bootstrapCompile destdir="${buildDir}" debugListing="true" listing="true" keepXref="true" xmlXref="${xmlxref}" md5="true" minSize="false" graphicalMode="false" dlcHome="${dlcHome}" includedPL="false" compileUnderscore="true" cpstream="utf-8" relativePaths="true" requireFullKeywords="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="${fsid}" />
<propath refid="${propid}" />
<PCTRunOption name="-cprcodeout" value="undefined" />
@@ -225,7 +225,7 @@

<target name="classDoc" depends="declare-bootstrap" description="Windows compilation of class documentation">
<mkdir dir="${build-win}" />
<bootstrapCompile destdir="${build-win}" md5="true" minSize="false" graphicalMode="true" dlcHome="${DLC}" includedPL="false" cpstream="iso8859-1" debugListing="true" listing="true" preprocess="true" listingSource="preprocessor">
<bootstrapCompile destdir="${build-win}" md5="true" minSize="false" graphicalMode="true" dlcHome="${DLC}" includedPL="false" cpstream="iso8859-1" debugListing="true" listing="true" relativePaths="true" requireFullKeywords="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="fs.classDoc" />
<propath>
<pathelement location="${src.progress}" />
@@ -1,3 +1,3 @@
DLC10=\\
DLC10-64=\\
DLC11=C:\\Progress\\OpenEdge-11.6
DLC11=C:\\Progress\\OpenEdge-11.7
@@ -190,9 +190,9 @@ CLASS Consultingwerk.Framework.Base.AblPrimitiveList
STRING (piIndex),
THIS-OBJECT:GetClass():TypeName) .

RETURN ENTRY (piIndex,
RETURN STRING(ENTRY (piIndex,
THIS-OBJECT:Values,
THIS-OBJECT:ValueDelimiter) .
THIS-OBJECT:ValueDelimiter)).

END METHOD.

@@ -55,6 +55,11 @@ DEFINE TEMP-TABLE ttXrefCRC NO-UNDO
FIELD ttTblName AS CHARACTER.
DEFINE TEMP-TABLE ttXrefClasses NO-UNDO
FIELD ttClsName AS CHARACTER.
DEFINE TEMP-TABLE ttWarnings NO-UNDO
FIELD msgNum AS INTEGER
FIELD rowNum AS INTEGER
FIELD fileName AS CHARACTER
FIELD msg AS CHARACTER.

DEFINE SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO.

@@ -105,6 +110,7 @@ DEFINE VARIABLE ProgPerc AS INTEGER NO-UNDO INITIAL 0.
DEFINE VARIABLE lOptFullKw AS LOGICAL NO-UNDO INITIAL FALSE.
DEFINE VARIABLE lOptFldQlf AS LOGICAL NO-UNDO INITIAL FALSE.
DEFINE VARIABLE lOptFullNames AS LOGICAL NO-UNDO INITIAL FALSE.
DEFINE VARIABLE cOpts AS CHARACTER NO-UNDO.
DEFINE VARIABLE iLine AS INTEGER NO-UNDO.
DEFINE VARIABLE iTotlines AS INTEGER NO-UNDO.
DEFINE VARIABLE iNrSteps AS INTEGER NO-UNDO.
@@ -165,7 +171,6 @@ PROCEDURE setOption.
END PROCEDURE.

PROCEDURE initModule:
DEFINE VARIABLE cOpts AS CHARACTER NO-UNDO.
ASSIGN lIgnoredIncludes = (LENGTH(cignoredIncludes) > 0).

/* Gets CRC list */
@@ -191,10 +196,6 @@ PROCEDURE initModule:
ASSIGN cOpts = cOpts + (IF cOpts EQ '' THEN '' ELSE ',') + 'require-field-qualifiers'.
IF lOptFullNames THEN
ASSIGN cOpts = cOpts + (IF cOpts EQ '' THEN '' ELSE ',') + 'require-full-names'.
&IF DECIMAL(SUBSTRING(PROVERSION, 1, INDEX(PROVERSION, '.') + 1)) GE 11.7 &THEN
IF DECIMAL(REPLACE(SUBSTRING(PROVERSION, 1, INDEX(PROVERSION, '.') + 1), '.', SESSION:NUMERIC-DECIMAL-POINT)) GE 11.7 THEN
COMPILER:OPTIONS = cOpts.
&ENDIF

IF ProgPerc GT 0 THEN DO:
ASSIGN iNrSteps = 100 / ProgPerc.
@@ -245,7 +246,8 @@ PROCEDURE compileXref.
DEFINE VARIABLE warningsFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE RCodeTS AS {&DATETIME} NO-UNDO.
DEFINE VARIABLE ProcTS AS {&DATETIME} NO-UNDO.
DEFINE VARIABLE cRenameFrom AS CHARACTER NO-UNDO initial ''.
DEFINE VARIABLE cRenameFrom AS CHARACTER NO-UNDO INITIAL ''.
DEFINE VARIABLE lWarnings AS LOGICAL NO-UNDO INITIAL FALSE.

/* Output progress */
IF ProgPerc GT 0 THEN DO:
@@ -358,6 +360,24 @@ PROCEDURE compileXref.
ELSE
ASSIGN debugListingFile = ?.

&IF DECIMAL(SUBSTRING(PROVERSION, 1, INDEX(PROVERSION, '.') + 1)) GE 11.7 &THEN
IF (cOpts GT "") AND (DECIMAL(REPLACE(SUBSTRING(PROVERSION, 1, INDEX(PROVERSION, '.') + 1), '.', SESSION:NUMERIC-DECIMAL-POINT)) GE 11.7) THEN DO:
EMPTY TEMP-TABLE ttWarnings.
COMPILE VALUE(IF lRelative THEN ipInFile ELSE ipInDir + '/':U + ipInFile) SAVE=FALSE OPTIONS cOpts NO-ERROR.
IF COMPILER:ERROR THEN DO i = 1 TO COMPILER:NUM-MESSAGES:
/* Messages 14786, 14789, 18494 are the only relevant ones */
IF (COMPILER:GET-NUMBER(i) EQ 14786) OR (COMPILER:GET-NUMBER(i) EQ 14789) OR (COMPILER:GET-NUMBER(i) EQ 18494) THEN DO:
CREATE ttWarnings.
ASSIGN ttWarnings.msgNum = COMPILER:GET-NUMBER(i)
ttWarnings.rowNum = COMPILER:GET-ROW(i)
ttWarnings.fileName = COMPILER:GET-FILE-NAME(i)
ttWarnings.msg = COMPILER:GET-MESSAGE(i)
lWarnings = TRUE.
END.
END.
END.
&ENDIF

RUN logVerbose IN hSrcProc (SUBSTITUTE("Compiling &1 in directory &2 TO &3", ipInFile, ipInDir, cSaveDir)).
IF (lXCode AND XCodeKey NE ?) THEN
COMPILE
@@ -488,7 +508,7 @@ PROCEDURE compileXref.
ELSE
RUN ImportXref (INPUT cXrefFile, INPUT PCTDir, INPUT ipInFile) NO-ERROR.
END.
IF COMPILER:WARNING THEN DO:
IF COMPILER:WARNING OR lWarnings THEN DO:
OUTPUT STREAM sWarnings TO VALUE(warningsFile).
DO i = 1 TO COMPILER:NUM-MESSAGES:
/* Messages 2363, 3619 and 3623 are in fact warnings (from -checkdbe switch) */
@@ -498,6 +518,9 @@ PROCEDURE compileXref.
END.
END.
END.
FOR EACH ttWarnings:
PUT STREAM sWarnings UNFORMATTED SUBSTITUTE("[&1] [&3] &2", ttWarnings.rowNum, ttWarnings.msg, ttWarnings.fileName) SKIP.
END.
OUTPUT STREAM sWarnings CLOSE.
END.
ELSE DO:
@@ -833,9 +833,11 @@ public void test52() {
File f1 = new File(BASEDIR + "test52/build1/test.r");
assertTrue(f1.exists());

expectBuildException("test2", "Failure");
executeTarget("test2");
File f2 = new File(BASEDIR + "test52/build2/test.r");
assertFalse(f2.exists());
assertTrue(f2.exists());
File f3 = new File(BASEDIR + "test52/build2/.pct/test.p.warnings");
assertTrue(f3.exists());
}

@Test(groups = {"v11"})
@@ -857,9 +859,11 @@ public void test53() {
File f1 = new File(BASEDIR + "test53/build1/test.r");
assertTrue(f1.exists());

expectBuildException("test2", "Failure");
executeTarget("test2");
File f2 = new File(BASEDIR + "test53/build2/test.r");
assertFalse(f2.exists());
assertTrue(f2.exists());
File f3 = new File(BASEDIR + "test53/build2/.pct/test.p.warnings");
assertTrue(f3.exists());
}

@Test(groups = {"v11"})
@@ -881,9 +885,11 @@ public void test54() {
File f1 = new File(BASEDIR + "test54/build1/test.r");
assertTrue(f1.exists());

expectBuildException("test2", "Failure");
executeTarget("test2");
File f2 = new File(BASEDIR + "test54/build2/test.r");
assertFalse(f2.exists());
assertTrue(f2.exists());
File f3 = new File(BASEDIR + "test54/build2/.pct/test.p.warnings");
assertTrue(f3.exists());
}

@Test(groups = {"v10"})
@@ -833,9 +833,11 @@ public void test52() {
File f1 = new File(BASEDIR + "test52/build1/test.r");
assertTrue(f1.exists());

expectBuildException("test2", "Failure");
executeTarget("test2");
File f2 = new File(BASEDIR + "test52/build2/test.r");
assertFalse(f2.exists());
assertTrue(f2.exists());
File f3 = new File(BASEDIR + "test52/build2/.pct/test.p.warnings");
assertTrue(f3.exists());
}

@Test(groups = {"v11"})
@@ -857,9 +859,11 @@ public void test53() {
File f1 = new File(BASEDIR + "test53/build1/test.r");
assertTrue(f1.exists());

expectBuildException("test2", "Failure");
executeTarget("test2");
File f2 = new File(BASEDIR + "test53/build2/test.r");
assertFalse(f2.exists());
assertTrue(f2.exists());
File f3 = new File(BASEDIR + "test53/build2/.pct/test.p.warnings");
assertTrue(f3.exists());
}

@Test(groups = {"v11"})
@@ -881,9 +885,11 @@ public void test54() {
File f1 = new File(BASEDIR + "test54/build1/test.r");
assertTrue(f1.exists());

expectBuildException("test2", "Failure");
executeTarget("test2");
File f2 = new File(BASEDIR + "test54/build2/test.r");
assertFalse(f2.exists());
assertTrue(f2.exists());
File f3 = new File(BASEDIR + "test54/build2/.pct/test.p.warnings");
assertTrue(f3.exists());
}

@Test(groups = {"v10"})

0 comments on commit 293b7fe

Please sign in to comment.