User forums > Help

Post-compilation steps not getting saved

(1/1)

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:

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

--- End code ---


and this is what the project loader expects:

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

--- End code ---


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


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


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.

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

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

--- End code ---

should be something like

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

--- End code ---

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.

mandrav:
Which C::B version are you referring to?

Yiannis.

thomas:
1.0finalbeta build May 15 2005, 16:02:37

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

Yiannis.

rickg22:
I submitted it. :)

Navigation

[0] Message Index

Go to full version