|
1 | 1 | // remove the excessive whitespaces between method arguments in the javadocs
|
2 | 2 | task javadocCleanup(dependsOn: "javadoc") doLast {
|
3 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Flowable.html')); |
4 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Observable.html')); |
5 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Single.html')); |
6 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Maybe.html')); |
7 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Completable.html')); |
| 3 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Flowable.html')) |
| 4 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Observable.html')) |
| 5 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Single.html')) |
| 6 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Maybe.html')) |
| 7 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/core/Completable.html')) |
8 | 8 |
|
9 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/flowables/ConnectableFlowable.html')); |
10 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/observables/ConnectableObservable.html')); |
| 9 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/flowables/ConnectableFlowable.html')) |
| 10 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/observables/ConnectableObservable.html')) |
11 | 11 |
|
12 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/ReplaySubject.html')); |
13 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/ReplayProcessor.html')); |
14 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/plugins/RxJavaPlugins.html')); |
| 12 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/subjects/ReplaySubject.html')) |
| 13 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/processors/ReplayProcessor.html')) |
| 14 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/plugins/RxJavaPlugins.html')) |
15 | 15 |
|
16 |
| - fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/parallel/ParallelFlowable.html')); |
| 16 | + fixJavadocFile(rootProject.file('build/docs/javadoc/io/reactivex/rxjava3/parallel/ParallelFlowable.html')) |
17 | 17 | }
|
18 | 18 |
|
19 | 19 | def fixJavadocFile(file) {
|
20 |
| - println("Cleaning up: " + file); |
| 20 | + logger.lifecycle("Cleaning up: " + file) |
21 | 21 | String fileContents = file.getText('UTF-8')
|
22 | 22 |
|
23 | 23 | // lots of spaces after the previous method argument
|
24 |
| - fileContents = fileContents.replaceAll(",\\s{4,}", ",\n "); |
| 24 | + fileContents = fileContents.replaceAll(",\\s{4,}", ",\n ") |
25 | 25 |
|
26 | 26 | // lots of spaces after the @NonNull annotations
|
27 |
| - fileContents = fileContents.replaceAll("@NonNull</a>\\s{4,}", "@NonNull</a> "); |
| 27 | + fileContents = fileContents.replaceAll("@NonNull</a>\\s{4,}", "@NonNull</a> ") |
28 | 28 |
|
29 | 29 | // lots of spaces after the @Nullable annotations
|
30 |
| - fileContents = fileContents.replaceAll("@Nullable</a>\\s{4,}", "@Nullable</a> "); |
| 30 | + fileContents = fileContents.replaceAll("@Nullable</a>\\s{4,}", "@Nullable</a> ") |
31 | 31 |
|
32 | 32 | // javadoc bug: duplicates the link to @NonNull for some reason
|
33 |
| - def nonNullText1 = "<a href=\"../annotations/NonNull.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@NonNull</a>"; |
34 |
| - |
35 |
| - fileContents = fileContents.replace(nonNullText1 + " " + nonNullText1, nonNullText1); |
36 |
| - fileContents = fileContents.replace(nonNullText1 + "\n " + nonNullText1, nonNullText1); |
37 |
| - fileContents = fileContents.replace(nonNullText1 + "\r\n " + nonNullText1, nonNullText1); |
| 33 | + def nonNullText1 = "<a href=\"../annotations/NonNull.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@NonNull</a>" |
38 | 34 |
|
39 |
| - def nonNullText2 = "<a href=\"../../../../io/reactivex/rxjava3/annotations/NonNull.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@NonNull</a>"; |
40 |
| - fileContents = fileContents.replace(nonNullText2 + " " + nonNullText2, nonNullText2); |
41 |
| - fileContents = fileContents.replace(nonNullText2 + "\n " + nonNullText2, nonNullText2); |
42 |
| - fileContents = fileContents.replace(nonNullText2 + "\r\n " + nonNullText2, nonNullText2); |
| 35 | + fileContents = fileContents.replace(nonNullText1 + " " + nonNullText1, nonNullText1) |
| 36 | + fileContents = fileContents.replace(nonNullText1 + "\n " + nonNullText1, nonNullText1) |
| 37 | + fileContents = fileContents.replace(nonNullText1 + "\r\n " + nonNullText1, nonNullText1) |
| 38 | + |
| 39 | + def nonNullText2 = "<a href=\"../../../../io/reactivex/rxjava3/annotations/NonNull.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@NonNull</a>" |
| 40 | + fileContents = fileContents.replace(nonNullText2 + " " + nonNullText2, nonNullText2) |
| 41 | + fileContents = fileContents.replace(nonNullText2 + "\n " + nonNullText2, nonNullText2) |
| 42 | + fileContents = fileContents.replace(nonNullText2 + "\r\n " + nonNullText2, nonNullText2) |
43 | 43 |
|
44 | 44 | // javadoc bug: duplicates the link to @Nullable for some reason
|
45 |
| - def nullableText1 = "<a href=\"../annotations/Nullable.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@Nullable</a>"; |
46 |
| - |
47 |
| - fileContents = fileContents.replace(nullableText1 + " " + nullableText1, nullableText1); |
48 |
| - fileContents = fileContents.replace(nullableText1 + "\n " + nullableText1, nullableText1); |
49 |
| - fileContents = fileContents.replace(nullableText1 + "\r\n " + nullableText1, nullableText1); |
50 |
| - |
51 |
| - def nullableText2 = "<a href=\"../../../../io/reactivex/rxjava3/annotations/Nullable.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@Nullable</a>"; |
52 |
| - |
53 |
| - fileContents = fileContents.replace(nullableText2 + " " + nullableText2, nullableText2); |
54 |
| - fileContents = fileContents.replace(nullableText2 + "\n " + nullableText2, nullableText2); |
55 |
| - fileContents = fileContents.replace(nullableText2 + "\r\n " + nullableText2, nullableText2); |
56 |
| - |
57 |
| - file.setText(fileContents, 'UTF-8'); |
58 |
| -} |
| 45 | + def nullableText1 = "<a href=\"../annotations/Nullable.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@Nullable</a>" |
| 46 | + |
| 47 | + fileContents = fileContents.replace(nullableText1 + " " + nullableText1, nullableText1) |
| 48 | + fileContents = fileContents.replace(nullableText1 + "\n " + nullableText1, nullableText1) |
| 49 | + fileContents = fileContents.replace(nullableText1 + "\r\n " + nullableText1, nullableText1) |
59 | 50 |
|
| 51 | + def nullableText2 = "<a href=\"../../../../io/reactivex/rxjava3/annotations/Nullable.html\" title=\"annotation in io.reactivex.rxjava3.annotations\">@Nullable</a>" |
| 52 | + |
| 53 | + fileContents = fileContents.replace(nullableText2 + " " + nullableText2, nullableText2) |
| 54 | + fileContents = fileContents.replace(nullableText2 + "\n " + nullableText2, nullableText2) |
| 55 | + fileContents = fileContents.replace(nullableText2 + "\r\n " + nullableText2, nullableText2) |
| 56 | + |
| 57 | + file.setText(fileContents, 'UTF-8') |
| 58 | +} |
0 commit comments