diff --git a/common_library_config.gradle b/common_library_config.gradle new file mode 100644 index 0000000000..7be2290bc0 --- /dev/null +++ b/common_library_config.gradle @@ -0,0 +1,34 @@ +// Copyright (C) 2020 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: "$gradle.ext.exoplayerRoot/constants.gradle" +apply plugin: 'com.android.library' + +android { + compileSdkVersion project.ext.compileSdkVersion + + defaultConfig { + minSdkVersion project.ext.minSdkVersion + targetSdkVersion project.ext.targetSdkVersion + consumerProguardFiles 'proguard-rules.txt' + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + testOptions.unitTests.includeAndroidResources = true +} diff --git a/core_settings.gradle b/core_settings.gradle index ac56933155..3672b015ca 100644 --- a/core_settings.gradle +++ b/core_settings.gradle @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. def rootDir = gradle.ext.exoplayerRoot +if (!gradle.ext.has('exoplayerSettingsDir')) { + gradle.ext.exoplayerSettingsDir = rootDir +} def modulePrefix = ':' if (gradle.ext.has('exoplayerModulePrefix')) { modulePrefix += gradle.ext.exoplayerModulePrefix diff --git a/extensions/av1/build.gradle b/extensions/av1/build.gradle index d61a3a97f8..c89b80b3d5 100644 --- a/extensions/av1/build.gradle +++ b/extensions/av1/build.gradle @@ -11,22 +11,10 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - externalNativeBuild { cmake { // Debug CMake build type causes video frames to drop, diff --git a/extensions/cast/build.gradle b/extensions/cast/build.gradle index 58bb15dff2..4c8f648e34 100644 --- a/extensions/cast/build.gradle +++ b/extensions/cast/build.gradle @@ -11,24 +11,7 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { api 'com.google.android.gms:play-services-cast-framework:18.1.0' diff --git a/extensions/cronet/build.gradle b/extensions/cronet/build.gradle index c27bc37ff0..c0f443d5df 100644 --- a/extensions/cronet/build.gradle +++ b/extensions/cronet/build.gradle @@ -11,24 +11,7 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { api "com.google.android.gms:play-services-cronet:17.0.0" diff --git a/extensions/ffmpeg/build.gradle b/extensions/ffmpeg/build.gradle index 26a72ae335..09d7182a30 100644 --- a/extensions/ffmpeg/build.gradle +++ b/extensions/ffmpeg/build.gradle @@ -11,29 +11,13 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - } - sourceSets.main { jniLibs.srcDir 'src/main/libs' jni.srcDirs = [] // Disable the automatic ndk-build call by Android Studio. } - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/extensions/flac/build.gradle b/extensions/flac/build.gradle index f220d21106..9aeeb83eb3 100644 --- a/extensions/flac/build.gradle +++ b/extensions/flac/build.gradle @@ -11,24 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - } - sourceSets { main { jniLibs.srcDir 'src/main/libs' @@ -36,8 +21,6 @@ android { } androidTest.assets.srcDir '../../testdata/src/test/assets/' } - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/extensions/gvr/build.gradle b/extensions/gvr/build.gradle index 4e6bd76cb4..891888a0d2 100644 --- a/extensions/gvr/build.gradle +++ b/extensions/gvr/build.gradle @@ -11,24 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion 19 - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +android.defaultConfig.minSdkVersion 19 dependencies { implementation project(modulePrefix + 'library-core') diff --git a/extensions/ima/build.gradle b/extensions/ima/build.gradle index 28f201e24b..b132f57baf 100644 --- a/extensions/ima/build.gradle +++ b/extensions/ima/build.gradle @@ -11,22 +11,10 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' // Enable multidex for androidTests. multiDexEnabled true } @@ -34,8 +22,6 @@ android { sourceSets { androidTest.assets.srcDir '../../testdata/src/test/assets/' } - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/extensions/jobdispatcher/build.gradle b/extensions/jobdispatcher/build.gradle index 05ac82ba08..df50cde8f9 100644 --- a/extensions/jobdispatcher/build.gradle +++ b/extensions/jobdispatcher/build.gradle @@ -13,24 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -apply from: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') diff --git a/extensions/leanback/build.gradle b/extensions/leanback/build.gradle index 19b4cde3bf..14ced09f12 100644 --- a/extensions/leanback/build.gradle +++ b/extensions/leanback/build.gradle @@ -11,24 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion 17 - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +android.defaultConfig.minSdkVersion 17 dependencies { implementation project(modulePrefix + 'library-core') diff --git a/extensions/mediasession/build.gradle b/extensions/mediasession/build.gradle index f32ef263e0..5c827084da 100644 --- a/extensions/mediasession/build.gradle +++ b/extensions/mediasession/build.gradle @@ -11,24 +11,7 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') diff --git a/extensions/okhttp/build.gradle b/extensions/okhttp/build.gradle index a44e62e0e5..032fb0fded 100644 --- a/extensions/okhttp/build.gradle +++ b/extensions/okhttp/build.gradle @@ -11,25 +11,7 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') diff --git a/extensions/opus/build.gradle b/extensions/opus/build.gradle index 545b5a7af8..ba670037f6 100644 --- a/extensions/opus/build.gradle +++ b/extensions/opus/build.gradle @@ -11,24 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - } - sourceSets { main { jniLibs.srcDir 'src/main/libs' @@ -36,8 +21,6 @@ android { } androidTest.assets.srcDir '../../testdata/src/test/assets/' } - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/extensions/rtmp/build.gradle b/extensions/rtmp/build.gradle index 621f8b2998..3d912bebf6 100644 --- a/extensions/rtmp/build.gradle +++ b/extensions/rtmp/build.gradle @@ -11,24 +11,7 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') diff --git a/extensions/vp9/build.gradle b/extensions/vp9/build.gradle index ffd76d6e2f..79d85a6ac5 100644 --- a/extensions/vp9/build.gradle +++ b/extensions/vp9/build.gradle @@ -11,24 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - } - sourceSets { main { jniLibs.srcDir 'src/main/libs' @@ -36,8 +21,6 @@ android { } androidTest.assets.srcDir '../../testdata/src/test/assets/' } - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/extensions/workmanager/build.gradle b/extensions/workmanager/build.gradle index 36df826adb..f30461d379 100644 --- a/extensions/workmanager/build.gradle +++ b/extensions/workmanager/build.gradle @@ -13,24 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -apply from: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { implementation project(modulePrefix + 'library-core') diff --git a/library/all/build.gradle b/library/all/build.gradle index f78b8b2132..fa3491bb5d 100644 --- a/library/all/build.gradle +++ b/library/all/build.gradle @@ -11,17 +11,7 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { api project(modulePrefix + 'library-core') diff --git a/library/common/build.gradle b/library/common/build.gradle index 27ca38d444..0e18a9c062 100644 --- a/library/common/build.gradle +++ b/library/common/build.gradle @@ -11,30 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - buildTypes { - debug { - testCoverageEnabled = true - } - } - - testOptions.unitTests.includeAndroidResources = true -} +android.buildTypes.debug.testCoverageEnabled true dependencies { implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion diff --git a/library/core/build.gradle b/library/core/build.gradle index d95629e0d7..6dc3dd647f 100644 --- a/library/core/build.gradle +++ b/library/core/build.gradle @@ -11,24 +11,10 @@ // 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 plugin: 'com.android.library' -apply from: '../../constants.gradle' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - consumerProguardFiles 'proguard-rules.txt' - - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - // The following argument makes the Android Test Orchestrator run its // "pm clear" command after each test invocation. This command ensures // that the app's state is completely cleared between tests. @@ -45,8 +31,6 @@ android { androidTest.assets.srcDir '../../testdata/src/test/assets/' test.assets.srcDir '../../testdata/src/test/assets/' } - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/library/dash/build.gradle b/library/dash/build.gradle index 26515c8470..82e17607f9 100644 --- a/library/dash/build.gradle +++ b/library/dash/build.gradle @@ -11,22 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - buildTypes { debug { testCoverageEnabled = true @@ -34,8 +21,6 @@ android { } sourceSets.test.assets.srcDir '../../testdata/src/test/assets/' - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/library/extractor/build.gradle b/library/extractor/build.gradle index 52cc193550..ffc1ce141e 100644 --- a/library/extractor/build.gradle +++ b/library/extractor/build.gradle @@ -11,22 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - buildTypes { debug { testCoverageEnabled = true @@ -34,8 +21,6 @@ android { } sourceSets.test.assets.srcDir '../../testdata/src/test/assets/' - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/library/hls/build.gradle b/library/hls/build.gradle index e4630f6044..80ef65117b 100644 --- a/library/hls/build.gradle +++ b/library/hls/build.gradle @@ -11,22 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - buildTypes { debug { testCoverageEnabled = true @@ -34,8 +21,6 @@ android { } sourceSets.test.assets.srcDir '../../testdata/src/test/assets/' - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/library/smoothstreaming/build.gradle b/library/smoothstreaming/build.gradle index e9ffcd9b5b..34fa62e096 100644 --- a/library/smoothstreaming/build.gradle +++ b/library/smoothstreaming/build.gradle @@ -11,22 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - buildTypes { debug { testCoverageEnabled = true @@ -34,8 +21,6 @@ android { } sourceSets.test.assets.srcDir '../../testdata/src/test/assets/' - - testOptions.unitTests.includeAndroidResources = true } dependencies { diff --git a/library/ui/build.gradle b/library/ui/build.gradle index e8c6327e25..2184443a5d 100644 --- a/library/ui/build.gradle +++ b/library/ui/build.gradle @@ -11,30 +11,9 @@ // 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: '../../constants.gradle' -apply plugin: 'com.android.library' +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - buildTypes { - debug { - testCoverageEnabled = true - } - } - - testOptions.unitTests.includeAndroidResources = true -} +android.buildTypes.debug.testCoverageEnabled true dependencies { implementation project(modulePrefix + 'library-core') diff --git a/playbacktests/build.gradle b/playbacktests/build.gradle index 0e93b97f5e..105427250b 100644 --- a/playbacktests/build.gradle +++ b/playbacktests/build.gradle @@ -11,25 +11,7 @@ // 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: '../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { androidTestImplementation 'androidx.test:rules:' + androidxTestRulesVersion diff --git a/testdata/build.gradle b/testdata/build.gradle index 372a01132e..2510c37e65 100644 --- a/testdata/build.gradle +++ b/testdata/build.gradle @@ -11,8 +11,5 @@ // 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: '../constants.gradle' -apply plugin: 'com.android.library' - -android.compileSdkVersion project.ext.compileSdkVersion +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" diff --git a/testutils/build.gradle b/testutils/build.gradle index 931203b3bb..93b3acf53f 100644 --- a/testutils/build.gradle +++ b/testutils/build.gradle @@ -11,24 +11,7 @@ // 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: '../constants.gradle' -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.ext.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion project.ext.minSdkVersion - targetSdkVersion project.ext.targetSdkVersion - } - - testOptions.unitTests.includeAndroidResources = true -} +apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle" dependencies { api 'org.mockito:mockito-core:' + mockitoVersion