Skip to content

Commit 41ea6d9

Browse files
committed
Using SDK Version variables from root project
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project. Default `compileSdkVersion` and `targetSdkVersion` to the latest versions. Android Target API Level 26 will be required in August 2018. https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html And the React Native team is already working on this: facebook/react-native#17741 facebook/react-native#18095
1 parent 635b512 commit 41ea6d9

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

android-exoplayer/build.gradle

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
apply plugin: 'com.android.library'
22

3+
def _ext = rootProject.ext
4+
5+
def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+'
6+
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 27
7+
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '27.0.3'
8+
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
9+
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 27
10+
311
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "25.0.2"
12+
compileSdkVersion _compileSdkVersion
13+
buildToolsVersion _buildToolsVersion
614

715
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 23
16+
minSdkVersion _minSdkVersion
17+
targetSdkVersion _targetSdkVersion
18+
versionCode 1
19+
versionName "1.0"
1020
}
1121
}
1222

1323
dependencies {
14-
provided 'com.facebook.react:react-native:+'
24+
//noinspection GradleDynamicVersion
25+
provided "com.facebook.react:react-native:${_reactNativeVersion}"
1526
compile 'com.google.android.exoplayer:exoplayer:r2.4.0'
1627
compile('com.google.android.exoplayer:extension-okhttp:r2.4.0') {
1728
exclude group: 'com.squareup.okhttp3', module: 'okhttp'

android/build.gradle

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
apply plugin: 'com.android.library'
22

3+
def _ext = rootProject.ext
4+
5+
def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+'
6+
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 27
7+
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '27.0.3'
8+
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
9+
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 27
10+
311
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.2"
12+
compileSdkVersion _compileSdkVersion
13+
buildToolsVersion _buildToolsVersion
614

715
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 25
16+
minSdkVersion _minSdkVersion
17+
targetSdkVersion _targetSdkVersion
1018
versionCode 1
1119
versionName "1.0"
1220
ndk {
@@ -17,6 +25,6 @@ android {
1725

1826
dependencies {
1927
//noinspection GradleDynamicVersion
20-
provided 'com.facebook.react:react-native:+'
28+
provided "com.facebook.react:react-native:${_reactNativeVersion}"
2129
compile 'com.yqritc:android-scalablevideoview:1.0.4'
2230
}

0 commit comments

Comments
 (0)