A set of gradle plugins which provide utility tasks and functions which I often use in my projects.
You want to use one of them as well?
Sweet 😄 the following sections will cover a few features. They are most probably not complete (and maybe out-dated, bear with me, as far as I know I am the only one using them).
Please open an issue, if you find a bug or need some help.
The following sections give brief information what the different plugins offer.
ch.tutteli.gradle.plugins.dokka 🔗
Applies the dokka-plugin and defines a sourceLink
per dokkaSourceSet
.
If the project version follows the pattern x.y.z, then an externalDocumentationLink
per dokkaSourceSet
is defined in addition.
The url used for the sourceLink
and the externalDocumentationLink
is based on a given githubUser.
Last but not least, it automatically configures dokka to look in test folder for *Samples.kt files for samples linked
in KDoc.
ch.tutteli.gradle.plugins.junitjacoco 🔗
Applies the junit-platform-gradle-plugin as well as the jacoco-plugin and applies some default configuration.
This plugin does not set up a junit engine and you need to define it yourself. Have a look at build.gradle for an example.
ch.tutteli.gradle.plugins.kotlin.module.info 🔗
Intended to be used in a kotlin project where either module-info.java is the single java source file or where >= jdk 11 is used.
It sets up compileJava accordingly and configures JavaCompile tasks to use jdk 11 for sourceCompatibility
/targetCompatibility
if not already set or higher.
Per default, it reads the module name (which is used for --patch-module
) from the defined module-info.java.
You can speed up this process (in case you have many java files) by defining moduleName
on project.extra
.
ch.tutteli.gradle.plugins.publish 🔗
Applies the maven-publish
and signing
plugin and
configures them based on given license(s), a github user and a few other information.
It exposes the tutteliPublish
extension which lets you specify those information and refine default conventions.
Have a look at the example in the tests
for more information.
If not set, it automatically propagates version
and group
from rootProject
to subprojects
(group
of subprojects are set to "" when plugin is applied, would default to rootProject.name
).
If no MavenPublication is defined, then it creates one which:
- automatically uses
project.components.java
if available. - includes all Jar Tasks into the publication (you can use an
artifactFilter
to exclude some)
Regardless if there was one or several existing MavenPublications or one was created by the plugin. All Jar Tasks are modified in a way that they include the LICENSE(.txt) file located in the root of the rootProject and augments the manifest file with information such as Vendor, Kotlin-version used etc.
Last but not least, it augments the pom-file with license, developer and scm information (can be configured via the tutteliPublish
extension)
The conventions:
- Apache 2.0 is used as default license
- project.group, project.description and project.version is used in publishing
- configures
singing
touseGpgCmd
ch.tutteli.gradle.plugins.spek 🔗
-> will most likely be removed with 6.0.0 (spek is no longer a reliable test runner IMO regarding maintenance)
Applies the junitjacoco plugin (which itself applies the junit and jacoco plugin, see two sections above)
and sets up Spek as junit engine.
Requires that a JVM compliant kotlin plugin is applied first.
Moreover, it adds mavenCentral()
to the repositories and sets up kotlin dependencies:
kotlin-stdlib as implementation and kotlin-reflect as testImplementation dependency -- kotlin-reflect is required by spek.
All tutteli gradle plugins are licensed under Apache 2.0.