Skip to content
Gradle plugins that help manage Knot.x modules builds.
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src/main/kotlin/io/knotx
.gitignore
LICENSE
README.md
azure-pipelines.yml
build.gradle.kts
gradle.properties
gradlew
gradlew.bat
settings.gradle.kts

README.md

Build Status

knotx-gradle-plugins

Gradle plugins that help manage Knot.x modules builds.

Plugins

Distribution Plugin

Distribution Plugin identifies good practices on how to create a custom Knot.x distribution. This is a set of tasks that you can use when starting a new project, regardless of whereter it is Docker-based or not.

How to use

Declare the plugins section in your build script

plugins {
    id("io.knotx.distribution")
}

Then point to the root directory with the Knot.x configuration, setting the knotx.conf property in gradle.properties. E.g:

knotx.conf=src/main/packaging

Now you can configure clean and build tasks with Knot.x Distribution Plugin tasks (see their descriptions below):

tasks.named("build") { finalizedBy("assembleCustomDistribution") }
tasks.named("clean") { dependsOn("cleanDistribution") }

All your custom modules can be easily configured with the dist configuration, e.g:

dependencies {
    subprojects.forEach { "dist"(project(":${it.name}")) }
}

Available tasks

  • overwriteCustomFiles - copies/replaces files from the directory specified in the knotx.conf property to build/out/knotx. In addition, all dependencies form dist are copied to build/out/lib.
  • downloadBaseDistribution - downloads the Knot.x Stack and extracts it into the build/out directory
  • assembleCustomDistribution - combines the two above tasks and creates a full Knot.x distribution with all your custom dependencies. Distribution available in the build/distribution directory

Examples

ZIPed distribution

Check the Getting Started with Knot.x Stack example project as a reference.

Docker distribution

Check Knot.x Starter Kit as a reference.

Local development and testing

In order to properly develop and test new version of this plugin, you will need a working project on which tests will be carried out.

When you have it prepared, add the following snippet at the beginning of the target project's settings.gradle.kts file:

pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
    }
}

After that, you can push the new version of knotx-gradle-plugins to your local Maven repository (via Gradle's publishToMavenLocal task), and verify that the added functionality works as expected.

You can’t perform that action at this time.