| 1 |
DEVELOPER INFO |
| 2 |
============== |
| 3 |
|
| 4 |
CODING CONVENTIONS |
| 5 |
------------------ |
| 6 |
|
| 7 |
We are aware of the fact that not the whole codebase uses the same conventions at the moment. |
| 8 |
But we would like to establish the following rules, based on best practices. The numbering has no deeper meaning, |
| 9 |
its just for referencing the items. |
| 10 |
|
| 11 |
1. Use the tabs for indentation. Set the tabwidth of your editor to 4. |
| 12 |
|
| 13 |
2. Allow extra space within parentheses, like this: |
| 14 |
|
| 15 |
while( !done ) { |
| 16 |
foo(); |
| 17 |
} |
| 18 |
|
| 19 |
3. Please don't refactor our code because you just don't like its style or you think that things could be |
| 20 |
just a little bit better if reformat the code to fit your style. |
| 21 |
|
| 22 |
4. Use curly braces for all if statements, even one liners. We don't need to minimize the lines of code. |
| 23 |
|
| 24 |
Good: if( a ){ |
| 25 |
doB(); |
| 26 |
} |
| 27 |
|
| 28 |
Error prone: if( a ) doB(); |
| 29 |
|
| 30 |
if( a ) |
| 31 |
doB(); |
| 32 |
|
| 33 |
5. Method names follow the camel case naming scheme, starting with a lowercase letter. |
| 34 |
|
| 35 |
Example: void doB( int * myArgument ); |
| 36 |
|
| 37 |
6. Use speaking and self-explaining names for your variables (exception: loop-variables). We don't need to use short |
| 38 |
likes i,n,aux etc... |
| 39 |
|
| 40 |
7. Prepend pointer types with a "p" (for example: pMySample), floats with an "f", integer types with an "n" and |
| 41 |
members of a class with an "m_" (for example: m_pEngine) |
| 42 |
|
| 43 |
8. Use "auto" or range-based for loops to make iterations on container classes more readable |
| 44 |
|
| 45 |
9. The singleton pattern is quite over-used in Hydrogen. If you're adding new classes / servers, |
| 46 |
please take a moment to consider if it really has to be a singleton. |
| 47 |
|
| 48 |
10. Maximum line length is 120 chars |
| 49 |
|
| 50 |
11. Hydrogen is a cross platform application, which needs to be build on a great range of architectures and operating systems. |
| 51 |
Use only C++17 features and do not use any platform specific compiler extensions without the need to do so. |
| 52 |
|
| 53 |
COMMITTING YOUR CODE |
| 54 |
------------------- |
| 55 |
|
| 56 |
The easiest way to participate in the development of hydrogen is to create a fork at github and create a pull request |
| 57 |
from your changes. |
| 58 |
|
| 59 |
Please take the following things into account: |
| 60 |
|
| 61 |
1. If you want to send us a bug fix, please include only the commits which are part of the bug fix. Do *not* mix in new |
| 62 |
features or refactor code. |
| 63 |
|
| 64 |
2. You can reference the github issue number in your pull request if you want to fix a bug which is already known in our bugtracker |
| 65 |
|
| 66 |
|
| 67 |
MAKING A RELEASE |
| 68 |
---------------- |
| 69 |
|
| 70 |
Transitioning the code to remove some of the development hooks in |
| 71 |
order to make a release has several, easy-to-forget steps. They are: |
| 72 |
|
| 73 |
1. Set the version |
| 74 |
a. Configure the correct version in CMakeLists.txt |
| 75 |
|
| 76 |
b. Update CHANGELOG.md |
| 77 |
|
| 78 |
c. Check if nothing has changed and update version and date in |
| 79 |
linux/hydrogen.1 |
| 80 |
|
| 81 |
d. Update the `TARGET_VERSION` variable in [.appveyor.yml](.appveyor.yml) |
| 82 |
|
| 83 |
e. In default config file [data/hydrogen.default.conf](data/hydrogen.default.conf) |
| 84 |
|
| 85 |
2. Run `src/gui/src/about_dialog_contributor_list_update.sh |
| 86 |
GIT_TAG_OF_LAST_RELEASE HEAD` to update the list of recent |
| 87 |
contributors. |
| 88 |
|
| 89 |
3. Add a corresponding version tag in the documentation and update |
| 90 |
the submodule. |
| 91 |
|
| 92 |
4. Commit your changes. |
| 93 |
|
| 94 |
5. Create a dedicated branch containing the suffix `-artifacts`, like |
| 95 |
`releases/1.2.2-release-artifacts`, and manually set in `CMakeLists.txt` |
| 96 |
the `IS_DEVEL_BUILD` variable to "false" and ensure `DISPLAY_VERSION` does |
| 97 |
not have a suffix as well as removing the lines from the Windows pipeline |
| 98 |
in `.appveyor` tweaking the `DISPLAY_VERSION` variable according to tag and |
| 99 |
commit id. When pushing this branch to Github, our AppVeyor pipeline will |
| 100 |
create release artifacts for Linux, macOS, and Windows. |
| 101 |
|
| 102 |
6. Call your friends. Have a party. Be sure to tests the artifacts |
| 103 |
on as many systems as possible. Be sure to install and uninstall |
| 104 |
them, too. |
| 105 |
|
| 106 |
7. If the release passes these "internal" tests, add new version, |
| 107 |
date, CHANGELOG.md as well as the release artifacts including their |
| 108 |
SHA256 sums to `linux/org.hydrogenmusic.Hydrogen.metainfo.xml.in` |
| 109 |
and run `make` in `linux/` folder |
| 110 |
|
| 111 |
8. Tag the release. Remember, after tagging the release you may not |
| 112 |
commit changes to the tag. |
| 113 |
|
| 114 |
git tag -a 0.9.4 -m "Tagging 0.9.4" |
| 115 |
git push --tags origin |
| 116 |
|
| 117 |
9. In case the release is a new major or minor version, also create |
| 118 |
a dedicated release branch, like `releases/1.2`. |
| 119 |
|
| 120 |
10. Create a github release, incorporating binary packages, source |
| 121 |
package, tag and release announcement. |
| 122 |
|
| 123 |
11. Upload the release to SourceForge and make it the default download |
| 124 |
for all supported platforms. |
| 125 |
|
| 126 |
12. Add the new download links to the `README.md` on the `main` branch as well |
| 127 |
as the Download section of the hydrogen-music.org web page. |
| 128 |
|
| 129 |
13. Make release announcements on |
| 130 |
- [email protected] |
| 131 |
- hydrogen-music.org |
| 132 |
|
| 133 |
14. Update third party repos. Make a PR against: |
| 134 |
- Homebrew: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/hydrogen.rb |
| 135 |
- Flatpak: https://github.com/flathub/org.hydrogenmusic.Hydrogen/ |