This composite module houses the gradle plugins that are used in all the SDKs in this repo; 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 a project 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. They
are then further filtered into sub directories according to the project name. 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 five following tasks:
- findChanges -> Creates a new
.api
file for the current project, and compares it to the latest.api
file in the rootapi
directory- to create a diff of changes made to the public api. - makeChange -> Creates a new
.json
file in the root.changes
directory (under the subdirectory for this project) with an optional message, including the version impact inferred fromfindChanges
. - warnAboutApiChanges -> If
findChanges
finds changes that will have version implications, this task will create a markdown file corresponding to the project's name in the root project's build directory underapi_changes
, 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
markdown file corresponding to the project's name in the root project's build directory under
release_notes
, 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.
Works in conjunction with the ReleasePlugin
to facilitate a release for all SDKs with changes.
The MultiProjectPlugin registers the three following tasks:
- warnAboutApiChanges -> Runs
the
warnAboutApiChanges
task from theChangelogPlugin
on each SDK, and then combines their changes into a single file under the root project's build directory calledapi_changes.md
. - makeReleaseNotes -> Runs
the
makeReleaseNotes
task from theChangelogPlugin
on each SDK, and then combines their release notes into a single file under the root project's build directory calledrelease_notes.md
. - prepareRelease -> Does everything needed to prepare a release for all SDKs; creates the combined release notes and runs the above tasks (and also deletes the excess change files).
- release Publishes the current
artifacts to maven local and the configured maven repository. Should be ran after
prepareRelease
.