forked from doublesymmetry/react-native-track-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
95 lines (76 loc) · 2.67 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import groovy.json.JsonSlurper
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
}
}
apply plugin: 'com.android.library'
boolean dash = false, hls = false, smoothstreaming = false
File file = file('../../../track-player.json')
if(file.exists()) {
def json = new JsonSlurper().parseText(file.text)
dash = json.dash ?: dash
hls = json.hls ?: hls
smoothstreaming = json.smoothstreaming ?: smoothstreaming
}
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet("compileSdkVersion", 28)
defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 16) // RN's minimum version
targetSdkVersion safeExtGet("targetSdkVersion", 28)
versionCode 1
versionName "1.0"
consumerProguardFiles 'proguard-rules.txt'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
maven {
// As RN is not updated in jcenter anymore, we'll have to grab it from npm
// Make sure you have installed the react-native npm package before compiling
url "../node_modules/react-native/android"
}
jcenter()
google()
mavenCentral()
}
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
def exoPlayerVersion = safeExtGet("exoPlayerVersion", '2.10.1')
// ExoPlayer Core
implementation "com.google.android.exoplayer:exoplayer-core:${exoPlayerVersion}"
// ExoPlayer DASH
if (dash) {
implementation "com.google.android.exoplayer:exoplayer-dash:${exoPlayerVersion}"
} else {
compileOnly "com.google.android.exoplayer:exoplayer-dash:${exoPlayerVersion}"
}
// ExoPlayer HLS
if (hls) {
implementation "com.google.android.exoplayer:exoplayer-hls:${exoPlayerVersion}"
} else {
compileOnly "com.google.android.exoplayer:exoplayer-hls:${exoPlayerVersion}"
}
// ExoPlayer SmoothStreaming
if (smoothstreaming) {
implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:${exoPlayerVersion}"
} else {
compileOnly "com.google.android.exoplayer:exoplayer-smoothstreaming:${exoPlayerVersion}"
}
// Make sure we're using androidx
implementation "androidx.core:core:1.2.0-beta01"
implementation "androidx.media:media:1.1.0"
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-alpha01"
implementation "com.github.bumptech.glide:glide:4.7.1"
}