Skip to content

Commit

Permalink
tmpl providers holder fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Morfly committed May 31, 2021
1 parent 6548110 commit f04c82f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ class GradleTemplateProvidersHolder(
*
*/
fun providePerModule(target: Project, relativePath: String): List<StarlarkFile> =
providers[GradlePerModuleTemplateProvider]!!
.firstOrNull { it.canProvide(target) }
providers[GradlePerModuleTemplateProvider]
?.firstOrNull { it.canProvide(target) }
?.provide(target, relativePath)
?: emptyList()

/**
*
*/
fun provideStandalone(root: Project): List<StarlarkFile> =
providers[GradleStandaloneTemplateProvider]!!
.filter { it.canProvide(root) }
.flatMap { it.provide(root, relativePath = "") }
providers[GradleStandaloneTemplateProvider]
?.filter { it.canProvide(root) }
?.flatMap { it.provide(root, relativePath = "") }
?: emptyList()

/**
*
Expand Down

0 comments on commit f04c82f

Please sign in to comment.