diff --git a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FiresiteTransformTask.kt b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FiresiteTransformTask.kt index b889a140798..e648f6cfa1a 100644 --- a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FiresiteTransformTask.kt +++ b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FiresiteTransformTask.kt @@ -21,6 +21,7 @@ import org.gradle.api.tasks.TaskAction * - Deletes unnecessary files * - Removes Class and Index headers from _toc.yaml files * - Changes links to be appropriate for Firesite versus normal Devsite behavior + * - Fixes broken hyperlinks in `@see` blocks * - Removes the prefix path from book_path * - Removes the google groupId for Javadocs * - Changes the path for _reference-head-tags at the top of html files @@ -73,7 +74,7 @@ abstract class FiresiteTransformTask : DefaultTask() { } private fun File.fixHTMLFile() { - val fixedContent = readText().fixBookPath().fixReferenceHeadTagsPath().fixLinks() + val fixedContent = readText().fixBookPath().fixReferenceHeadTagsPath().fixLinks().fixHyperlinksInSeeBlocks() writeText(fixedContent) } @@ -92,16 +93,48 @@ abstract class FiresiteTransformTask : DefaultTask() { * groupId. This makes the output look weird, as not all SDKs line up. So this method exists * to correct Javadoc nav files, so that they align with internally generated docs. * + * Example input: + * ``` + * "com.google.firebase.appcheck" + * ``` * Example output: * ``` - * removeGoogleGroupId("com.google.firebase.appcheck") - * --> "firebase.appcheck" + * "firebase.appcheck" * ``` */ // TODO(b/257293594): Remove when dackka exposes configuration for this private fun String.removeGoogleGroupId() = remove(Regex("(?<=\")com.google.(?=firebase.)")) + /** + * Fixes broken hyperlinks in the rendered HTML + * + * Links in Dockka are currently broken in `@see` tags. This transform destructures those + * broken links and reconstructs them as they're expected to be. + * + * Example input: + * ``` + * // Generated from @see TimestampThe ref timestamp definition + * <a href="git.page.link/timestamp-proto">Timestamp</a>The ref timestamp definition + * + * ``` + * Example output: + * ``` + * Timestamp + * The ref timestamp definition + * ``` + */ + // TODO(go/dokka-upstream-bug/2665): Remove when Dockka fixes this issue + private fun String.fixHyperlinksInSeeBlocks() = + replace(Regex("<a href="(?.*)">(?.*)</a>(?.*)\\s*")) { + val (href, link, text) = it.destructured + + """ + $link + $text + """.trimIndent() + } + // Our documentation does not live under the standard path expected by Dackka, especially // between Kotlin + Javadocs // TODO(b/243674305): Remove when dackka exposes configuration for this diff --git a/firebase-firestore/src/main/java/com/google/firebase/Timestamp.java b/firebase-firestore/src/main/java/com/google/firebase/Timestamp.java index f0b16987125..bd045ae5ad4 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/Timestamp.java +++ b/firebase-firestore/src/main/java/com/google/firebase/Timestamp.java @@ -30,9 +30,7 @@ * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to * and from RFC 3339 date strings. * - * @see The - * reference timestamp definition + * @see TimestampThe ref timestamp definition */ public final class Timestamp implements Comparable, Parcelable { diff --git a/firebase-perf/src/main/java/com/google/firebase/perf/metrics/Trace.java b/firebase-perf/src/main/java/com/google/firebase/perf/metrics/Trace.java index 50f35f3ae4a..2bde865a0c8 100644 --- a/firebase-perf/src/main/java/com/google/firebase/perf/metrics/Trace.java +++ b/firebase-perf/src/main/java/com/google/firebase/perf/metrics/Trace.java @@ -689,8 +689,7 @@ public Map getAttributes() { * Describes the kinds of special objects contained in this Parcelable's marshalled * representation. * - * @see - * https://developer.android.com/reference/android/os/Parcelable.html + * @see Parcelable * @return always returns 0. */ @Keep