blob: f2b1772d4354033e99b5c66c519021cf64b48029 [file] [log] [blame]
Mads Ager418d1ca2017-05-22 09:35:49 +02001# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
2# for details. All rights reserved. Use of this source code is governed by a
3# BSD-style license that can be found in the LICENSE file.
4
5import glob
6import os
7import utils
8
Yohann Roussel49e54a12017-06-23 18:08:07 +02009ANDROID_L_API = '21'
Rico Wind6238f222018-10-03 10:36:10 +020010BASE = os.path.join(utils.THIRD_PARTY, 'youtube')
Mads Ager418d1ca2017-05-22 09:35:49 +020011
Mads Ager418d1ca2017-05-22 09:35:49 +020012V12_10_BASE = os.path.join(BASE, 'youtube.android_12.10')
13V12_10_PREFIX = os.path.join(V12_10_BASE, 'YouTubeRelease')
14
15V12_17_BASE = os.path.join(BASE, 'youtube.android_12.17')
16V12_17_PREFIX = os.path.join(V12_17_BASE, 'YouTubeRelease')
17
Søren Gjessecc33fb42017-06-09 10:25:08 +020018V12_22_BASE = os.path.join(BASE, 'youtube.android_12.22')
19V12_22_PREFIX = os.path.join(V12_22_BASE, 'YouTubeRelease')
20
Søren Gjessefe2de552018-09-24 16:31:10 +020021V13_37_BASE = os.path.join(BASE, 'youtube.android_13.37')
22V13_37_PREFIX = os.path.join(V13_37_BASE, 'YouTubeRelease')
23
Mads Ager418d1ca2017-05-22 09:35:49 +020024# NOTE: we always use android.jar for SDK v25, later we might want to revise it
25# to use proper android.jar version for each of youtube version separately.
Rico Wind6238f222018-10-03 10:36:10 +020026ANDROID_JAR = utils.get_android_jar(25)
Mads Ager418d1ca2017-05-22 09:35:49 +020027
28VERSIONS = {
Mads Ager418d1ca2017-05-22 09:35:49 +020029 '12.10': {
30 'dex' : {
31 'inputs': [os.path.join(V12_10_BASE, 'YouTubeRelease_unsigned.apk')],
32 'pgmap': '%s_proguard.map' % V12_10_PREFIX,
33 'libraries' : [ANDROID_JAR],
Ian Zerny877c1862017-07-06 11:12:26 +020034 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020035 },
36 'deploy' : {
37 'inputs': ['%s_deploy.jar' % V12_10_PREFIX],
38 'pgconf': ['%s_proguard.config' % V12_10_PREFIX,
Rico Wind6238f222018-10-03 10:36:10 +020039 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY],
Ian Zerny877c1862017-07-06 11:12:26 +020040 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020041 }
Christoffer Quist Adamsenec896b62018-09-28 11:33:10 +020042 # The 'proguarded' version cannot be handled by D8/R8 because there are
43 # parameter annotations for parameters that do not exist, which is not
44 # handled gracefully by ASM (see b/116089492).
45 #'proguarded' : {
46 # 'inputs': ['%s_proguard.jar' % V12_10_PREFIX],
47 # 'pgmap': '%s_proguard.map' % V12_10_PREFIX,
48 # 'min-api' : ANDROID_L_API,
49 #}
Mads Ager418d1ca2017-05-22 09:35:49 +020050 },
51 '12.17': {
52 'dex' : {
53 'inputs': [os.path.join(V12_17_BASE, 'YouTubeRelease_unsigned.apk')],
54 'pgmap': '%s_proguard.map' % V12_17_PREFIX,
55 'libraries' : [ANDROID_JAR],
Ian Zerny877c1862017-07-06 11:12:26 +020056 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020057 },
58 'deploy' : {
59 'inputs': ['%s_deploy.jar' % V12_17_PREFIX],
60 'pgconf': ['%s_proguard.config' % V12_17_PREFIX,
Rico Wind6238f222018-10-03 10:36:10 +020061 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY],
Ian Zerny877c1862017-07-06 11:12:26 +020062 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020063 },
64 'proguarded' : {
65 'inputs': ['%s_proguard.jar' % V12_17_PREFIX],
Yohann Roussel49e54a12017-06-23 18:08:07 +020066 'pgmap': '%s_proguard.map' % V12_17_PREFIX,
Ian Zerny877c1862017-07-06 11:12:26 +020067 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020068 }
69 },
Søren Gjessecc33fb42017-06-09 10:25:08 +020070 '12.22': {
71 'dex' : {
72 'inputs': [os.path.join(V12_22_BASE, 'YouTubeRelease_unsigned.apk')],
73 'pgmap': '%s_proguard.map' % V12_22_PREFIX,
74 'libraries' : [ANDROID_JAR],
Ian Zerny877c1862017-07-06 11:12:26 +020075 'min-api' : ANDROID_L_API,
Søren Gjessecc33fb42017-06-09 10:25:08 +020076 },
77 'deploy' : {
78 'inputs': ['%s_deploy.jar' % V12_22_PREFIX],
Søren Gjessef1bc41e2017-06-19 16:33:16 +020079 'pgconf': [
80 '%s_proguard.config' % V12_22_PREFIX,
Rico Wind6238f222018-10-03 10:36:10 +020081 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY],
Søren Gjessec801ecc2017-08-03 13:40:06 +020082 'maindexrules' : [
Søren Gjessef1bc41e2017-06-19 16:33:16 +020083 os.path.join(V12_22_BASE, 'mainDexClasses.rules'),
84 os.path.join(V12_22_BASE, 'main-dex-classes-release.cfg'),
85 os.path.join(V12_22_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
Søren Gjessecc33fb42017-06-09 10:25:08 +020086 },
87 'proguarded' : {
88 'inputs': ['%s_proguard.jar' % V12_22_PREFIX],
Yohann Roussel49e54a12017-06-23 18:08:07 +020089 'pgmap': '%s_proguard.map' % V12_22_PREFIX,
Ian Zerny877c1862017-07-06 11:12:26 +020090 'min-api' : ANDROID_L_API,
Søren Gjessecc33fb42017-06-09 10:25:08 +020091 }
92 },
Søren Gjessefe2de552018-09-24 16:31:10 +020093 '13.37': {
94 'dex' : {
95 'inputs': [os.path.join(V13_37_BASE, 'YouTubeRelease_unsigned.apk')],
96 'pgmap': '%s_proguard.map' % V13_37_PREFIX,
97 'libraries' : [ANDROID_JAR],
98 'min-api' : ANDROID_L_API,
99 },
100 'deploy' : {
101 'inputs': ['%s_deploy.jar' % V13_37_PREFIX],
102 'pgconf': [
103 '%s_proguard.config' % V13_37_PREFIX,
Rico Wind6238f222018-10-03 10:36:10 +0200104 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY],
Søren Gjessefe2de552018-09-24 16:31:10 +0200105 # Build for native multi dex, as Currently R8 cannot meet the main-dex
106 # constraints.
107 #'maindexrules' : [
108 # os.path.join(V13_37_BASE, 'mainDexClasses.rules'),
109 # os.path.join(V13_37_BASE, 'main-dex-classes-release-optimized.cfg'),
110 # os.path.join(V13_37_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
111 'min-api' : ANDROID_L_API,
112 },
113 'proguarded' : {
114 'inputs': ['%s_proguard.jar' % V13_37_PREFIX],
115 'pgmap': '%s_proguard.map' % V13_37_PREFIX,
116 'min-api' : ANDROID_L_API,
117 }
118 },
Mads Ager418d1ca2017-05-22 09:35:49 +0200119}