Migrate ExoPlayer Gradle build files.

- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
This commit is contained in:
hoangtc 2018-02-28 05:24:42 -08:00 committed by Andrew Lewis
parent 2f4a3d2e5d
commit fcb796a80c
34 changed files with 127 additions and 110 deletions

View File

@ -2,6 +2,12 @@
### dev-v2 (not yet released) ### ### dev-v2 (not yet released) ###
* Gradle: Replace 'compile' configuration (deprecated) with 'implementation' and
'api'. Note: This may lead to build breakage for applications upgrading from
previous version that rely on indirect dependency for certain modules. In such
cases, application developers need to add the missing dependency directly to
resolve this issue. You can read more about the new dependency configurations
[here](https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#new_configurations).
* Downloading: Add `DownloadService`, `DownloadManager` and * Downloading: Add `DownloadService`, `DownloadManager` and
related classes ([#2643](https://github.com/google/ExoPlayer/issues/2643)). related classes ([#2643](https://github.com/google/ExoPlayer/issues/2643)).
* MediaSources: * MediaSources:

View File

@ -42,11 +42,13 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile project(modulePrefix + 'library-dash') implementation project(modulePrefix + 'library-dash')
compile project(modulePrefix + 'library-hls') implementation project(modulePrefix + 'library-hls')
compile project(modulePrefix + 'library-smoothstreaming') implementation project(modulePrefix + 'library-smoothstreaming')
compile project(modulePrefix + 'library-ui') implementation project(modulePrefix + 'library-ui')
compile project(modulePrefix + 'extension-cast') implementation project(modulePrefix + 'extension-cast')
compile 'com.android.support:recyclerview-v7:' + supportLibraryVersion implementation 'com.android.support:support-v4:' + supportLibraryVersion
implementation 'com.android.support:appcompat-v7:' + supportLibraryVersion
implementation 'com.android.support:recyclerview-v7:' + supportLibraryVersion
} }

View File

@ -41,10 +41,11 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile project(modulePrefix + 'library-ui') implementation project(modulePrefix + 'library-ui')
compile project(modulePrefix + 'library-dash') implementation project(modulePrefix + 'library-dash')
compile project(modulePrefix + 'library-hls') implementation project(modulePrefix + 'library-hls')
compile project(modulePrefix + 'library-smoothstreaming') implementation project(modulePrefix + 'library-smoothstreaming')
compile project(modulePrefix + 'extension-ima') implementation project(modulePrefix + 'extension-ima')
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
} }

View File

@ -55,15 +55,16 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation 'com.android.support:support-annotations:' + supportLibraryVersion
compile project(modulePrefix + 'library-dash') implementation project(modulePrefix + 'library-core')
compile project(modulePrefix + 'library-hls') implementation project(modulePrefix + 'library-dash')
compile project(modulePrefix + 'library-smoothstreaming') implementation project(modulePrefix + 'library-hls')
compile project(modulePrefix + 'library-ui') implementation project(modulePrefix + 'library-smoothstreaming')
withExtensionsCompile project(path: modulePrefix + 'extension-ffmpeg') implementation project(modulePrefix + 'library-ui')
withExtensionsCompile project(path: modulePrefix + 'extension-flac') withExtensionsImplementation project(path: modulePrefix + 'extension-ffmpeg')
withExtensionsCompile project(path: modulePrefix + 'extension-ima') withExtensionsImplementation project(path: modulePrefix + 'extension-flac')
withExtensionsCompile project(path: modulePrefix + 'extension-opus') withExtensionsImplementation project(path: modulePrefix + 'extension-ima')
withExtensionsCompile project(path: modulePrefix + 'extension-vp9') withExtensionsImplementation project(path: modulePrefix + 'extension-opus')
withExtensionsCompile project(path: modulePrefix + 'extension-rtmp') withExtensionsImplementation project(path: modulePrefix + 'extension-vp9')
withExtensionsImplementation project(path: modulePrefix + 'extension-rtmp')
} }

