KotlinTarget
Represents a target platform for which Kotlin code is built.
This abstraction allows for the configuration of tasks, dependencies, and other settings specific to the platform on which the code is intended to run.
By default, a Kotlin target contains two KotlinCompilations: one for production and one for test source code.
Examples of accessing the Kotlin target:
In Kotlin/JVM or Kotlin/Android projects:
kotlin {
target {
// Configure JVM or Android target specifics here
}
}
In Kotlin Multiplatform projects:
kotlin {
jvm { // Creates JVM target
// Configure JVM target specifics here
}
linuxX64 {
// Configure Kotlin native target for Linux X86_64 here
}
}
To learn more about the different targets in Kotlin, see Targets.
Inheritors
Properties
The name of the configuration that is used when compiling against the API of this Kotlin target.
The name of the task responsible for assembling the final artifact for this target.
A container for Kotlin compilations related to this target.
Represents a collection of Gradle software components associated with this Kotlin target.
Retrieves the disambiguation classifier for the Kotlin target.
Represents the type of Kotlin platform associated with the target.
Indicates whether the Kotlin target is publishable.
The name of the configuration containing elements that are strictly required at runtime by this Kotlin target.
The name of the configuration that represents the variant that carries the original source code in packaged form.
The name of the target in the Kotlin build configuration.
Functions
Configures the attributes associated with this target.
Configures the Maven publication for this Kotlin target.
Configures the publication of sources.