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)
|
dependencies.add(factory)
|
||||||
return PluginDependencyDelegate(factory.type)
|
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 }
|
fun <T : Named> Collection<T>.toMap(): Map<Name, T> = associate { it.name to it }
|
||||||
|
@ -39,12 +39,10 @@ interface Provider {
|
|||||||
*/
|
*/
|
||||||
val defaultChainTarget: String get() = ""
|
val defaultChainTarget: String get() = ""
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of direct children for specific target
|
* A map of direct children for specific target
|
||||||
*/
|
*/
|
||||||
fun provideTop(target: String): Map<Name, Any> =
|
fun provideTop(target: String): Map<Name, Any> = emptyMap()
|
||||||
throw IllegalArgumentException("Target $target is not supported for $this")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Provider.provide(path: Path, targetOverride: String? = null): Any? {
|
fun Provider.provide(path: Path, targetOverride: String? = null): Any? {
|
||||||
|
Loading…
Reference in New Issue
Block a user