Author Topic: New plugin: Project options  (Read 20019 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
New plugin: Project options
« on: December 28, 2013, 09:13:42 pm »
A new plugin has arrived: Project Options (maybe not a very nice title, but wtf...)

What does it do?
It allows mass-manipulation of project and/or target options in a workspace or a specific project.
It is intended to cleanup projects in a workspace.

Possible use-cases:
  • Search which target has a specific compiler or linker option
  • Remove certain flags from all compiler options
  • Add certain flags to linker options with all projects of a workspace at project level
  • ...

Source code attached, place it in the "plugin" -> "contrib" folder and compile against C::B as usual.

I would welcome feedback - if people find it useful I might add it to the plugins in SVN.
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 gd_on

  • Lives here!
  • ****
  • Posts: 800
Re: New plugin: Project options
« Reply #1 on: December 29, 2013, 07:14:09 pm »
Thanks.
I tried it.
Somme suggestions here after :
1) : you should use the macro _ instead of wxT in ProjectOptions.cpp at lines 164, 180, 242, 247, 263, 268 to allow the translation of the strings in the result window.
2) : when there are no results, nothing is displayed. It could be nice to have a windows containing the string "No results" or something more elaborated.
3) : when a result window has been displayed, could it be possible to restart directly the plugin (for example with a specific button), because if I want to try an other set of options I have to go trough the menus Extensions/Project Options.
4) : when you delete an option, it could be nice to have a summary in the result window to know exactly where the option has been deleted.
5) : the string menu "Search for NOT w/ option" is not very clear for me. I think that it's to display the results with and without this option and only for compiler options (because I don't see any difference with link options).
Nevetheless, thanks

gd_on
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.5 (tests with 3.3), Msys2 Compilers 14.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: New plugin: Project options
« Reply #2 on: December 29, 2013, 07:38:00 pm »
add it to trunk, people can play with it (contrib plugins), much easier to get feedback.

what do you think ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New plugin: Project options
« Reply #3 on: December 29, 2013, 07:42:34 pm »
Some comments on the project file/naming:
1. please use lower case plus underscores to prevent any OS porting issues.
2. external dependencies are not needed here (I think), because C::B should detect them auto-magically.
3. the post build action should use devel/codeblocks instead of devel/CodeBlocks (I know we have to have two sets of projects).
« Last Edit: December 29, 2013, 07:45:54 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New plugin: Project options
« Reply #4 on: December 29, 2013, 07:56:24 pm »
4. The code style needs fixing
!!! 5. You've named you dialog ProjectOptionsDlg which is the same as the ProjectOptionsDlg in src/src. This causes symbols collision on linux and thus a crash. You'll have to rename your dialog for now. Later we should begin using -fvisibility=hidden!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: New plugin: Project options
« Reply #5 on: December 29, 2013, 08:08:11 pm »
6. The results dialog should probably use a listctrl instead of textctrl (this will make the output a bit clearer)
6.1. When you switch to listctrl and it will be if you make double click on an item to open the build options dialog.
7. The results dialog should probably be an editor, allowing multiple instances
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: New plugin: Project options
« Reply #6 on: December 29, 2013, 08:22:38 pm »
Oh well... sure it can be enhanced. :-)

I actually needed it to clean-up the Unix project files related to a specific linker flag that is no longer supported on MacOSX.
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 ouch

  • Almost regular
  • **
  • Posts: 223
Re: New plugin: Project options
« Reply #7 on: December 30, 2013, 09:56:06 pm »
heh, well I can me using this. But it would be nice if it didn't disappear after a search is done. I would like to hammer in multiple searches to make sure I got everything set correctly.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: New plugin: Project options
« Reply #8 on: January 03, 2014, 03:13:29 pm »
...added to SVN. Hopefully I didn't screw the (unix) build system... ???

However, patches for additional features are welcome. :-)
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 killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: New plugin: Project options
« Reply #9 on: January 03, 2014, 03:42:14 pm »
Code
make[5]: Leaving directory `/home/killerbot/CodeBlocks/sf/trunk/src/plugins/contrib/profiler'
make[4]: Leaving directory `/home/killerbot/CodeBlocks/sf/trunk/src/plugins/contrib/profiler'
Making all in ProjectOptionsManipulator
make[4]: Entering directory `/home/killerbot/CodeBlocks/sf/trunk/src/plugins/contrib/ProjectOptionsManipulator'
make[4]: *** No rule to make target `all'.  Stop.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: New plugin: Project options
« Reply #10 on: January 03, 2014, 03:45:44 pm »
Code
make[5]: Leaving directory `/home/killerbot/CodeBlocks/sf/trunk/src/plugins/contrib/profiler'
make[4]: Leaving directory `/home/killerbot/CodeBlocks/sf/trunk/src/plugins/contrib/profiler'
Making all in ProjectOptionsManipulator
make[4]: Entering directory `/home/killerbot/CodeBlocks/sf/trunk/src/plugins/contrib/ProjectOptionsManipulator'
make[4]: *** No rule to make target `all'.  Stop.
I just fixed this in trunk.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: New plugin: Project options
« Reply #11 on: January 03, 2014, 03:57:00 pm »
fix confirmed

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: New plugin: Project options
« Reply #12 on: January 03, 2014, 04:01:23 pm »
little feedback : result window can be bigger :

Code
Project 'General': Contains compiler option '-std=c++0x'.
Project 'TinyXml': Contains compiler option '-std=c++0x'.
Project 'DetectionLibrary': Contains compiler option '-std=c++0x'.
Project 'DetectionApplication': Contains compiler option '-std=c++0x'.

I searched for -std=c++0x ;-)

thing were already wrapping after :
- the first 2 : word "compiler"
- the last 2 : word "Contains"

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: New plugin: Project options
« Reply #13 on: January 03, 2014, 04:12:28 pm »
little feedback : result window can be bigger :
Well you can resize the dialog as you like (hopefully - never tried, but usually I create dialogs resizeable).

And concerning the features: As I mentioned:
However, patches for additional features are welcome. :-)

There are many more things that would be nice: For example: Include directories, libraries and so on...

Maybe we should collect the wish-list in a file within the plugin sources - I am already lost with the feedback from here.
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: New plugin: Project options
« Reply #14 on: January 03, 2014, 04:15:05 pm »
The most useful at the moment (for me) would be to manipulate the "Custom variables" especially to make the wx30 projectfiles useful for wx-svn which is 3.1 and normally not build in standard path.

That's what I will try first.