This composite module houses the gradle plugins that are used in the main SDK; to assist in a number of monotonous tasks. You can read more on these plugins and the tasks they create below.
Creates and manages changelog files. These files are used to signify changes made to the repo that should invoke a release, alongside text to display in the release notes at release time.
Change files are (by default) created under the .changes
directory at the root of the repo.
These files are json encoded variants of a Changelog instance-
which is just an organization of what impact the change had (will it invoke a patch, minor, or
major bump?) and an (optional) end-user readable message to show alongside the other changes at
release time. By default, the files are saved as a random sequence of four words (to avoid
collisions).
During a release cycle, the .changes
directory will be filled with change files. When it comes to
release time, these changes will be combined into a single release_notes.md
file that contains
all the changes made- in a consumable format. After a release, the .changes
directory will be
wiped, and the cycle will continue.
To assist in this endeavour, the ChangelogPlugin registers an internal plugin and a few tasks:
An internal plugin (automatically added, and cannot be explicitly applied) that facilitates the
generation of .api
files.
The APIPlugin registers the two following tasks to facilitate this process:
- buildApi -> Creates a
.api
file containing the public API of the project. - exportApi -> Exports the
.api
file generated by thebuildApi
task to a file at the project directory namedpublic.api
.
The ChangelogPlugin registers the four following tasks:
- findChanges -> Creates a new
.api
file for the current project, and compares it to the existingreleased.api
to create a diff of changes made to the public api. - makeChange -> Creates a new
.json
file in the.changes
directory with an optional message, including the version impact inferred fromfindChanges
. - warnAboutApiChanges -> If
findChanges
finds changes that will have version implications, this task will create aapi_changes.md
in the root project's build directory, with a message to display to the developer regarding what they changed, and the impact it will have on the public API. If no public API changes are found, this task will just skip itself. - deleteChangeFiles -> Deletes
all the change files in the
.changes
directory, intended to be used after the release notes have been created- or otherwise during a cleanup stage of the release. - makeReleaseNotes -> Creates a
release_notes.md
in the root project's build directory, containing a collection of all the changes in the.changes
directory; including the new project version at the top of file (inferred from the highest impact change).
Handles the checking and adding of license headers to the top of all source files.
The LicensePlugin registers the two following tasks to facilitate this process:
- validateLicense -> Validate that a license header in present in a set of files.
- ApplyLicenseTask -> Applies a license header to a set of files.
Facilitates the procedures expected to be done during a release.
While the publishAllPublicationsToMavenRepository
task is used to actually generate the release
artifact, this plugin registers tasks that should be ran before the release artifact is generated.
Effectively "preparing" the project to be released.
The ReleasePlugin registers the three following tasks:
- updateVersion -> Updates the project
version declared in the
gradle.properties
file to reflect the version generated by the release notes. - createNewApiFile -> Creates a new
.api
file in the rootapi
directory; aligning with the current state of the public api. - prepareRelease -> Does everything needed to prepare a release; creates the release notes and runs the above tasks.