Remove exoplayer2-only javadoc machinery from media3

This introduces whitespace-only changes in exoplayer2 due to the way
copybara stripping works.

PiperOrigin-RevId: 537296933
This commit is contained in:
ibaker 2023-06-02 13:42:10 +00:00 committed by Tofunmi Adigun-Hameed
parent 04d8edf19e
commit 7e6dae7b31
34 changed files with 0 additions and 345 deletions

View File

@ -41,5 +41,3 @@ allprojects {
}
group = 'androidx.media3'
}
apply from: 'javadoc_combined.gradle'

View File

@ -1,94 +0,0 @@
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
apply from: "${buildscript.sourceFile.parentFile}/constants.gradle"
apply from: "${buildscript.sourceFile.parentFile}/javadoc_util.gradle"
class CombinedJavadocPlugin implements Plugin<Project> {
static final String JAVADOC_TASK_NAME = "generateCombinedJavadoc"
@Override
void apply(Project project) {
project.gradle.projectsEvaluated {
Set<Project> libraryModules = getLibraryModules(project)
if (!libraryModules.isEmpty()) {
def guavaReferenceUrl = "https://guava.dev/releases/$project.ext.guavaVersion/api/docs"
project.task(JAVADOC_TASK_NAME, type: Javadoc) {
description = "Generates combined Javadoc."
title = "ExoPlayer library"
source = libraryModules.generateJavadoc.source
classpath = project.files([])
destinationDir = project.file("$project.buildDir/docs/javadoc")
options {
links "https://developer.android.com/reference", guavaReferenceUrl
encoding = "UTF-8"
}
exclude "**/BuildConfig.java"
exclude "**/R.java"
doFirst {
libraryModules.each { libraryModule ->
libraryModule.android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name == "release") {
// Works around b/234569640 that causes different versions of the androidx.media
// jar to be on the classpath.
def allJarFiles = []
allJarFiles.addAll(variant.javaCompileProvider.get().classpath.files)
def filteredJarFiles = allJarFiles.findAll { file ->
if (file ==~ /.*media-.\..\..-api.jar$/
&& !file.path.endsWith(
"media-" + project.ext.androidxMediaVersion + "-api.jar")) {
return false;
}
if (file ==~ /.*\/core-.\..\..-api.jar$/
&& !file.path.endsWith(
"core-" + project.ext.androidxCoreVersion + "-api.jar")) {
return false;
}
return true;
}
classpath +=
libraryModule.project.files(
filteredJarFiles,
libraryModule.project.android.getBootClasspath())
}
}
}
}
doLast {
libraryModules.each { libraryModule ->
project.copy {
from "${libraryModule.projectDir}/src/main/javadoc"
into "${project.buildDir}/docs/javadoc"
}
}
project.fixJavadoc()
}
}
}
}
}
// Returns Android library modules that declare a generateJavadoc task.
private static Set<Project> getLibraryModules(Project project) {
project.subprojects.findAll {
it.plugins.findPlugin("com.android.library") &&
it.tasks.findByName("generateJavadoc")
}
}
}
apply plugin: CombinedJavadocPlugin

View File

@ -1,50 +0,0 @@
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
apply from: "${buildscript.sourceFile.parentFile}/constants.gradle"
apply from: "${buildscript.sourceFile.parentFile}/javadoc_util.gradle"
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name != "release") {
return // Skip non-release builds.
}
def allSourceDirs = variant.sourceSets.inject ([]) {
acc, val -> acc << val.javaDirectories
}
task("generateJavadoc", type: Javadoc) {
description = "Generates Javadoc for the ${javadocTitle}."
title = "ExoPlayer ${javadocTitle}"
source = allSourceDirs + "${buildDir}/generated/aidl_source_output_dir/"
options {
links "https://developer.android.com/reference",
"https://guava.dev/releases/$project.ext.guavaVersion/api/docs"
encoding = "UTF-8"
}
exclude "**/BuildConfig.java"
exclude "**/R.java"
doFirst {
classpath =
files(
variant.javaCompileProvider.get().classpath.files,
project.android.getBootClasspath())
}
doLast {
copy {
from "src/main/javadoc"
into "$buildDir/docs/javadoc"
}
project.fixJavadoc()
}
}
}

