forked from SkyTubeTeam/SkyTube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
216 lines (186 loc) · 8.8 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
apply plugin: 'com.android.application'
apply plugin: "de.mannodermaus.android-junit5"
android {
compileSdkVersion 33
buildToolsVersion '33.0.2'
namespace 'free.rm.skytube'
defaultConfig {
applicationId "free.rm.skytube"
minSdkVersion 19
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 28
versionName "2.985" // digits of the *fractional part* shall NOT be > than "9"
versionCode 45
// Third party devs: pls be ethical and change the below keys
//buildConfigField 'String', 'YOUTUBE_API_KEYS_DEBUG', '"AIzaSyDU-ZZCyOB_kYkiMSZ6ooSipUZRukHU4ik"'
buildConfigField 'String', 'YOUTUBE_API_KEYS_DEBUG', '"hidden:A0C0B03EED58193F4CD52DF668495D523A5229C6B66B0ED6282AE09BD8FF08CD5AF9A6B52C214F"'
buildConfigField 'String[]', 'YOUTUBE_API_KEYS',
'{' +
'"hidden:A0C0B03EED581E1E18E900CF3E365C70253320C5D8040BF53818F2EAF4D62AEC6FA7E68F5F2175",' +
'"hidden:A0C0B03EED581E277FCC2BD47E75526C06401FB4F66E3EDB2A2BE2B7F9C606896DDEF9875F3804",' +
'"hidden:A0C0B03EED58183878F501C639336957395D24B2CC7C2FD43919CB92F682408C4CBEC1C2280F4B"' +
'}'
buildConfigField 'String', 'SKYTUBE_WEBSITE', '"https://skytube-app.com"'
buildConfigField 'String', 'SKYTUBE_WEBSITE_CREDITS', '"https://skytube-app.com/credits.html"'
buildConfigField 'String', 'SKYTUBE_ISSUES_URL', '"https://github.com/SkyTubeTeam/SkyTube/issues/new/choose"'
buildConfigField 'String', 'SKYTUBE_UPDATES_URL', '"https://api.github.com/repos/SkyTubeTeam/SkyTube/releases/latest"'
buildConfigField 'long', 'BUILD_TIME', String.valueOf(System.currentTimeMillis()) + 'L'
vectorDrawables.useSupportLibrary true
multiDexEnabled true // as we have over 65536 lines of code...
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "CHROMECAST_APP_ID", "\"39E8D587\""
}
debug {
minifyEnabled false
buildConfigField "String", "CHROMECAST_APP_ID", "\"29A66E17\"" // dev
}
snapshot {
initWith debug
applicationIdSuffix ".snapshot"
resValue "string", "app_name", "SkyTube Snapshot"
}
}
flavorDimensions "skytube"
productFlavors {
// 100% Open-Source Edition
oss {
applicationIdSuffix ".oss"
resValue "string", "app_name", "SkyTube"
resValue "string", "app_flavor", "OSS"
dimension "skytube"
buildConfigField 'String[]', 'YOUTUBE_API_KEYS',
'{' + // new keys
'"hidden:A0C0B03EED581E1E18E900CF3E365C70253320C5D8040BF53818F2EAF4D62AEC6FA7E68F5F2175",' +
'"hidden:A0C0B03EED581E277FCC2BD47E75526C06401FB4F66E3EDB2A2BE2B7F9C606896DDEF9875F3804",' +
'"hidden:A0C0B03EED58183878F501C639336957395D24B2CC7C2FD43919CB92F682408C4CBEC1C2280F4B",' +
// old keys, but this can be used with FDroid
'"AIzaSyC27jgPDHkQsQK8TW4ngrQprSCnlMTJ04w",' +
'"AIzaSyCmXsaE6ZW14-1vM5zceWnGWnB73FkY7U4",' +
'"AIzaSyBd3Loyy_XN2tPHPfc1E7EkSkdCqfzTHxg"' +
'}'
}
// 99% Open-source edition: uses the YouTube Player Jar [i.e. proprietary module - optional usage]
extra {
applicationIdSuffix ".extra"
resValue "string", "app_name", "SkyTube Extra"
resValue "string", "app_flavor", "Extra"
dimension "skytube"
}
}
// Generate APK filenames as follows: <App Name>-<Flavor><Version>
applicationVariants.all { variant ->
outputs.all { output ->
outputFileName = "${parent.name}-${productFlavors[0].name.capitalize()}-${versionName}.apk"
}
}
// Ignore missing translations
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
}
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
jniLibs {
excludes += ['META-INF/*']
}
resources {
excludes += ['META-INF/*']
}
}
buildFeatures {
viewBinding true
}
lint {
abortOnError false
checkReleaseBuilds false
}
}
dependencies {
/** Desugaring **/
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
/** Kotlin **/
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
/** AndroidX **/
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.media:media:1.3.1'
implementation 'androidx.multidex:multidex:2.0.1' // as we have over 65536 methods...
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.google.android.material:material:1.4.0'
/** ExoPlayer **/
// Application level media player
def exoplayerVersion = '2.9.6'
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayerVersion"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayerVersion"
/** Third-party **/
/**** Frontend (UI-related) ****/
// Old SlidingDrawer widget component but improved
implementation 'com.github.moraisigor:slidingdrawer:1.7.1'
// Image loading and caching library
def glideVersion = '4.12.0'
implementation "com.github.bumptech.glide:glide:$glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"
// Custom dialogs
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
// File / folder chooser
implementation 'com.github.hedzr:android-file-chooser:v1.2.0-final'
// Add a badge to an action item
implementation 'com.mikepenz:actionitembadge:4.0.0@aar'
// Use any icon font or vector as drawable
implementation 'com.mikepenz:iconics-core:4.0.2@aar'
// Material Design Iconic Font
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.6-kotlin@aar'
/**** Backend logic ****/
// Social style date / time formatting for Java
implementation 'org.ocpsoft.prettytime:prettytime:5.0.1.Final'
// Convert Java objects into JSON and back
implementation 'com.google.code.gson:gson:2.8.8'
// YouTube modules
implementation 'com.github.SkyTubeTeam.google-http-java-client:google-http-client-android:e726c5718d'
implementation('com.google.apis:google-api-services-youtube:v3-rev20200423-1.30.9') {
exclude group: 'com.google.http-client', module: 'google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
}
// implementation 'com.github.SkyTubeTeam.NewPipeExtractor:NewPipeExtractor:818745b7e4'
implementation 'com.github.TeamNewPipe.NewPipeExtractor:NewPipeExtractor:v0.22.5'
implementation ('com.github.SkyTubeTeam.components:okhttp-client:0.0.5') {
exclude group: 'com.github.SkyTubeTeam.NewPipeExtractor', module: 'extractor'
}
// Java HTML parser
implementation "org.jsoup:jsoup:1.15.3"
// Language Detection Library for Java
implementation('com.optimaize.languagedetector:language-detector:0.6') {
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'com.intellij', module: 'annotations'
}
// Reactive extensions for Java VM
implementation 'com.github.SkyTubeTeam:RxAndroid:3.0.1.SkyTubeTeam'
implementation 'io.reactivex.rxjava3:rxjava:3.0.13'
/** Debug **/
// debugImplementation because LeakCanary should only run in debug builds
// Memory leak detection
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
/** Flavor **/
// Proprietary modules
// Official YouTube Android Player API
extraImplementation files('libs/YouTubeAndroidPlayerApi.jar')
extraImplementation 'com.google.android.gms:play-services-cast-framework:20.0.0'
extraImplementation 'com.sothree.slidinguppanel:library:3.4.0'
extraImplementation 'com.github.rahatarmanahmed:circularprogressview:2.5.0'
/** Testing **/
// Required for local unit tests (JUnit 5 framework)
def junitVersion = '5.7.2'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}