[NOT SOLVEABLE] Post Build Events are Corrupted

Posts   
 
    
Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 17-Aug-2004 22:55:02   

Frans,

I have noticed that Post Build Events that begin with a " (quote symbol) " are being corrupted when the project is regenerated.

"$(DevEnvDir)....\sdk\v1.1\bin\sn.exe" -Vr $(TargetFileName)

becomes:

"$(DevEnvDir)....\sdk\v1.1\bin\sn.exe" -Vr $(TargetFileName)

Any ideas?

[edit] I don't know where the [ br ][ br ] above is coming from... I have tried to edit the post but they keep re-appearing disappointed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39616
Joined: 17-Aug-2003
# Posted on: 18-Aug-2004 11:10:42   

the br/br comes from the fact that the parser matches a quoted string, but the grammar doesn't allow a quoted string in there and behind the scenes throws an error. It tries to fix it but the br/br commands are still converted and not transfered to <br><br>. Yeah I do hate that parser as much as you do simple_smile . Altering the grammar to allow the string there could help, but can also throw numerous other errors elsewhere.

The " stuff comes from the XML document I guess. disappointed I read the project file into an Xml document and manipulate some nodes there. You'd expect that quotes read would be written back normally, but no, Xml has to show how big of a misery it really is. I'm not sure what I have to do to this to fix it, perhaps there is a setting in the xmldocument but I'm thinking of dumping it in a string first and replace " with " and < with '>' etc.

(trying to fix the quote issue in the parser I saw what's wrong: the parser sees the first quote and then matches the second one with the first quote of the string you copied from the project file, with the two brakes. I added a dummy quote to fix it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39616
Joined: 17-Aug-2003
# Posted on: 18-Aug-2004 14:39:37   

Hmm, the lame thing is: the attribute node with the value of PostBuildEvent does contain the correct text, however when the final Xml is pulled out of the XmlDom, the quotes get escaped. The whole value should be surrounded with single quotes (as is the case when the xml is read) but apparently this is not done. I'm not aware of a setting of the xml dom to make this possible, a simple search/replace is not possible as it would also require to make the string be surrounded with single quotes as well, which would include a lot of work as everywhere these quotes can pop up (and which is pretty lame, the xmldom should take care of that).

I'll try to see if an Xmltextwriter will do a better job

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39616
Joined: 17-Aug-2003
# Posted on: 18-Aug-2004 14:55:15   

Nope, that doesn't work either...

The problem is: when I load the XML into a dom, and look at the InnerXml, the quotes are already transformed to their escape sequences.

A workaround would be to place your postbuildevent commands in a bat file which you specify in the postbuildevent property of the vs.net project...

Frans Bouma | Lead developer LLBLGen Pro
Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 18-Aug-2004 15:45:29   

Otis wrote:

A workaround would be to place your postbuildevent commands in a bat file which you specify in the postbuildevent property of the vs.net project...

OK, thanks.