GnuCash is written principally in C. A Guile interpreter is built in and parts of Gnucash--principally reports, but also parts of the user configuration, file import, and other small parts--are in Scheme. The C API is wrapped for Guile access with SWIG; Python wrappers can be created with a configure option.
The GUI is built with GTK+ version 2.24.
We're supporting two build systems GNU autotools and CMake. Understanding this complex system isn't generally necessary for fixing simple bugs, but more complex work will. Here's an excellent autotools tutorial and a short CMake one.
We use Doxygen to document the sources, including the C API. Details about our use are on the Doxygen wiki page. The Help Manual and Concepts Guide are formatted using DocBook, an SGML markup language which enables us to publish them in several formats. Note that these documents have a separate repository.
Most of the code is written in an object-oriented style. Some of it uses GObject, some uses a home-grown GObject-like system called QofObject, and some just does what GObject does in straight C. Understanding how to use that is an important skill to developing for GnuCash. The next development cycle will include migrating those parts of Gnucash other than the GUI to C++; see our C++ page for details and resources. We are deferring updating the GUI either to Gtk+-3 or some other framework for at least another development cycle.
What We Need Help On
- Patches to fix bugs are always a appreciated. It's an excellent way to get familiar with the code base and to introduce yourself to the team.
- If you prefer to dive in at the deep end, have a look at the development team's long-term plans.
Look through the API documentation.
Getting Sources and Building
You can follow the git instructions for cloning the repository and preparing patches.
Build instructions for various platforms are described or linked at Building.
- Please try to develop according to Test Driven Development principles, following our Testing guidelines.
- Please follow our coding style.
- If your code will contain textual output for the user, have a look at Translation: Tips for Developers.
- Be sure that make check passes before preparing your patch or pushing your commit.
If your code adds or changes some functionality, do not forget the documentation.
- Make sure that global (i.e. not static) functions are documented with Doxygen-formatted comments.
- Try to keep the README files and that in src/doc up to date.
- Update the relevant sections in Help Manual and the Concept Guide.
Once you have your changes written and well tested—make check will run a bunch of tests—you'll want to submit it so that someone with commit privilege can add it to the official sources. There are two ways we accept code:
- Github pull requests: This is the preferred method if the change is non-trivial.
- If there is already a bug report on the matter be sure to include a link to the bug in the pull request and comment on the bug with a link to the pull request.
- Attach a patch to a bug report:
- Make a patch.
- If there's already a bug about it in Bugzilla, just attach the patch to the bug. Be sure to check the "patch" checkbox on the attachment form.
- If there isn't a bug already (be sure to search!), you'll need to create a new one to attach your patch to:
- Describe the problem or improvement that your patch addresses in the initial comment.
- Open the bug before you commit your changes so that you can include the bug number in the commit message.
Text editors / IDE:
- Most developers seem to have used Emacs as IDE.
- Additionally there are some experiences with Eclipse.
- Some are using QtCreator.
For the GTK GUI:
An informative mail from the archives.