From 9fb7cb9daf1afe3815d4faa3362a5ccfbdb0db0a Mon Sep 17 00:00:00 2001 From: JFronny Date: Sat, 9 Mar 2024 12:16:37 +0100 Subject: [PATCH] fix: support project dsl for Javadoc.linksOffline --- .../main/kotlin/io/gitlab/jfronny/scripts/JavadocExt.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/convention/src/main/kotlin/io/gitlab/jfronny/scripts/JavadocExt.kt b/convention/src/main/kotlin/io/gitlab/jfronny/scripts/JavadocExt.kt index 8428b15..cb0ee15 100644 --- a/convention/src/main/kotlin/io/gitlab/jfronny/scripts/JavadocExt.kt +++ b/convention/src/main/kotlin/io/gitlab/jfronny/scripts/JavadocExt.kt @@ -1,6 +1,7 @@ package io.gitlab.jfronny.scripts import org.gradle.api.Project +import org.gradle.api.internal.catalog.DelegatingProjectDependency import org.gradle.api.tasks.javadoc.Javadoc import org.gradle.external.javadoc.StandardJavadocDocletOptions import org.gradle.kotlin.dsl.named @@ -13,4 +14,10 @@ fun Javadoc.linksOffline(url: String, project: Project) { val task = project.tasks.named("javadoc").get() opts.linksOffline(url, task.destinationDir.toString()) dependsOn(task) +} + +fun Javadoc.linksOffline(url: String, project: DelegatingProjectDependency) { + val task = project.dependencyProject.tasks.named("javadoc").get() + opts.linksOffline(url, task.destinationDir.toString()) + dependsOn(task) } \ No newline at end of file