KotlinScriptCustomBuildStep
A build step running a Kotlin script with the specified content
Example. Adds a Kotlin script build step with default Kotlin compiler and default JVM.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
kotlinScript {
name = "My Kotlin Script step"
content = """
// Koltin script content
println("Hello, World")
""".trimIndent()
}
Content copied to clipboard }
}
Example. Adds a Kotlin script build step with bundled Kotlin compiler and custom JDK is set to the environment variable value with additional parameter. Additional agruments are passed to the Kotlin script with a reference to the configuration parameter value. Custom working directory is provided.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
kotlinScript {
name = "My Kotlin Script step"
workingDir = "data/"
content = """
// Koltin script content
println("Hello, World")
""".trimIndent()
compiler = "%teamcity.tool.kotlin.compiler.bundled%"
arguments = "%myscript.params%"
jdkHome = "%env.JDK_15_0%"
jvmArgs = "-Xmx2048m"
}
Content copied to clipboard }
}
Example. Adds a Kotlin script build step with custom Kotlin compiler and custom JDK with additional parameter. Custom working directory is provided.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
kotlinScript {
name = "My Kotlin Script step"
workingDir = "data/"
content = """
// Koltin script content
println("Hello, World")
""".trimIndent()
compiler = "path/to/kotlin/compiler"
jdkHome = "path/to/jdk"
jvmArgs = "-Xmx2048m"
}
Content copied to clipboard }
}
See also
Constructors
Functions
Deletes all configured build step conditions
Configures build step conditions
Copies parameters of this object to the specified target
Creates an instance of this build step via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.
Validates this object and reports found errors to the provided consumer
Properties
Build working directory for the script, specify it if it is different from the checkout directory.