| 9 | === Developer's quick start === |
| 10 | |
| 11 | Although you can find a lot of information on Mercurial and CMake on the Internet, the following are a few useful tips and tricks for starting development with freeDiameter. |
| 12 | Clone the repository:: |
| 13 | The following command will fetch the latest source tree in a {{{freeDiameter}}} directory: |
| 14 | {{{ |
| 15 | hg clone http://www.freediameter.net/hg/freeDiameter |
| 16 | }}} |
| 17 | |
| 18 | Update your source tree:: |
| 19 | When you already have cloned the repository, you can retrieve updates from upstream with the command bellow: |
| 20 | {{{ |
| 21 | hg pull -u |
| 22 | }}} |
| 23 | If you have made local changes, Mercurial will attempt to merge everything by it-self, which is very convenient. If you need archiving your changes, you might have a look at [http://mercurial.selenic.com/wiki/MqExtension Mercurial Queues]. |
| 24 | |
| 25 | Build and test:: |
| 26 | !Files/Directories named {{{test.*}}} are ignored by Mercurial in the freeDiameter package ([source:.hgignore]). The following files can reside in your tree without interacting with the repository, and simplify your build-and-test process: |
| 27 | {{{ |
| 28 | $ ls test.conf/ |
| 29 | CMakeFlags freeDiameter.conf myextension.conf |
| 30 | }}} |
| 31 | {{{ |
| 32 | $ cat test.rebuild |
| 33 | #!/bin/bash -x |
| 34 | rm -rf test.build |
| 35 | cp -Rs `pwd`/test.conf test.build |
| 36 | cd test.build |
| 37 | cmake `cat CMakeFlags` .. |
| 38 | make |
| 39 | }}} |
| 40 | This allows you to save your configuration files in {{{test.conf}}} directory, and rebuild the whole tree from scratch in a different folder by simply running the {{{test.rebuild}}} script. |
| 41 | |
| 42 | Useful CMake flags for development:: |
| 43 | The following flags are useful for configuring the source, for example in CMakeFlags file (see previous point). |
| 44 | {{{ |
| 45 | -DCMAKE_BUILD_TYPE:STRING=Debug |
| 46 | }}} |
| 47 | This impacts both the compiler's flags (including symbols for debug) and freeDiameter itself (allowing some slow tracing options such as {{{--dbg-func}}}). |
| 48 | {{{ |
| 49 | -DSKIP_TESTS:BOOL=OFF |
| 50 | }}} |
| 51 | Allows the compilation of the unit tests, called by running {{{make test}}}. |
| 52 | {{{ |
| 53 | -DBUILD_TEST_APP:BOOL=ON |
| 54 | }}} |
| 55 | Compile the test application extension [wiki:test_app.fdx]. |
| 56 | |