fun isDependencyNew()

in configs-dsl-kotlin-pipelines/src/main/java/jetbrains/buildServer/configs/kotlin/v2019_2/StageFactory.kt [15:33]


    fun isDependencyNew(dependant: Single, dependency: Single, options: SnapshotDependencyOptions): Boolean {
        val dependencyToCompare = SnapshotDependency()
        dependencyToCompare.apply(options)
        var isNew = true
        singleStages[dependant.buildType]?.apply {
            forEach {
                val that = it
                val dep = that.buildType.dependencies.items.firstOrNull {
                    it.snapshot != null && it.buildTypeId == dependency.buildType
                }
                if (it != dependant && (dep == null || !isEqual(dep.snapshot!!, dependencyToCompare))) {
                    throw IllegalStateException("Multiple use of a build configuration '${dependant.buildType.name}' in a build chain DSL causes conflicting snapshot dependencies")
                }
                if (dep != null)
                    isNew = false
            }
        }
        return isNew
    }