Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: andrej] on November 30, 2014, 01:56:22 pm

Title: ClangFormat wrapper plugin
Post by: andrej] on November 30, 2014, 01:56:22 pm
I'm trying to write a clang-format (http://clang.llvm.org/docs/ClangFormat.html) wrapper plugin and I can't find a way to build a plugin anyhow (win32 platform). All of the tutorials are outdated and none of them work (including http://wiki.codeblocks.org/index.php?title=Compile_Code::Blocks_plugins_based_on_a_nightly). Can anyone post a quick step-by-step for plugin building? I'll extrapolate the rest from the existing plugins' sources.

Clang format is the superior code formatting tool for C/C++. I use it with Sublime Text 3 and it just kicks ass - it's way smarter and more capable than Astyle, with pretty much complete C++11 support. The inferface (a console utility with both file and stdin/out inputs and outputs; all options available via parameters) is absolutely perfect for writing it into a plugin.

I think many people would benefit from this (tbh, I'm doing this for my girlfriend, she's used to CB and doesn't wanna learn make + Sublime), so, PLEASE help me learn how to build a plugin.
Title: Re: ClangFormat wrapper plugin
Post by: ollydbg on November 30, 2014, 02:05:21 pm
I'm trying to write a clang-format (http://clang.llvm.org/docs/ClangFormat.html) wrapper plugin and I can't find a way to build a plugin anyhow (win32 platform). All of the tutorials are outdated and none of them work (including http://wiki.codeblocks.org/index.php?title=Compile_Code::Blocks_plugins_based_on_a_nightly). Can anyone post a quick step-by-step for plugin building? I'll extrapolate the rest from the existing plugins' sources.
I think you can read this: Builld C::B on Windows (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows), which is more complete than Compile Code::Blocks plugins based on a nightly (http://wiki.codeblocks.org/index.php?title=Compile_Code::Blocks_plugins_based_on_a_nightly)

Once you can build C::B and all it's plugins, you can simply copy one plugin source and make your own plugin.

EDIT:
we have many core plugins and contributed plugins in C::B trunk, so learn how to build a simple plugin is not that hard.
Title: Re: ClangFormat wrapper plugin
Post by: andrej] on November 30, 2014, 02:30:04 pm
thank you! that'll get me going!