Author Topic: Code Snippets post build steps  (Read 6552 times)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Code Snippets post build steps
« 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?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Snippets post build steps
« Reply #1 on: February 27, 2012, 06:36:57 am »
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code Snippets post build steps
« Reply #2 on: February 27, 2012, 08:18:19 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 !

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Snippets post build steps
« Reply #3 on: February 27, 2012, 08:24:49 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.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Code Snippets post build steps
« Reply #4 on: February 27, 2012, 12:26:50 pm »
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.

Code
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)
 

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Code Snippets post build steps
« Reply #5 on: February 27, 2012, 11:31:35 pm »
These plugins do not run C::B's core update[.bat]-script !
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:
Code
$(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.