News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Code Snippets post build steps

Started by Alpha, February 27, 2012, 04:20:48 AM

Previous topic - Next topic

Alpha

Is there any reason Code Snippets tries to run update.bat - albeit unsuccessfully - as a post build step (on Windows) during the compilation of contrib plugins?

ollydbg

I think it's a bug to add "update.bat" in codesnippets.cbp file.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Quote from: ollydbg on February 27, 2012, 06:36:57 AM
I think it's a bug to add "update.bat" in codesnippets.cbp file.
No, it's not.
Several contrib-plugins have their own update[.bat]-script to run all post-build-steps through one file.
It's easier to test and to maintain.

These plugins do not run C::B's core update[.bat]-script !

ollydbg

Quote from: jens on February 27, 2012, 08:18:19 AM
Quote from: ollydbg on February 27, 2012, 06:36:57 AM
I think it's a bug to add "update.bat" in codesnippets.cbp file.
No, it's not.
Several contrib-plugins have their own update[.bat]-script to run all post-build-steps through one file.
It's easier to test and to maintain.

These plugins do not run C::B's core update[.bat]-script !
Oh, thanks. (I was not aware of that :))
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Pecan

Quote from: Alpha on February 27, 2012, 04:20:48 AM
Is there any reason Code Snippets tries to run update.bat - albeit unsuccessfully - as a post build step (on Windows) during the compilation of contrib plugins?

Specifically, to create the folders that may not exits.
Is there a reason you say it's unsuccessful. It works here.

Output size is 10.37 MB
Running project post-build steps
update.bat
Process terminated with status 0 (1 minutes, 29 seconds)
0 errors, 1 warnings (1 minutes, 29 seconds)


Alpha

Quote from: jens on February 27, 2012, 08:18:19 AM
These plugins do not run C::B's core update[.bat]-script !
Quote from: Pecan on February 27, 2012, 12:26:50 PM
Is there a reason you say it's unsuccessful. It works here.
Sorry, I had gotten confused reading the log output (or lack thereof :) > nul 2>&1).  If it is unwanted to have the commands themselves in the post build steps:

$(CMD_RM) ..\..\..\output\share\CodeBlocks\plugins\codesnippets.exe
zip -j9 ..\..\..\devel\share\CodeBlocks\codesnippets.zip manifest.xml
$(CMD_MKDIR) ..\..\..\devel\share\CodeBlocks\images\codesnippets
$(CMD_CP) .\resources\*.png ..\..\..\devel\share\CodeBlocks\images\codesnippets\
$(CMD_MKDIR) ..\..\..\output\share\CodeBlocks\images\codesnippets
$(CMD_CP) .\resources\*.png ..\..\..\output\share\CodeBlocks\images\codesnippets\

then perhaps it would be useful to add an explanatory echo to the beginning of the update.bat (for example echo Copying resources) to prevent unnecessary reports from people like me.