IntelliJ Platform Plugin SDK
 
IntelliJ Platform Explorer

Task Awares

Edit pageLast modified: 03 January 2025

The Task Awares is a set of interfaces that can be applied to custom Gradle tasks and, when registered using the dedicated register method, inject new features or properties with predefined values.

IntelliJ Platform Gradle Plugin supports creating custom tasks which can use *Aware interfaces. Example:

import org.jetbrains.intellij.platform.gradle.tasks.aware.PluginAware

abstract class RetrievePluginNameTask : DefaultTask(), PluginAware

val retrievePluginName by tasks.registering(RetrievePluginNameTask::class) {
    val outputFile = layout.buildDirectory.file("pluginName.txt")

    doLast {
        outputFile.get().asFile.writeText(pluginXml.parse { name }.get())
    }
}