View File

@ -1,49 +0,0 @@
// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
ext.fixJavadoc = {
def javadocPath = "${project.buildDir}/docs/javadoc"
// Fix external Android links to target the top frame.
def androidRoot = "https://developer.android.com/reference/"
def androidLink = "<a href=\"(${androidRoot}.*?)\\?is-external=true(.*)\""
def androidFixed = "<a href=\"\\1\\2\" target=\"_top\""
ant.replaceregexp(match:androidLink, replace:androidFixed, flags:'g') {
fileset(dir: "${javadocPath}", includes: "**/*.html")
}
// Add favicon to each page
def headTag = "<head>"
def headTagWithFavicon = "<head>" +
"<!-- start favicons snippet, use https://realfavicongenerator.net/ -->" +
"<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/assets/apple-touch-icon.png\">" +
"<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/assets/favicon-32x32.png\">" +
"<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/assets/favicon-16x16.png\">" +
"<link rel=\"manifest\" href=\"/assets/site.webmanifest\">" +
"<link rel=\"mask-icon\" href=\"/assets/safari-pinned-tab.svg\" color=\"#fc4d50\">" +
"<link rel=\"shortcut icon\" href=\"/assets/favicon.ico\">" +
"<meta name=\"msapplication-TileColor\" content=\"#ffc40d\">" +
"<meta name=\"msapplication-config\" content=\"/assets/browserconfig.xml\">" +
"<meta name=\"theme-color\" content=\"#ffffff\">" +
"<!-- end favicons snippet -->"
ant.replaceregexp(match:headTag, replace:headTagWithFavicon, flags:'g') {
fileset(dir: "${javadocPath}", includes: "**/*.html")
}
// Remove date metadata that changes every time Javadoc is generated.
def javadocGeneratedBy = "<!-- Generated by javadoc.*?-->\n"
ant.replaceregexp(match:javadocGeneratedBy, replace:"") {
fileset(dir: "${javadocPath}", includes: "**/*.html")
}
def dateMeta = "<meta name=\"date\".*?>\n"
ant.replaceregexp(match:dateMeta, replace:"") {
fileset(dir: "${javadocPath}", includes: "**/*.html")
}
}

View File

@ -34,11 +34,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'Cast extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-cast'
releaseName = 'Media3 Cast module'

View File

