Author Topic: XML based compilers resources  (Read 39982 times)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
XML based compilers resources
« on: January 07, 2013, 11:02:54 am »
Hi All,

I've noticed that the XML files from src\plugins\compilergcc\resources\compilers are not copied into devel\..., which caused my compiled version not to work.

Here's a patch to solve it, by using a post-build step to copy/update them.

Code
Index: src/CodeBlocks.cbp
===================================================================
--- src/CodeBlocks.cbp    (revision 8771)
+++ src/CodeBlocks.cbp    (working copy)
@@ -372,6 +373,8 @@
  <Add after="cmd /c if not exist devel\share\CodeBlocks mkdir devel\share\CodeBlocks" />
  <Add after="zip -jq9 devel\share\CodeBlocks\compiler.zip plugins\compilergcc\resources\manifest.xml plugins\compilergcc\resources\*.xrc" />
  <Add after='cmd /c &quot;cd plugins\compilergcc\resources &amp; zip -0 -q ..\..\..\devel\share\CodeBlocks\compiler.zip images\*.png images\16x16\*.png&quot;' />
+ <Add after="cmd /c if not exist devel\share\CodeBlocks\compilers mkdir devel\share\CodeBlocks\compilers" />
+ <Add after="cmd /c xcopy plugins\compilergcc\resources\compilers\*.* devel\share\CodeBlocks\compilers /y" />
  <Mode after="always" />
  </ExtraCommands>
  </Target>

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers resources
« Reply #1 on: January 07, 2013, 11:38:21 am »
Here's a patch to solve it, by using a post-build step to copy/update them.
Are you aware that this is done by the update.bat script which you need to run after compilation anyways?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: XML based compilers resources
« Reply #2 on: January 07, 2013, 11:54:28 am »
Here's a patch to solve it, by using a post-build step to copy/update them.
Are you aware that this is done by the update.bat script which you need to run after compilation anyways?
Yes, I'm aware, but I don't want to run it after compilation because I want to be able to run directly from devel without overwriting my output version.

I don't know if I'm doing something which is considered wrong or evil by the devs, but I use my output dir as my production dir and devel as my dev playground version.  ;)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers resources
« Reply #3 on: January 07, 2013, 12:09:58 pm »
I don't know if I'm doing something which is considered wrong or evil by the devs, but I use my output dir as my production dir and devel as my dev playground version.  ;)
Its not evil, but then you would need to do the same thing for all contrib plugins, where it is needed, too. Thats why I was asking... Or do you not use / compile contrib plugins?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: XML based compilers resources
« Reply #4 on: January 07, 2013, 12:31:04 pm »
I don't know if I'm doing something which is considered wrong or evil by the devs, but I use my output dir as my production dir and devel as my dev playground version.  ;)
Its not evil, but then you would need to do the same thing for all contrib plugins, where it is needed, too. Thats why I was asking... Or do you not use / compile contrib plugins?
I do use (and compile) the contrib plugins, but I haven't had problems so far because all the others rely on ZIP files which are generated by the post-build steps anyway.

BTW, I'm not very acquainted with the inner details of the plugin system, but why does these XML files for the compiler plugin have to be directly copied, while all other plugins put their files inside a ZIP file?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers resources
« Reply #5 on: January 07, 2013, 01:50:03 pm »
BTW, I'm not very acquainted with the inner details of the plugin system, but why does these XML files for the compiler plugin have to be directly copied, while all other plugins put their files inside a ZIP file?
Because they may be modified if you either change the compiler's options, or want to change the defaults. These XML files are explicitly there to be modified if needed (hence for experts only, to adjust the build system the way they like/need). So this is a read/write access, while usually plugin resources are read-only. The latter can be ZIPed.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: XML based compilers resources
« Reply #6 on: January 07, 2013, 01:52:55 pm »
Because they may be modified if you either change the compiler's options, or want to change the defaults. These XML files are explicitly there to be modified if needed (hence for experts only, to adjust the build system the way they like/need). So this is a read/write access, while usually plugin resources are read-only. The latter can be ZIPed.
Oh, I see. Now I understand... So, I'll keep the post-build patch on my local copy.  ;D