Make javadoc links point to Android docs for java.* classes

Before:
https://docs.oracle.com/javase/7/docs/api/index.html?java/lang/String.html

After:
https://developer.android.com/reference/java/lang/String.html
PiperOrigin-RevId: 304137011
This commit is contained in:
ibaker 2020-04-01 09:31:17 +01:00 committed by Oliver Woodman
parent 45186ac377
commit cd5ecd5c90
3 changed files with 2 additions and 12 deletions

View File

@ -29,8 +29,7 @@ class CombinedJavadocPlugin implements Plugin<Project> {
classpath = project.files([])
destinationDir = project.file("$project.buildDir/docs/javadoc")
options {
links "https://docs.oracle.com/javase/7/docs/api/",
"https://developer.android.com/reference"
links "https://developer.android.com/reference"
encoding = "UTF-8"
}
exclude "**/BuildConfig.java"

View File

@ -26,9 +26,7 @@ android.libraryVariants.all { variant ->
title = "ExoPlayer ${javadocTitle}"
source = allSourceDirs
options {
links "http://docs.oracle.com/javase/7/docs/api/"
linksOffline "https://developer.android.com/reference",
"${android.sdkDirectory}/docs/reference"
links "https://developer.android.com/reference"
encoding = "UTF-8"
}
exclude "**/BuildConfig.java"

View File

@ -20,13 +20,6 @@ ext.fixJavadoc = {
ant.replaceregexp(match:androidLink, replace:androidFixed, flags:'g') {
fileset(dir: "${javadocPath}", includes: "**/*.html")
}
// Fix external Oracle links to use frames and target the top frame.
def oracleRoot = "https://docs.oracle.com/javase/7/docs/api/"
def oracleLink = "<a href=\"(${oracleRoot})(.*?)\\?is-external=true\""
def oracleFixed = "<a href=\"\\1index.html\\?\\2\" target=\"_top\""
ant.replaceregexp(match:oracleLink, replace:oracleFixed, flags:'g') {
fileset(dir: "${javadocPath}", includes: "**/*.html")
}
// Add favicon to each page
def headTag = "<head>"
def headTagWithFavicon = "<head>" +