Slack chat
Dokka docs
Version gradle-plugin-portal
Version maven-central

DEKORATOR [WIP]

Decorator support for Kotlin! Built with ❤, powered by Kotlin compiler plugin.

Support

The plugin only works on targets using new IR kotlin compiler (which is pretty much all of them since kotlin 1.5 except
JS that still defaults to legacy compiler).

Versions

The current version was built using the following tooling versions and is guaranteed to work with this setup. Given the
experimental nature of kotlin compiler plugin API, the plugin powering this library is likely to stop working on
projects using newer/older kotlin versions.

  • Kotlin: 1.5.31
  • Gradle: 7.2.0
  • JDK: 11

Targets

Bellow is a list of currently supported targets and planned targets:

  • android
  • js
  • jvm
  • linuxX64
  • mingwX64
  • macosX64
  • macosArm64
  • iosArm32
  • iosArm64
  • iosSimulatorArm64
  • iosX64
  • watchosX86
  • watchosX64
  • watchosArm64
  • watchosSimulatorArm64
  • watchosArm32
  • tvosArm64
  • tvosSimulatorArm64
  • tvosX64
  • androidNativeArm32
  • androidNativeArm64
  • linuxArm32Hfp
  • linuxMips32
  • linuxMipsel32
  • linuxArm64
  • mingwX86

Usage

  1. Apply the plugin and add a runtime dependency.

plugins {
  kotlin("multiplatform")
  id("dev.petuska.dekorator") version "_"

  kotlin {
    sourceSets {
      commonTest {
        dependencies {
          implementation("dev.petuska:dekorator:_")
        }
      }
    }
  }
}
  1. (Optional) Configure the plugin extension (shown with default values). For property descriptions.
    see Gradle Properties

dekorator {
  enabled = true // Turns the compiler plugin on/off
}

Gradle Properties

Most of the DSL configuration options can also be set/overridden via gradle properties
./gradlew <some-task> -Pprop.name=propValue, gradle.properties or ~/.gradle/gradle.properties. Environment
variables are also supported, however gradle properties take precedence over them. Bellow is the full list of supported
properties:

  • dekorator.enabled (DEKORATOR_ENABLED) – toggles the compiler processing on/off.

Modules

  • :library:dekorator-core – main runtime library
  • :plugin:dekorator-gradle-plugin – gradle plugin to manage kotlin compiler plugins
  • :plugin:dekorator-kotlin-plugin – kotlin compiler plugin for jvm & js that does the actual work
  • :plugin:dekorator-kotlin-plugin:dekorator-kotlin-plugin-native – kotlin compiler plugin for native that does the
    actual work
  • sandbox – a playground to test local changes from consumer end

GitHub

View Github