buildSimbotApplication
suspend fun <Config : ApplicationConfiguration, Builder : ApplicationBuilder<A>, A : Application> buildSimbotApplication(factory: ApplicationFactory<Config, Builder, A>, block: ApplicationDslBuilder<Config, Builder, A>.() -> Unit = {}): A(source)
通过 ApplicationDslBuilder 来使用DSL风格或链式调用风格构建目标 Application.
此api与 createSimbotApplication 的区别在于 buildSimbotApplication 将 config
和 builder
函数进行了简单的拆分, 使得 buildSimbotApplication 相对于 createSimbotApplication 来讲更适合在 config
和 builder
中都存在大量需要配置的内容的情况。
e.g.
val application = buildSimbotApplication(Foo) {
config { /* ... */}
build { /* ... */}
}
// ...
Content copied to clipboard