@ -86,11 +86,6 @@ dependencies {
testImplementation project(modulePrefix + 'test-utils')
}
ext {
javadocTitle = 'Common module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-common'
releaseName = 'Media3 common module'

View File

@ -41,10 +41,6 @@ android {
}
}
ext {
javadocTitle = 'Container module'
}
dependencies {
implementation project(modulePrefix + 'lib-common')
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
@ -53,7 +49,6 @@ dependencies {
testImplementation 'junit:junit:' + junitVersion
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-container'

View File

@ -40,11 +40,6 @@ dependencies {
testImplementation project(modulePrefix + 'test-utils')
}
ext {
javadocTitle = 'Database module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-database'
releaseName = 'Media3 database module'

View File

@ -60,11 +60,6 @@ dependencies {
testImplementation project(modulePrefix + 'test-utils')
}
ext {
javadocTitle = 'DataSource module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-datasource'
releaseName = 'Media3 DataSource module'

View File

@ -43,11 +43,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'Cronet extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-datasource-cronet'
releaseName = 'Media3 Cronet DataSource module'

View File

@ -38,11 +38,6 @@ dependencies {
api 'com.squareup.okhttp3:okhttp:' + okhttpVersion
}
ext {
javadocTitle = 'OkHttp extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-datasource-okhttp'
releaseName = 'Media3 OkHttp DataSource module'

View File

@ -35,11 +35,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'RTMP extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-datasource-rtmp'
releaseName = 'Media3 RTMP DataSource module'

View File

@ -39,11 +39,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'Decoder module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-decoder'
releaseName = 'Media3 decoder module'

View File

@ -52,8 +52,3 @@ dependencies {
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
}
ext {
javadocTitle = 'AV1 extension'
}
apply from: '../../javadoc_library.gradle'

View File

@ -33,8 +33,3 @@ dependencies {
testImplementation project(modulePrefix + 'test-utils')
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'FFmpeg extension'
}
apply from: '../../javadoc_library.gradle'

View File

@ -40,8 +40,3 @@ dependencies {
testImplementation project(modulePrefix + 'test-data')
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'FLAC extension'
}
apply from: '../../javadoc_library.gradle'

View File

@ -34,8 +34,3 @@ dependencies {
testImplementation project(modulePrefix + 'test-data')
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'MIDI extension'
}
apply from: '../../javadoc_library.gradle'

View File

@ -36,8 +36,3 @@ dependencies {
androidTestImplementation 'androidx.test:runner:' + androidxTestRunnerVersion
androidTestImplementation 'androidx.test.ext:junit:' + androidxTestJUnitVersion
}
ext {
javadocTitle = 'Opus extension'
}
apply from: '../../javadoc_library.gradle'

View File

@ -37,8 +37,3 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:' + androidxTestJUnitVersion
androidTestImplementation 'com.google.truth:truth:' + truthVersion
}
ext {
javadocTitle = 'VP9 extension'
}
apply from: '../../javadoc_library.gradle'

View File

@ -61,11 +61,6 @@ dependencies {
androidTestCompileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
}
ext {
javadocTitle = 'Effect module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-effect'
releaseName = 'Media3 Effect module'

View File

@ -70,11 +70,6 @@ dependencies {
testImplementation project(modulePrefix + 'test-utils-robolectric')
}
ext {
javadocTitle = 'Core module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer'
releaseName = 'Media3 ExoPlayer module'

View File

@ -43,11 +43,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'DASH module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer-dash'
releaseName = 'Media3 ExoPlayer DASH module'

View File

@ -45,11 +45,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'HLS module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer-hls'
releaseName = 'Media3 ExoPlayer HLS module'

View File

@ -42,11 +42,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'IMA extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer-ima'
releaseName = 'Media3 ExoPlayer IMA module'

View File

@ -46,11 +46,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'RTSP module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer-rtsp'
releaseName = 'Media3 ExoPlayer RTSP module'

View File

@ -43,11 +43,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'SmoothStreaming module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer-smoothstreaming'
releaseName = 'Media3 ExoPlayer SmoothStreaming module'

View File

@ -31,11 +31,6 @@ dependencies {
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
}
ext {
javadocTitle = 'WorkManager extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-exoplayer-workmanager'
releaseName = 'Media3 ExoPlayer WorkManager module'

View File

@ -47,11 +47,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'Extractor module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-extractor'
releaseName = 'Media3 Extractor module'

View File

@ -41,10 +41,6 @@ android {
}
}
ext {
javadocTitle = 'Muxer module'
}
dependencies {
implementation project(modulePrefix + 'lib-common')
implementation project(modulePrefix + 'lib-container')
@ -63,7 +59,6 @@ dependencies {
androidTestImplementation project(modulePrefix + 'test-utils')
androidTestImplementation project(modulePrefix + 'lib-extractor')
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-muxer'

View File

@ -40,11 +40,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'Test utils'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-test-utils'
releaseName = 'Media3 test utils module'

View File

@ -34,11 +34,6 @@ dependencies {
implementation project(modulePrefix + 'test-utils')
}
ext {
javadocTitle = 'Robolectric utils'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-test-utils-robolectric'
releaseName = 'Media3 robolectric test utils module'

View File

@ -65,11 +65,6 @@ dependencies {
androidTestCompileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
}
ext {
javadocTitle = 'Transformer module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-transformer'
releaseName = 'Media3 Transformer module'

View File

@ -40,11 +40,6 @@ dependencies {
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'UI module'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-ui'
releaseName = 'Media3 UI module'

View File

@ -32,11 +32,6 @@ dependencies {
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
}
ext {
javadocTitle = 'Leanback extension'
}
apply from: '../../javadoc_library.gradle'
ext {
releaseArtifactId = 'media3-ui-leanback'
releaseName = 'Media3 Leanback UI module'