`Gradle <http://www.gradle.org/>`__ is the build system for OpenRocket. It is used to compile the source code, run tests, and create the JAR file.
Key features of Gradle are:
-**Incremental builds**: Gradle only rebuilds what is necessary, which makes the build process faster.
-**Dependency management**: Gradle has a robust dependency management system capable of handling project and third-party libraries.
-**Performance**: Gradle uses techniques like build caching and parallel execution to improve performance of the build process.
The root directory of the OpenRocket repository contains several Gradle files:
-``build.gradle``: This is the main build script file where you define your project configuration and tasks such as compile and run tasks, dependency management, plugins usage, and more.
-``settings.gradle``: Used for multi-project build configurations to include which sub-projects should be part of the build.
For OpenRocket, this file is used to identify the ``core`` and ``swing`` sub-projects.
-``gradle.properties``: Contains project-wide properties that can be accessed from the build script. For example, the version number of OpenRocket can be defined here.
-``gradlew`` and ``gradlew.bat``: These are Gradle Wrapper scripts for Unix-based and Windows systems respectively.
It allows users to run Gradle builds without requiring Gradle to be installed on the system.
The ``core`` and ``swing`` sub-projects contain their own ``build.gradle`` and ``gradle.properties`` files that define the tasks specific to those sub-projects.
- Creates a distributable JAR file of OpenRocket (a combination of the *core* and *swing* JAR) at :file:`openrocket/build/libs/OpenRocket-<build-version>.jar`.
- Fetch the latest thrust curves from ThrustCurve.org and serialize them to the OpenRocket format. The resulting serialized file is saved in the ``src`` dir so it can be used for a build.
- Same as ``serializeEngines``, but loads the serialized file to the distribution directory (:file:`openrocket/build`) so it can be used in the final build.
`install4j <http://www.ej-technologies.com/products/install4j/overview.html>`__ is used to create the packaged installers for OpenRocket from the JAR file.
install4j generously provides a free license for open source projects, including OpenRocket. Currently, only the OpenRocket administrators have access
An important part of generating the installers is `code signing <https://en.wikipedia.org/wiki/Code_signing>`__.
This is done to ensure that the installer is not tampered with between the time it is created and the time it is run by the user.
Once the OpenRocket installer has been code signed, users will receive no more (or the minimum amount of) warnings from
their operating system that the installer is from an unknown source and may contain malware.
More information on how to do code signing in install4j can be found `here <https://www.ej-technologies.com/resources/install4j/help/doc/concepts/codeSigning.html>`__.
Only the OpenRocket administrators have access to the code signing certificates.
Code signing for Windows is done using a digital certificate from Sectigo. More information on the code signing procedure,
including whitelisting OpenRocket by Microsoft, see the `README file on GitHub <https://github.com/openrocket/openrocket/blob/unstable/install4j/README.md>`__.
For macOS, the code signing is done using an Apple Developer ID. Besides code signing, the OpenRocket app also needs to
be notarized. Luckily, install4j takes care of this. More information on the code signing procedure for macOS can be found in the
`README file on GitHub <https://github.com/openrocket/openrocket/blob/unstable/install4j/README.md>`__.
The release procedure for OpenRocket is as follows:
1. Update the `ReleaseNotes.md <https://github.com/openrocket/openrocket/blob/unstable/ReleaseNotes.md>`__ with the changes that are part of the new release.
This includes new features, bug fixes, and other changes that are part of the release. Make sure to include the version number and the release date.
Take a look at the previous release notes to see how it should be formatted.
For official releases, the version number should use the format ``YY.MM`` (*year.month*). For example, if the software is released in
September 2023, the version number should be ``23.09``. If there are multiple releases in the same month, add an incremental number
to the version number, e.g. ``23.09.01``.
If a new release contains significant changes, it may be necessary to release alpha or beta versions first. In that case, the version
number should be appended with ``.alpha.`` or ``.beta.`` plus an incremental number. For example, if the software is in beta stage
in September 2023, the version number should be ``23.09.beta.01``. In general, alpha releases are not necessary. This is only for very rough releases.
Beta releases are only necessary if there are significant changes that need to be tested by the community before the final release.
One final option is to release a release candidate (RC) version. This is a version that is considered to be the final version,
but needs to be tested by the community before the final release. The version number should be appended with ``.RC.`` plus an incremental number.
For example, if the software is in RC stage in September 2023, the version number should be ``23.09.RC.01``.
The official release that comes after the beta release should have the same version number as the beta release, but without the ``.beta.`` part.
For instance, if the beta testing started in September 2023 with version number ``23.09.beta.01``, the final release should have version number ``23.09``,
even if the final release is in November 2023. This is to ensure consistency in the version numbering and to link the beta release(s) to the final release.
5.**Test the JAR file** to ensure that it works correctly and that the new version number is applied to the splash screen and under :menuselection:`Help --> About`.
The `source code for the website <https://github.com/openrocket/openrocket.github.io>`__ needs to be updated to point to the new release.
Follow these steps:
- Add the release to `downloads_config.json <https://github.com/openrocket/openrocket.github.io/blob/development/assets/downloads_config.json>`__.
- Update the ``current_version`` in `_config <https://github.com/openrocket/openrocket.github.io/blob/development/_config.yml>`__.
- Add a new entry to `_whats_new <https://github.com/openrocket/openrocket.github.io/tree/development/_whats-new>`__ for the new release.
Create a ``wn-<version number>.md`` file with the changes that are part of the new release. Please take a close look to the previous entries to see how it should be formatted.
- Update the `release notes <https://github.com/openrocket/openrocket.github.io/blob/development/_includes/ReleaseNotes.md>`__
(which is a link to the What's new file that you just created). Again, take a close look at the previous entries to see how it should be formatted.
..warning::
Make sure to **update the website on the**``development``**branch**. The ``master`` branch is the branch that is live
on the website. First update the ``development`` branch and test the changes on the website. In a later step, the
Send out the release announcement to the OpenRocket mailing list, the TRF forum, and the OpenRocket social media channels
(Discord, Facebook...).
The announcement should include the new features, bug fixes, and other changes that are part of the new release.
Make sure to include the download links to the new release. Here is an `example announcement <https://www.rocketryforum.com/threads/announcement-openrocket-23-09-is-now-available-for-download.183186/>`__.