com.autonomousapps.kit.gradle.Repositories.kt Maven / Gradle / Ivy
package com.autonomousapps.kit.gradle
import com.autonomousapps.kit.render.Element
import com.autonomousapps.kit.render.Scribe
public class Repositories @JvmOverloads constructor(
private val repositories: MutableList = mutableListOf(),
) : Element.Block {
public constructor(vararg repositories: Repository) : this(repositories.toMutableList())
public val isEmpty: Boolean = repositories.isEmpty()
override val name: String = "repositories"
override fun render(scribe: Scribe): String = scribe.block(this) { s ->
repositories.forEach { it.render(s) }
}
public operator fun plus(other: Repositories): Repositories {
return Repositories((repositories + other.repositories).distinct().toMutableList())
}
public operator fun plus(other: Iterable): Repositories {
return Repositories((repositories + other).distinct().toMutableList())
}
public companion object {
@JvmField
public val EMPTY: Repositories = Repositories(mutableListOf())
@JvmField
public val DEFAULT_DEPENDENCIES: Repositories = Repositories(Repository.DEFAULT.toMutableList())
@JvmField
public val DEFAULT_PLUGINS: Repositories = Repositories(Repository.DEFAULT_PLUGINS.toMutableList())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy