CodeLite Plugin System: Question about making the plugin

Discussion about CodeLite development process and patches
SiZiOUS
CodeLite Curious
Posts: 6
Joined: Mon Mar 02, 2015 10:42 pm
Genuine User: Yes
IDE Question: C++
Contact:

CodeLite Plugin System: Question about making the plugin

Post by SiZiOUS »

Hello there :)

OK, I just started to take a look into the CodeLite source code in order to make my plugin.

I was able to set the complete environment for creating the plugin.
First of all, I followed this guide, but I made some fixes in order to compile the latest source code for developping the plugin:
  • I've created a Windows 7 x64 VM from scratch (everything is set up in the VM)
  • I've installed the Weekly Build of CodeLite (v7.1) x64 in its default location (C:\Program Files\)
  • I've installed the wxWidgets-3.0.2 setup package and I've chosen to install it on E:\wxWidgets-3.1, then I deleted the 3 folders inside (related to the 3.0.2 installation) and replaced the contents with the wxWidgets-3.1 7z package (I did this because the setup for 3.0.2 is setting some stuffs in environment variables, and I was too lazy to manually create these keys myself).
  • I installed the TDM-GCC x64 Version
  • I selected the Debug_x64 in the LiteEditor.workspace
  • I built the LiteEditor.workspace then after the codelite_utils.workspace, and everything was fine.
Then after I created a new plugin using the Wizard. But I did some fixes in the files generated (I think some refactoring has been done and the Wizard wasn't updated):
  • In the Plugin settings I changed the Linker settings for searching lib files in ../lib/gnu_gcc directory (instead of just ../lib)
  • I renamed the first DLL name (changed the name to include the 'sdk' reference on its name)
  • Since I compiled the whole CodeLite project in debug mode (instead of using the Release mode in my case) all generated DLL are named properly and contains the 'd' flag in their names.
At this point my plugin is properly generated and I have a DLL file in my plugin directory. :mrgreen:

Problem is, when I enable the code in the CreatePluginMenu in order to register a new item in the Plugins menu of the CodeLite, it does nothing.

So my questions are:
  • How to install the plugin? I've read about the update.bat script but I don't know how to use it properly. First of all there's a update64.bat file and in my case (everything's build in x64) do I need to use the 64 version or stick with the 32? And when I copy my DLL in the plugin folder nothing happens (the plugin isn't detected)
  • How can I debug the generated CodeLite? Can I do that from my installation (so the v7.1 in Program Files)?
  • And the most important thing: How can I debug my Plugin?
Thank you very much for your time and your answers!

Mike
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Plugin System: Question about making the plugin

Post by eranif »

SiZiOUS wrote:I selected the Debug_x64 in the LiteEditor.workspace
I assume you mean: Win_x64_Debug?
SiZiOUS wrote:How to install the plugin? I've read about the update.bat script but I don't know how to use it properly. First of all there's a update64.bat file and in my case (everything's build in x64) do I need to use the 64 version or stick with the 32? And when I copy my DLL in the plugin folder nothing happens (the plugin isn't detected)
When building on Windows, the update*.bat scripts will not copy any of the -dbg.dll files (this is because codelite will crash if mixing between debug and release DLLs)
So you can't install a debug plugin. However, if you hit Ctrl-F5 CodeLite will start properly (it will run codelite-dbg.exe and not codelite.exe) and it will also force it to load plugins from the Runtime/plugins folder by passing the "-b" switch (it is all set up already for you, you don't need to do anything)

The update.bat (or 64 bit version) should be used when building the release version of CodeLite, in that case, it will copy the DLLs to %INSTALL-FOLDER%\CodeLIte\plugins
And the most important thing: How can I debug my Plugin?
To Debug codelite-dbg.exe just hit F5 ... (assuming the selected workspace configuration is Win_x64_Debug and the active project is CodeLiteIDE)

FYI: we also hang on the IRC channel #codelite @ irc.freenode.net fo

Eran
Make sure you have read the HOW TO POST thread
SiZiOUS
CodeLite Curious
Posts: 6
Joined: Mon Mar 02, 2015 10:42 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Plugin System: Question about making the plugin

Post by SiZiOUS »

eranif wrote:I assume you mean: Win_x64_Debug?
Yes.
eranif wrote:When building on Windows, the update*.bat scripts will not copy any of the -dbg.dll files (this is because codelite will crash if mixing between debug and release DLLs)
So you can't install a debug plugin. However, if you hit Ctrl-F5 CodeLite will start properly (it will run codelite-dbg.exe and not codelite.exe) and it will also force it to load plugins from the Runtime/plugins folder by passing the "-b" switch (it is all set up already for you, you don't need to do anything)

The update.bat (or 64 bit version) should be used when building the release version of CodeLite, in that case, it will copy the DLLs to %INSTALL-FOLDER%\CodeLIte\plugins
OK so update*.bat scripts are made for making release of CodeLite, I understand. So in my case it isn't applicable (at least for now).
eranif wrote:To Debug codelite-dbg.exe just hit F5 ... (assuming the selected workspace configuration is Win_x64_Debug and the active project is CodeLiteIDE)
OK, I'll do that! It's a shame that I don't have think to try that...
eranif wrote:FYI: we also hang on the IRC channel #codelite @ irc.freenode.net fo
Thanks for the info :D
Starting for now I think I have every information I need to start my plugin. So thank you again for your time! :)
Post Reply