I am on the trial of FB, trying to show how it will be useful to our work. One of the things I did was look for all the “Hint:” and “Warning:” lines in the output from the build script, and write them to a file. This would let us track them down en masse.
However, my boss would prefer just a list of the specific programs that have issues, so he can open them up individually and look at them. I am not sure how to do this, since I’m using a file iterator and a text match to find lines with the two keywords, and I don’t know how to “look back” to see which program generated them. (The log is the output of about a dozen or so programs being built.)
Obviously, I could create actions for each “Build Delphi” action, that looked at the log of that action, and wrote it out to some variable or something. But that would mean adding it to every single one of them. I’d rather process the whole log when it’s done, if possible.
Here’s what the relevant part of the script looks like now:
The file Content iterator saves each line to the variable “Hints”, the text find looks for matching lines, and writes out the file. I basically followed some of the examples in the help.
Here’s a typical log section:
So, what I want is for it to find that “Hint:” line, then write out “EmailSrvr.dpr” (or the full line starting with “Using Command Line…”, or some property that’s part of the Build Delphi action that tells what the project name is, or anything else to that effect. As noted above, I am 99% cure I can do it by scripting actions to follow each “Build Delphi”, but if there’s a way to do it that will work on the whole, final, log, instead of adding it to each build command, that would be great.
If your adding all the hints and warnings to a variable I would simply suggest writing the name of the project to the file just before updating it with the hints. Then when looking at the variable later you will have the following format.
>> Project A
Hint 1
Hint 2
Warning 1
>> Project B
>> Project C
Hint 1
Hint 2
Warning 1
Note that project B didn’t have any warnings. You can then parse the variable to see which projects had hint entries below them.
The action to achieve this would be the set variable action. Setting the hint variable to the value already in the hint variable with the project name on the next line.