Skip to content

Apache Lucene open-source search software

Use a dumber offlineLinks map but expose more structured information to gradle.

Dawid Weissd14ee2d01eb6
diff --git a/gradle/documentation/render-javadoc.gradle b/gradle/documentation/render-javadoc.gradle
index 411d83a5643..d579840ef46 100644
--- a/gradle/documentation/render-javadoc.gradle
+++ b/gradle/documentation/render-javadoc.gradle
@@ -1,7 +1,5 @@
import org.gradle.internal.jvm.Jvm
-import javax.annotation.Nullable
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -261,8 +259,26 @@ configure(project(':lucene:luke')) {
project.tasks.matching { it.name == 'renderSiteJavadoc' }.configureEach { it.enabled = false }
}
+class OfflineLink implements Serializable {
+ @Input
+ String url
+
+ @InputDirectory
+ @PathSensitive(PathSensitivity.RELATIVE)
+ @IgnoreEmptyDirectories
+ File location
+
+ OfflineLink(String url, File location) {
+ this.url = url
+ this.location = location
+ }
+}
+
+@CacheableTask
class RenderJavadocTask extends DefaultTask {
@InputFiles
+ @PathSensitive(PathSensitivity.RELATIVE)
+ @IgnoreEmptyDirectories
@SkipWhenEmpty
SourceDirectorySet srcDirSet;
@@ -284,8 +300,14 @@ class RenderJavadocTask extends DefaultTask {
@Input
boolean relativeProjectLinks = false
- @Input
- def offlineLinks = [:]
+ @Internal
+ Map<String, File> offlineLinks = [:]
+
+ // Computes cacheable inputs from the map in offlineLinks.
+ @Nested
+ List<OfflineLink> getCacheableOfflineLinks() {
+ return offlineLinks.collect { url, location -> new OfflineLink(url, location) }
+ }
@Input
@Optional
@@ -312,8 +334,10 @@ class RenderJavadocTask extends DefaultTask {
final Property<String> executable = project.objects.property(String).convention(
project.provider { Jvm.current().javadocExecutable.toString() })
- @Input
- def taskResources
+ @InputDirectory
+ @PathSensitive(PathSensitivity.RELATIVE)
+ @IgnoreEmptyDirectories
+ File taskResources
/** Utility method to recursively collect all tasks with same name like this one that we depend on */
private Set findRenderTasksInDependencies() {