Skip to content

Commit c5f7ecf

Browse files
committed
Support skipping the compiler summary and drop index file generation
Also allow absence of dropTemplateFile if it's not used at all, and remove unused htmlDirectoryName.
1 parent c8dfaf3 commit c5f7ecf

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

bundles/org.eclipse.build.tools/src/org/eclipse/releng/generators/TestResultsGenerator.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ public Iterator<String> iterator() {
171171

172172
private ErrorTracker anErrorTracker;
173173

174-
private String dropTemplateString = "";
175-
176174
// Parameters
177175
// build runs JUnit automated tests
178176
private boolean isBuildTested;
@@ -186,9 +184,6 @@ public Iterator<String> iterator() {
186184
// Location of the xml files
187185
private String xmlDirectoryName;
188186

189-
// Location of the html files
190-
private String htmlDirectoryName;
191-
192187
// Location of the resulting index.php file.
193188
private String dropDirectoryName;
194189

@@ -382,7 +377,6 @@ public void execute() {
382377
anErrorTracker = new ErrorTracker();
383378
anErrorTracker.loadFile(getTestManifestFileName());
384379
getDropTokensFromList(getDropTokenList());
385-
dropTemplateString = readFile(getDropTemplateFileName());
386380

387381
writeDropIndexFile();
388382

@@ -578,10 +572,6 @@ public String getHrefTestResultsTargetPath() {
578572
return hrefTestResultsTargetPath;
579573
}
580574

581-
public String getHtmlDirectoryName() {
582-
return htmlDirectoryName;
583-
}
584-
585575
/**
586576
* Gets the testManifestFileName.
587577
*
@@ -687,7 +677,12 @@ private void parseCompileLog(final String log, final StringBuilder compilerLog,
687677
}
688678

689679
private void parseCompileLogs() throws IOException {
690-
File sourceDirectory = new File(getCompileLogsDirectoryName());
680+
String compileLogsDirectory = getCompileLogsDirectoryName();
681+
if (compileLogsDirectory == null || compileLogsDirectory.isBlank()) {
682+
log(EOL + "INFO: Skip generating the compile logs summary page.");
683+
return;
684+
}
685+
File sourceDirectory = new File(compileLogsDirectory);
691686
File mainDir = new File(getDropDirectoryName());
692687
File compilerSummaryFile = new File(mainDir, compilerSummaryFilename);
693688
// we do not recompute compiler summary each time, since it is
@@ -704,7 +699,7 @@ private void parseCompileLogs() throws IOException {
704699
log("DEBUG: BEGIN: Parsing compile logs and generating summary table.");
705700
final StringBuilder compilerString = new StringBuilder();
706701
final StringBuilder accessesString = new StringBuilder();
707-
processCompileLogsDirectory(getCompileLogsDirectoryName(), compilerString, accessesString);
702+
processCompileLogsDirectory(compileLogsDirectory, compilerString, accessesString);
708703
if (compilerString.length() == 0) {
709704
compilerString.append(
710705
"<tr><td class='namecell'>None</td><td class='cell'>&nbsp;</td><td class='cell'>&nbsp;</td></tr>" + EOL);
@@ -1161,10 +1156,6 @@ public void setHrefTestResultsTargetPath(final String htmlTargetPath) {
11611156
hrefTestResultsTargetPath = htmlTargetPath;
11621157
}
11631158

1164-
public void setHtmlDirectoryName(final String aString) {
1165-
htmlDirectoryName = aString;
1166-
}
1167-
11681159
public void setIsBuildTested(final boolean isBuildTested) {
11691160
this.isBuildTested = isBuildTested;
11701161
}
@@ -1237,16 +1228,22 @@ private String verifyAllTestsRan(final String directory, ArrayList<String> found
12371228
}
12381229

12391230
private void writeDropIndexFile() {
1240-
final String outputFileName = getDropDirectoryName() + File.separator + getDropHtmlFileName();
1231+
String dropHtmlFile = getDropHtmlFileName();
1232+
if (dropHtmlFile == null || dropHtmlFile.isBlank()) {
1233+
log(EOL + "INFO: Skip generating the drop index file.");
1234+
return;
1235+
}
1236+
final String outputFileName = getDropDirectoryName() + File.separator + dropHtmlFile;
12411237
File outputIndexFile = new File(outputFileName);
12421238
// we assume if "eclipse" has been done, then "equinox" has been as
12431239
// well.
12441240
if (outputIndexFile.exists() && !isRegenerate()) {
1245-
log(EOL + "INFO: The drop index file, " + getDropHtmlFileName() + ", was found to exist already and not regenerated.");
1241+
log(EOL + "INFO: The drop index file, " + dropHtmlFile + ", was found to exist already and not regenerated.");
12461242
} else {
1243+
String dropTemplateString = readFile(getDropTemplateFileName());
12471244
if (outputIndexFile.exists()) {
1248-
log(EOL + "INFO: The drop index file, " + getDropHtmlFileName()
1249-
+ ", was found to exist already and is being regenerated.");
1245+
log(EOL + "INFO: The drop index file, " + dropHtmlFile
1246+
+ ", was found to exist already and is being regenerated.");
12501247
}
12511248
log("DEBUG: Begin: Generating drop index page");
12521249
final String[] types = anErrorTracker.getTypes();

0 commit comments

Comments
 (0)