Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes precommit task configuration failures due to newly added missin… #707

Merged
merged 2 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface NodeSelector {
* <p>
* Implementers should not rely on the ordering of the nodes.
*
* @param nodes the {@Node}s targeted for the sending requests
* @param nodes the {@link Node}s targeted for the sending requests
*/
void select(Iterable<Node> nodes);
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public RestClientBuilder setPathPrefix(String pathPrefix) {
* @param pathPrefix the path prefix to be cleaned up.
* @return the cleaned up path prefix.
* @throws NullPointerException if {@code pathPrefix} is {@code null}.
* @throws IllegalArgumentException if {@pathPrefix} is empty, or ends with more than one '/'.
* @throws IllegalArgumentException if {@code pathPrefix} is empty, or ends with more than one '/'.
*/
public static String cleanPathPrefix(String pathPrefix) {
Objects.requireNonNull(pathPrefix, "pathPrefix must not be null");
Expand Down
32 changes: 12 additions & 20 deletions gradle/missing-javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@ allprojects {
docroot = file("${buildDir}/site")
}

// TODO: Enable missingJavadoc task
// TODO: Add missingJavadoc checks to precommit plugin
// See https://github.com/opendistro-for-elasticsearch/search/issues/221
// Once we get the javadocs ready for the code base
// we will disable the default javadoc task and use our own
// missingJavadoc task below. The default javadoc task
// will just invoke 'missingJavadoc' (to allow people to call
// conventional task name).
tasks.matching { it.name == "javadoc" }.all {
// Currently the missingJavadoc task fails due to missing documentation
// across multiple modules. Once javadocs are added, we can
// add this task to precommit plugin.
tasks.withType(MissingJavadocTask).configureEach {
enabled = true
// enabled = false
// dependsOn "missingJavadoc"
title = "${project.rootProject.name} ${project.name} API"

// Set up custom doclet.
dependsOn configurations.missingdoclet
docletpath = configurations.missingdoclet
}

task missingJavadoc(type: MissingJavadocTask) {

tasks.register('missingJavadoc', MissingJavadocTask) {
description "This task validates and generates Javadoc API documentation for the main source code."
group "documentation"

Expand All @@ -79,16 +81,6 @@ allprojects {
}
}

allprojects {
project.tasks.withType(MissingJavadocTask) {
title = "${project.rootProject.name} ${project.name} API"

// Set up custom doclet.
dependsOn configurations.missingdoclet
docletpath = configurations.missingdoclet
}
}

class MissingJavadocTask extends DefaultTask {
@InputFiles
@SkipWhenEmpty
Expand Down