.bamboo.specs.extension.bamboo-specs-extension.1.3.18.source-code.TriggersExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bamboo-specs-extension Show documentation
Show all versions of bamboo-specs-extension Show documentation
A Kotlin DSL for Bamboo Specs
The newest version!
package com.atlassian.bamboo.specs.extension
import com.atlassian.bamboo.specs.api.builders.AtlassianModule
import com.atlassian.bamboo.specs.api.builders.trigger.AnyTrigger
import com.atlassian.bamboo.specs.api.builders.trigger.Trigger
internal fun > triggerInitialisation(triggerConstructor: () -> T, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}): T {
val trigger = triggerConstructor()
if (description != null) {
trigger.description(description)
}
if (enabled != null) {
trigger.enabled(enabled)
}
trigger.init()
return trigger
}
internal fun triggerInitialisation(triggerType: String, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}): AnyTrigger =
triggerInitialisation({ AnyTrigger(AtlassianModule(triggerType)) }, description, enabled, init)