View File

@ -12,7 +12,7 @@ Cast receiver app.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-cast:rX.X.X' implementation 'com.google.android.exoplayer:extension-cast:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -26,19 +26,24 @@ android {
} }
dependencies { dependencies {
// This dependency is necessary to force the supportLibraryVersion of // These dependencies are necessary to force the supportLibraryVersion of
// com.android.support:support-v4 to be used. Else an older version (25.2.0) // com.android.support:support-v4, com.android.support:appcompat-v7 and
// is included via: // com.android.support:mediarouter-v7 to be used. Else older versions are
// used, for example:
// com.google.android.gms:play-services-cast-framework:11.4.2 // com.google.android.gms:play-services-cast-framework:11.4.2
// |-- com.google.android.gms:play-services-basement:11.4.2 // |-- com.google.android.gms:play-services-basement:11.4.2
// |-- com.android.support:support-v4:25.2.0 // |-- com.android.support:support-v4:25.2.0
compile 'com.android.support:support-v4:' + supportLibraryVersion api 'com.android.support:support-v4:' + supportLibraryVersion
compile 'com.android.support:appcompat-v7:' + supportLibraryVersion api 'com.android.support:appcompat-v7:' + supportLibraryVersion
compile 'com.android.support:mediarouter-v7:' + supportLibraryVersion api 'com.android.support:mediarouter-v7:' + supportLibraryVersion
compile 'com.google.android.gms:play-services-cast-framework:' + playServicesLibraryVersion api 'com.google.android.gms:play-services-cast-framework:' + playServicesLibraryVersion
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile project(modulePrefix + 'library-ui') implementation project(modulePrefix + 'library-ui')
testCompile project(modulePrefix + 'testutils-robolectric') testImplementation project(modulePrefix + 'testutils')
testImplementation 'junit:junit:' + junitVersion
testImplementation 'org.mockito:mockito-core:' + mockitoVersion
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
testImplementation project(modulePrefix + 'testutils-robolectric')
} }
ext { ext {

View File

@ -35,12 +35,13 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') api files('libs/cronet_api.jar')
compile files('libs/cronet_api.jar') implementation files('libs/cronet_impl_common_java.jar')
compile files('libs/cronet_impl_common_java.jar') implementation files('libs/cronet_impl_native_java.jar')
compile files('libs/cronet_impl_native_java.jar') implementation project(modulePrefix + 'library-core')
testCompile project(modulePrefix + 'library') implementation 'com.android.support:support-annotations:' + supportLibraryVersion
testCompile project(modulePrefix + 'testutils-robolectric') testImplementation project(modulePrefix + 'library')
testImplementation project(modulePrefix + 'testutils-robolectric')
} }
ext { ext {

View File

@ -31,7 +31,7 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
} }
ext { ext {

View File

@ -31,8 +31,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
androidTestCompile project(modulePrefix + 'testutils') androidTestImplementation project(modulePrefix + 'testutils')
} }
ext { ext {

View File

@ -12,7 +12,7 @@ of surround sound and ambisonic soundfields.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-gvr:rX.X.X' implementation 'com.google.android.exoplayer:extension-gvr:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -25,8 +25,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'com.google.vr:sdk-audio:1.80.0' implementation 'com.google.vr:sdk-audio:1.80.0'
} }
ext { ext {

View File

@ -12,7 +12,7 @@ alongside content.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-ima:rX.X.X' implementation 'com.google.android.exoplayer:extension-ima:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -26,7 +26,6 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core')
// This dependency is necessary to force the supportLibraryVersion of // This dependency is necessary to force the supportLibraryVersion of
// com.android.support:support-v4 to be used. Else an older version (25.2.0) // com.android.support:support-v4 to be used. Else an older version (25.2.0)
// is included via: // is included via:
@ -34,14 +33,10 @@ dependencies {
// |-- com.google.android.gms:play-services-ads-lite:11.4.2 // |-- com.google.android.gms:play-services-ads-lite:11.4.2
// |-- com.google.android.gms:play-services-basement:11.4.2 // |-- com.google.android.gms:play-services-basement:11.4.2
// |-- com.android.support:support-v4:25.2.0 // |-- com.android.support:support-v4:25.2.0
compile 'com.android.support:support-v4:' + supportLibraryVersion api 'com.android.support:support-v4:' + supportLibraryVersion
compile 'com.google.ads.interactivemedia.v3:interactivemedia:3.7.4' api 'com.google.ads.interactivemedia.v3:interactivemedia:3.7.4'
compile 'com.google.android.gms:play-services-ads:' + playServicesLibraryVersion implementation project(modulePrefix + 'library-core')
androidTestCompile project(modulePrefix + 'library') implementation 'com.google.android.gms:play-services-ads:' + playServicesLibraryVersion
androidTestCompile 'com.google.dexmaker:dexmaker:' + dexmakerVersion
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion
androidTestCompile 'org.mockito:mockito-core:' + mockitoVersion
androidTestCompile 'com.android.support.test:runner:' + testSupportLibraryVersion
} }
ext { ext {

View File

@ -9,7 +9,7 @@ This extension provides a Scheduler implementation which uses [Firebase JobDispa
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-jobdispatcher:rX.X.X' implementation 'com.google.android.exoplayer:extension-jobdispatcher:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -27,8 +27,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'com.firebase:firebase-jobdispatcher:0.8.5' implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
} }
ext { ext {

View File

@ -11,7 +11,7 @@ ExoPlayer.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-leanback:rX.X.X' implementation 'com.google.android.exoplayer:extension-leanback:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -25,8 +25,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile('com.android.support:leanback-v17:' + supportLibraryVersion) implementation('com.android.support:leanback-v17:' + supportLibraryVersion)
} }
ext { ext {

View File

@ -12,7 +12,7 @@ behaviour can be extended to support other playback and custom actions.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-mediasession:rX.X.X' implementation 'com.google.android.exoplayer:extension-mediasession:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -25,8 +25,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'com.android.support:support-media-compat:' + supportLibraryVersion implementation 'com.android.support:support-media-compat:' + supportLibraryVersion
} }
ext { ext {

View File

@ -19,7 +19,7 @@ licensed separately.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-okhttp:rX.X.X' implementation 'com.google.android.exoplayer:extension-okhttp:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -30,8 +30,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile('com.squareup.okhttp3:okhttp:3.9.0') { implementation 'com.android.support:support-annotations:' + supportLibraryVersion
implementation('com.squareup.okhttp3:okhttp:3.9.0') {
exclude group: 'org.json' exclude group: 'org.json'
} }
} }

View File

@ -31,7 +31,7 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
} }
ext { ext {

View File

@ -20,7 +20,7 @@ Android, which is licensed separately.
The easiest way to use the extension is to add it as a gradle dependency: The easiest way to use the extension is to add it as a gradle dependency:
```gradle ```gradle
compile 'com.google.android.exoplayer:extension-rtmp:rX.X.X' implementation 'com.google.android.exoplayer:extension-rtmp:rX.X.X'
``` ```
where `rX.X.X` is the version, which must match the version of the ExoPlayer where `rX.X.X` is the version, which must match the version of the ExoPlayer

View File

@ -25,8 +25,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'net.butterflytv.utils:rtmp-client:3.0.1' implementation 'net.butterflytv.utils:rtmp-client:3.0.1'
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
} }
ext { ext {

View File

@ -31,8 +31,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
androidTestCompile 'com.google.truth:truth:' + truthVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
androidTestImplementation 'com.google.truth:truth:' + truthVersion
} }
ext { ext {

View File

@ -25,11 +25,11 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') api project(modulePrefix + 'library-core')
compile project(modulePrefix + 'library-dash') api project(modulePrefix + 'library-dash')
compile project(modulePrefix + 'library-hls') api project(modulePrefix + 'library-hls')
compile project(modulePrefix + 'library-smoothstreaming') api project(modulePrefix + 'library-smoothstreaming')
compile project(modulePrefix + 'library-ui') api project(modulePrefix + 'library-ui')
} }
ext { ext {

View File

@ -45,15 +45,15 @@ android {
} }
dependencies { dependencies {
compile 'com.android.support:support-annotations:' + supportLibraryVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
androidTestCompile 'com.google.dexmaker:dexmaker:' + dexmakerVersion androidTestImplementation 'com.google.dexmaker:dexmaker:' + dexmakerVersion
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:' + dexmakerVersion
androidTestCompile 'com.google.truth:truth:' + truthVersion androidTestImplementation 'com.google.truth:truth:' + truthVersion
androidTestCompile 'org.mockito:mockito-core:' + mockitoVersion androidTestImplementation 'org.mockito:mockito-core:' + mockitoVersion
testCompile 'com.google.truth:truth:' + truthVersion testImplementation 'com.google.truth:truth:' + truthVersion
testCompile 'junit:junit:' + junitVersion testImplementation 'junit:junit:' + junitVersion
testCompile 'org.mockito:mockito-core:' + mockitoVersion testImplementation 'org.mockito:mockito-core:' + mockitoVersion
testCompile 'org.robolectric:robolectric:' + robolectricVersion testImplementation 'org.robolectric:robolectric:' + robolectricVersion
} }
ext { ext {

View File

@ -33,9 +33,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'com.android.support:support-annotations:' + supportLibraryVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
testCompile project(modulePrefix + 'testutils-robolectric') testImplementation project(modulePrefix + 'testutils-robolectric')
} }
ext { ext {

View File

@ -33,9 +33,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation 'com.android.support:support-annotations:' + supportLibraryVersion
compile 'com.android.support:support-annotations:' + supportLibraryVersion implementation project(modulePrefix + 'library-core')
testCompile project(modulePrefix + 'testutils-robolectric') testImplementation project(modulePrefix + 'testutils-robolectric')
} }
ext { ext {

View File

@ -33,9 +33,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'com.android.support:support-annotations:' + supportLibraryVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
testCompile project(modulePrefix + 'testutils-robolectric') testImplementation project(modulePrefix + 'testutils-robolectric')
} }
ext { ext {

View File

@ -33,8 +33,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
compile 'com.android.support:support-annotations:' + supportLibraryVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
} }
ext { ext {

View File

@ -25,8 +25,8 @@ android {
} }
dependencies { dependencies {
androidTestCompile project(modulePrefix + 'library-core') androidTestImplementation project(modulePrefix + 'library-core')
androidTestCompile project(modulePrefix + 'library-dash') androidTestImplementation project(modulePrefix + 'library-dash')
androidTestCompile project(modulePrefix + 'library-hls') androidTestImplementation project(modulePrefix + 'library-hls')
androidTestCompile project(modulePrefix + 'testutils') androidTestImplementation project(modulePrefix + 'testutils')
} }

View File

@ -32,8 +32,9 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'library-core') api 'org.mockito:mockito-core:' + mockitoVersion
compile 'org.mockito:mockito-core:' + mockitoVersion api 'com.google.truth:truth:' + truthVersion
compile 'com.google.truth:truth:' + truthVersion implementation 'com.android.support:support-annotations:' + supportLibraryVersion
testCompile project(modulePrefix + 'testutils-robolectric') implementation project(modulePrefix + 'library-core')
testImplementation project(modulePrefix + 'testutils-robolectric')
} }

View File

@ -32,6 +32,8 @@ android {
} }
dependencies { dependencies {
compile project(modulePrefix + 'testutils') api 'org.robolectric:robolectric:' + robolectricVersion
compile 'org.robolectric:robolectric:' + robolectricVersion api project(modulePrefix + 'testutils')
implementation project(modulePrefix + 'library-core')
implementation 'com.android.support:support-annotations:' + supportLibraryVersion
} }