[84] | 1 | $Id: README.developer 494 2007-10-14 02:42:09Z peter $ |
---|
[26] | 2 | |
---|
[338] | 3 | = Developer Information = |
---|
| 4 | |
---|
| 5 | This file contains developer specific information. |
---|
| 6 | |
---|
[394] | 7 | |
---|
| 8 | === Coding style === |
---|
| 9 | |
---|
| 10 | Developers should follow the coding style outlined in the |
---|
| 11 | [http://www.thep.lu.se/~jari/documents/c++_coding_guidelines/index.html C++ coding guidelines]. |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | === Subversion usage === |
---|
| 15 | |
---|
| 16 | Commits should be minimalistic and the projects should always compile |
---|
[442] | 17 | (`make` and `make check`) when someone makes a clean checkout. There is |
---|
[394] | 18 | a short introduction to subversion and its usage available as |
---|
| 19 | [http://www.thep.lu.se/~jari/documents/subversion_guidelines/index.html Subversion guidelines]. |
---|
| 20 | We follow these guidelines. |
---|
| 21 | |
---|
| 22 | |
---|
[481] | 23 | === bootstrap and autoreconf === |
---|
[387] | 24 | |
---|
[481] | 25 | At first checkout from the repository you must run the bootstrapping |
---|
| 26 | utility |
---|
[338] | 27 | |
---|
| 28 | `./bootstrap` |
---|
| 29 | |
---|
[481] | 30 | to setup autoconf files. To push subsequent changes of this file into |
---|
| 31 | the build scripts you run |
---|
[338] | 32 | |
---|
[481] | 33 | `autoreconf` |
---|
[394] | 34 | |
---|
[481] | 35 | |
---|
[338] | 36 | === configure === |
---|
| 37 | |
---|
[387] | 38 | Run the generated configure script with |
---|
| 39 | |
---|
[338] | 40 | `./configure --enable-debug --enable-wctests` |
---|
| 41 | |
---|
| 42 | The option flag `--enable-debug` turns on debug options (e.g. enables |
---|
| 43 | assertions). The option flag `--enable-wctests` turns on some |
---|
| 44 | additional tests. All tests are not enabled by default since some of |
---|
| 45 | the tests depend on being run from a subversion WC. |
---|
| 46 | |
---|
[394] | 47 | |
---|
| 48 | === Testing === |
---|
| 49 | |
---|
| 50 | Test programs should be created and added to the `make check` |
---|
| 51 | execution. Always check that the test runs before committing code to |
---|
| 52 | the repository, i.e., run `make check`. |
---|
| 53 | |
---|
| 54 | There is a test repository in source:trunk/test/repo that is a part of |
---|
| 55 | the svndigest repository. The logic behind this is that it is nice to |
---|
| 56 | have a common test repository that can be used off-line. Changes to |
---|
| 57 | the repository are usually made to create new test cases and it is |
---|
| 58 | important that these changes are committed to svndigest repository as |
---|
| 59 | well. All changes to the test repository are not automatically |
---|
| 60 | propagated to the svndigest repository and it is important that some |
---|
| 61 | files created in the test repository are manually added to the |
---|
| 62 | svndigest repository. Assuming that `make check` is run before a |
---|
| 63 | commit, a warning is generated if the test repository is inconsistent |
---|
| 64 | with the svndigest repository. There will be a diagnostic message and |
---|
| 65 | a resolution hint, however the developer must examine and resolve the |
---|
| 66 | problem manually. |
---|
| 67 | |
---|
| 68 | The problem is simply that the file source:trunk/test/repo/db/current |
---|
| 69 | is changed compared to the svndigest repository. The `current` file |
---|
| 70 | indicates a specific number of change sets within the test repository |
---|
| 71 | and the directories source:trunk/test/repo/db/revs and |
---|
| 72 | source:trunk/test/repo/db/revprops contains a matching number of |
---|
| 73 | change sets. However, the change sets added to the test repository are |
---|
| 74 | not automatically added to the svndigest repository, therefore the new |
---|
| 75 | files in the `revs` and `revprops` directories must be added manually |
---|
| 76 | to the svndigest repository. |
---|
| 77 | |
---|
| 78 | There is also a race condition when developers make changes to the |
---|
| 79 | test repository simultaneously: It is easy to create severe conflicts |
---|
| 80 | in the test repository. Imaging the case when two developers adds test |
---|
| 81 | commits to the test repository, and then tries to add these to the |
---|
| 82 | svndigest repository. Since there are different versions of the same |
---|
| 83 | test repository revisions, the second developer committing to the |
---|
| 84 | svndigest will get messages about files being in the way. This is just |
---|
| 85 | one situation with possible conflicts. This conflict is of course |
---|
| 86 | resolved by the second developer having to throw away his changes and |
---|
| 87 | redo them after a new checkout of the test repository. |
---|
| 88 | |
---|
| 89 | The take home message is that developers should communicate with each |
---|
| 90 | other when changing the test repository in order to avoid to large |
---|
| 91 | repository conflicts. AND read the output of `make check`. |
---|
| 92 | |
---|
| 93 | |
---|
[494] | 94 | === Output file structure === |
---|
| 95 | |
---|
| 96 | A directory reflecting the parsed directory is generated for each |
---|
| 97 | combination of StatsType, Author, and LineType, which is located in |
---|
| 98 | `<TARGET>/<ROOT>/StatsType/Author/LineType/`. |
---|
| 99 | |
---|
| 100 | |
---|
[338] | 101 | === Create a distribution === |
---|
[387] | 102 | |
---|
[338] | 103 | Create a distribution package with `make dist`. Remember to test |
---|
| 104 | the package with `make distcheck`. If required packages are installed |
---|
| 105 | in non-standard locations you need to pass this information to |
---|
| 106 | `distcheck`. This is done by using the variable |
---|
| 107 | DISTCHECK_CONFIGURE_FLAGS as |
---|
| 108 | |
---|
[409] | 109 | `DISTCHECK_CONFIGURE_FLAGS="--with-apr=/usr/local/apr" make distcheck` |
---|
[338] | 110 | |
---|
| 111 | Usually you need to set DISTCHECK_CONFIGURE_FLAGS to whatever options |
---|
| 112 | you pass to configure with the exception of `--enable-wctests`. |
---|
[387] | 113 | Passing `--enable-wctests` to distcheck will always make the `make` to |
---|
[388] | 114 | fail because a distribution does not contain all files needed for WC |
---|
[387] | 115 | tests. |
---|
[338] | 116 | |
---|
| 117 | |
---|
[394] | 118 | == Releasing == |
---|
[338] | 119 | |
---|
[439] | 120 | See http://trac.thep.lu.se/trac/svndigest/wiki/ReleaseProcedure |
---|
[394] | 121 | |
---|
| 122 | |
---|
[338] | 123 | ------------------------------------------------------------------------- |
---|
| 124 | {{{ |
---|
[408] | 125 | Copyright (C) 2005, 2006 Jari Häkkinen |
---|
[394] | 126 | Copyright (C) 2007 Jari Häkkinen, Peter Johansson |
---|
[84] | 127 | |
---|
[439] | 128 | This file is part of svndigest, http://trac.thep.lu.se/trac/svndigest |
---|
[84] | 129 | |
---|
[149] | 130 | svndigest is free software; you can redistribute it and/or modify it |
---|
[84] | 131 | under the terms of the GNU General Public License as published by the |
---|
| 132 | Free Software Foundation; either version 2 of the License, or (at your |
---|
| 133 | option) any later version. |
---|
| 134 | |
---|
[149] | 135 | svndigest is distributed in the hope that it will be useful, but |
---|
| 136 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 137 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 138 | General Public License for more details. |
---|
[84] | 139 | |
---|
| 140 | You should have received a copy of the GNU General Public License |
---|
| 141 | along with this program; if not, write to the Free Software |
---|
| 142 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
---|
| 143 | USA. |
---|
| 144 | |
---|
[338] | 145 | }}} |
---|