Skip to content

Commit

Permalink
Mark outputDirectory lazy (#2748)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev authored Nov 26, 2022
1 parent 9ed17b6 commit f7691fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class AbstractDokkaTask : DefaultTask() {

@OutputDirectory
val outputDirectory: Property<File> = project.objects.safeProperty<File>()
.safeConvention(defaultDokkaOutputDirectory())
.safeConvention(project.provider { defaultDokkaOutputDirectory() })

@Optional
@InputDirectory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ internal inline fun <reified T : Any> Property<T?>.safeConvention(value: T): Pro
return this.convention(value).cast()
}

internal inline fun <reified T : Any> Property<T?>.safeConvention(provider: Provider<T?>): Property<T> {
return this.convention(provider).cast()
}

@OptIn(ExperimentalStdlibApi::class)
internal inline fun <reified T> Provider<T>.getSafe(): T =
if (typeOf<T>().isMarkedNullable) orNull as T
Expand Down

0 comments on commit f7691fe

Please sign in to comment.