Skip to content

Commit

Permalink
Update Gradle version from 4.1 to 4.4
Browse files Browse the repository at this point in the history
In Gradle 4.4, it is a bug to resolve a configuration before the lint task is
created ([see [] Therefore, to upgrade
gradle version, we need to change the "generateJavadoc" task to remove using
files() call during initialization phase, but change move this to doFirst()
instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190634090
  • Loading branch information
botaydotcom authored and ojw28 committed Mar 28, 2018
1 parent 82b72c9 commit 13592df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### dev-v2 (not yet released) ###

* Gradle: Upgrade Gradle version from 4.1 to 4.4 so it can work with Android
Studio 3.1 ([#3708](https://github.com/google/ExoPlayer/issues/3708)).
* Optimize seeking in FMP4 by enabling seeking to the nearest sync sample within
a fragment. This benefits standalone FMP4 playbacks, DASH and SmoothStreaming.
* Optimize seeking in FMP4.
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
8 changes: 6 additions & 2 deletions javadoc_library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ android.libraryVariants.all { variant ->
description = "Generates Javadoc for the ${javadocTitle}."
title = "ExoPlayer ${javadocTitle}"
source = variant.javaCompile.source
classpath = files(variant.javaCompile.classpath.files,
project.android.getBootClasspath())
options {
links "http://docs.oracle.com/javase/7/docs/api/"
linksOffline "https://developer.android.com/reference",
Expand All @@ -30,6 +28,12 @@ android.libraryVariants.all { variant ->
}
exclude "**/BuildConfig.java"
exclude "**/R.java"
doFirst {
classpath =
files(
variant.javaCompile.classpath.files,
project.android.getBootClasspath())
}
doLast {
copy {
from "src/main/javadoc"
Expand Down

12 comments on commit 13592df

@jatinmishra
Copy link

@jatinmishra jatinmishra commented on 13592df Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried this, not solving the issue
do we have have to make any modifications to javadoc_combined.gradle file also?

following is my javadoc_library.gradle

android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (!name.equals("release")) {
return; // Skip non-release builds.
}
task("generateJavadoc", type: Javadoc) {
description = "Generates Javadoc for the ${javadocTitle}."
title = "ExoPlayer ${javadocTitle}"
source = variant.javaCompile.source

options {
  links "http://docs.oracle.com/javase/7/docs/api/"
  linksOffline "https://developer.android.com/reference",
          "${android.sdkDirectory}/docs/reference"
  encoding = "UTF-8"
}
exclude "**/BuildConfig.java"
exclude "**/R.java"
doFirst {
    classpath =
            files(
                    variant.javaCompile.classpath.files,
                    project.android.getBootClasspath())
          }
doLast {
  copy {
    from "src/main/javadoc"
    into "$buildDir/docs/javadoc"
  }
}

}
}

@jatinmishra
Copy link

@jatinmishra jatinmishra commented on 13592df Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update :
I fixed this issue by adding the classpath in the doFirst{ } block in build.gradle of our exoplayer module
alongwith applying the above mentioned fix.

@ojw28
Copy link
Contributor

@ojw28 ojw28 commented on 13592df Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have a file called exoplayer.gradle anywhere in our codebase, so I suspect this is something specific to your app or some library you're using. Please let us know if that's not the case.

@jatinmishra
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your reply, I will drop an update about your query after discussing with my team.

@ojw28
Copy link
Contributor

@ojw28 ojw28 commented on 13592df Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is still something wrong with javadoc_combined.gradle. If you know how to fix it that would be helpful ;).

@jatinmishra
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I haven't changed the javadoc_combined.gradle it is working fine for me but what makes you think that there is something wrong with javadoc_combined.gradle , can you please elaborate so that I can help.

@ojw28
Copy link
Contributor

@ojw28 ojw28 commented on 13592df Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./gradlew clean generateCombinedJavadoc is failing.

@ojw28
Copy link
Contributor

@ojw28 ojw28 commented on 13592df Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may however just be due to increased strictness around failing on errors. Setting failOnError false in the options {} block seems to generate Javadoc that looks correct. There are missing links to the Android SDK documentation, but it appears that's also the case with our previous release.

@jatinmishra
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok , I will drop an update if I find anything

@jatinmishra
Copy link

@jatinmishra jatinmishra commented on 13592df Aug 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi ojw28,

Sorry for the extremely late reply, I completely forgot about this issue as I had some really tedious tasks lined up. I was going through the project today and remembered this.

I fixed this issue for my project by putting the classpath variable in the doFirst {} enclosure in the build.gradle (for the exoplayer module) and javadoc_combined.gradle files as well as you did in the javadoc_library.gradle file in this commit above.

Hope this will be helpful.
I am really sorry again for the late response. :)

Thanks.

@tonihei
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jatinmishra Thanks for replying. Do you see any remaining issue in our code? javadoc_combined.gradle already uses doFirst{} by now (see here).

@jatinmishra
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tonihei yes I checked the latest code and found it was good.
Also, I haven't encountered any issue till now. Actually, today I was upgrading the gradle in our project from 4.1 to 5.1 and till now its working great.
I will surely let you know if I encounter anything.

Thanks.

Please sign in to comment.