News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Post-compilation steps not getting saved

Started by thomas, June 10, 2005, 07:08:15 PM

Previous topic - Next topic

thomas

I already solved it for myself, just writing in case anyone else has the same problem:

Post compile steps are "broken" when there are pre-compile steps at the  same time. The reason is that the project saver and the project loader don't quite speak the same language, so the pre-compile steps get loaded while the post-compile steps don't.

This is what goes into the project file:

<ExtraCommands>
   <Add before="this is done before compile"/>
</ExtraCommands>
<ExtraCommands>
   <Add after="this being done after"/>
</ExtraCommands>


and this is what the project loader expects:

<ExtraCommands>
   <Add before="this is done before compile"/>
   <Add after="this being done after"/>
</ExtraCommands>


A functional workaround (if you are reluctant to rebuild c::b) is this:


sed  -e 'N;s/\n//;N;s/\n//;s%</ExtraCommands>\s*<ExtraCommands>%%g'  project.cbp


Quite nasty, but put in a batch file, it is not that painful really, and it fixes things :)



The "guilty" function in projectloader.cpp (for those who *want* to recompile c::b) is ProjectLoader::DoExtraCommands.

TiXmlElement* node = parentNode->FirstChildElement("ExtraCommands");
if (!node)
return; // no options

TiXmlElement* child = node->FirstChildElement("Add");
while (child)
{
...
}

should be something like

if( !(TiXmlElement* node = parentNode->FirstChildElement("ExtraCommands")) )
return;
do
{
TiXmlElement* child = node->FirstChildElement("Add");
while (child)
 {
 ...
 }
}while ( ( TiXmlElement* node = node->NextSiblingElement("ExtraCommands") ) )

One could argue, too, that the project is correctly read in, as several Adds inside one ExtraCommands seems more logical. In that case the save function would have to be changed.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

mandrav

Which C::B version are you referring to?

Yiannis.
Be patient!
This bug will be fixed soon...

thomas

1.0finalbeta build May 15 2005, 16:02:37
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

mandrav

Mind submitting a bug report about this? It will be forgotten if it is just left here...

Yiannis.
Be patient!
This bug will be fixed soon...

rickg22