Add default implementation to the provider.
This commit is contained in:
parent
34110f6be1
commit
b5b0a6898e
@ -30,8 +30,6 @@ abstract class AbstractPlugin(override val meta: Meta = Meta.EMPTY) : Plugin {
|
||||
dependencies.add(factory)
|
||||
return PluginDependencyDelegate(factory.type)
|
||||
}
|
||||
|
||||
override fun provideTop(target: String): Map<Name, Any> = emptyMap()
|
||||
}
|
||||
|
||||
fun <T : Named> Collection<T>.toMap(): Map<Name, T> = associate { it.name to it }
|
||||
|
@ -39,12 +39,10 @@ interface Provider {
|
||||
*/
|
||||
val defaultChainTarget: String get() = ""
|
||||
|
||||
|
||||
/**
|
||||
* A map of direct children for specific target
|
||||
*/
|
||||
fun provideTop(target: String): Map<Name, Any> =
|
||||
throw IllegalArgumentException("Target $target is not supported for $this")
|
||||
fun provideTop(target: String): Map<Name, Any> = emptyMap()
|
||||
}
|
||||
|
||||
fun Provider.provide(path: Path, targetOverride: String? = null): Any? {
|
||||
|
Loading…
Reference in New Issue
Block a user