1+ // remove the excessive whitespaces between method arguments in the javadocs
2+ task javadocCleanup (dependsOn : " javadoc" ) doLast {
3+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/Flowable.html' ));
4+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/Observable.html' ));
5+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/Single.html' ));
6+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/Maybe.html' ));
7+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/Completable.html' ));
8+
9+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/flowables/ConnectableFlowable.html' ));
10+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/observables/ConnectableObservable.html' ));
11+
12+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/subjects/ReplaySubject.html' ));
13+ fixJavadocFile(rootProject. file(' build/docs/javadoc/io/reactivex/processors/ReplayProcessor.html' ));
14+ }
15+
16+ def fixJavadocFile (file ) {
17+ println (" Cleaning up: " + file);
18+ String fileContents = file. getText(' UTF-8' )
19+
20+ // lots of spaces after the previous method argument
21+ fileContents = fileContents. replaceAll(" ,\\ s{4,}" , " ,\n " );
22+
23+ // lots of spaces after the @NonNull annotations
24+ fileContents = fileContents. replaceAll(" @NonNull</a>\\ s{4,}" , " @NonNull</a> " );
25+
26+ // lots of spaces after the @Nullable annotations
27+ fileContents = fileContents. replaceAll(" @Nullable</a>\\ s{4,}" , " @Nullable</a> " );
28+
29+ file. setText(fileContents, ' UTF-8' );
30+ }
31+
32+ javadocJar. dependsOn javadocCleanup
33+ build. dependsOn javadocCleanup
0 commit comments