blob: 2e3be2761f1682b6d9ea12acad537ab730ec09f4 [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
9THIRD_PARTY = os.path.join(utils.REPO_ROOT, 'third_party')
Yohann Roussel49e54a12017-06-23 18:08:07 +020010ANDROID_L_API = '21'
Mads Ager418d1ca2017-05-22 09:35:49 +020011BASE = os.path.join(THIRD_PARTY, 'youtube')
12
Mads Ager418d1ca2017-05-22 09:35:49 +020013V12_10_BASE = os.path.join(BASE, 'youtube.android_12.10')
14V12_10_PREFIX = os.path.join(V12_10_BASE, 'YouTubeRelease')
15
16V12_17_BASE = os.path.join(BASE, 'youtube.android_12.17')
17V12_17_PREFIX = os.path.join(V12_17_BASE, 'YouTubeRelease')
18
Søren Gjessecc33fb42017-06-09 10:25:08 +020019V12_22_BASE = os.path.join(BASE, 'youtube.android_12.22')
20V12_22_PREFIX = os.path.join(V12_22_BASE, 'YouTubeRelease')
21
Søren Gjessefe2de552018-09-24 16:31:10 +020022V13_37_BASE = os.path.join(BASE, 'youtube.android_13.37')
23V13_37_PREFIX = os.path.join(V13_37_BASE, 'YouTubeRelease')
24
Mads Ager418d1ca2017-05-22 09:35:49 +020025# NOTE: we always use android.jar for SDK v25, later we might want to revise it
26# to use proper android.jar version for each of youtube version separately.
27ANDROID_JAR = os.path.join(THIRD_PARTY, 'android_jar', 'lib-v25', 'android.jar')
28
29VERSIONS = {
Mads Ager418d1ca2017-05-22 09:35:49 +020030 '12.10': {
31 'dex' : {
32 'inputs': [os.path.join(V12_10_BASE, 'YouTubeRelease_unsigned.apk')],
33 'pgmap': '%s_proguard.map' % V12_10_PREFIX,
34 'libraries' : [ANDROID_JAR],
Ian Zerny877c1862017-07-06 11:12:26 +020035 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020036 },
37 'deploy' : {
38 'inputs': ['%s_deploy.jar' % V12_10_PREFIX],
39 'pgconf': ['%s_proguard.config' % V12_10_PREFIX,
40 '%s/proguardsettings/YouTubeRelease_proguard.config' % THIRD_PARTY],
Ian Zerny877c1862017-07-06 11:12:26 +020041 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020042 }
Christoffer Quist Adamsenec896b62018-09-28 11:33:10 +020043 # The 'proguarded' version cannot be handled by D8/R8 because there are
44 # parameter annotations for parameters that do not exist, which is not
45 # handled gracefully by ASM (see b/116089492).
46 #'proguarded' : {
47 # 'inputs': ['%s_proguard.jar' % V12_10_PREFIX],
48 # 'pgmap': '%s_proguard.map' % V12_10_PREFIX,
49 # 'min-api' : ANDROID_L_API,
50 #}
Mads Ager418d1ca2017-05-22 09:35:49 +020051 },
52 '12.17': {
53 'dex' : {
54 'inputs': [os.path.join(V12_17_BASE, 'YouTubeRelease_unsigned.apk')],
55 'pgmap': '%s_proguard.map' % V12_17_PREFIX,
56 'libraries' : [ANDROID_JAR],
Ian Zerny877c1862017-07-06 11:12:26 +020057 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020058 },
59 'deploy' : {
60 'inputs': ['%s_deploy.jar' % V12_17_PREFIX],
61 'pgconf': ['%s_proguard.config' % V12_17_PREFIX,
62 '%s/proguardsettings/YouTubeRelease_proguard.config' % THIRD_PARTY],
Ian Zerny877c1862017-07-06 11:12:26 +020063 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020064 },
65 'proguarded' : {
66 'inputs': ['%s_proguard.jar' % V12_17_PREFIX],
Yohann Roussel49e54a12017-06-23 18:08:07 +020067 'pgmap': '%s_proguard.map' % V12_17_PREFIX,
Ian Zerny877c1862017-07-06 11:12:26 +020068 'min-api' : ANDROID_L_API,
Mads Ager418d1ca2017-05-22 09:35:49 +020069 }
70 },
Søren Gjessecc33fb42017-06-09 10:25:08 +020071 '12.22': {
72 'dex' : {
73 'inputs': [os.path.join(V12_22_BASE, 'YouTubeRelease_unsigned.apk')],
74 'pgmap': '%s_proguard.map' % V12_22_PREFIX,
75 'libraries' : [ANDROID_JAR],
Ian Zerny877c1862017-07-06 11:12:26 +020076 'min-api' : ANDROID_L_API,
Søren Gjessecc33fb42017-06-09 10:25:08 +020077 },
78 'deploy' : {
79 'inputs': ['%s_deploy.jar' % V12_22_PREFIX],
Søren Gjessef1bc41e2017-06-19 16:33:16 +020080 'pgconf': [
81 '%s_proguard.config' % V12_22_PREFIX,
82 '%s/proguardsettings/YouTubeRelease_proguard.config' % THIRD_PARTY],
Søren Gjessec801ecc2017-08-03 13:40:06 +020083 'maindexrules' : [
Søren Gjessef1bc41e2017-06-19 16:33:16 +020084 os.path.join(V12_22_BASE, 'mainDexClasses.rules'),
85 os.path.join(V12_22_BASE, 'main-dex-classes-release.cfg'),
86 os.path.join(V12_22_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
Søren Gjessecc33fb42017-06-09 10:25:08 +020087 },
88 'proguarded' : {
89 'inputs': ['%s_proguard.jar' % V12_22_PREFIX],
Yohann Roussel49e54a12017-06-23 18:08:07 +020090 'pgmap': '%s_proguard.map' % V12_22_PREFIX,
Ian Zerny877c1862017-07-06 11:12:26 +020091 'min-api' : ANDROID_L_API,
Søren Gjessecc33fb42017-06-09 10:25:08 +020092 }
93 },
Søren Gjessefe2de552018-09-24 16:31:10 +020094 '13.37': {
95 'dex' : {
96 'inputs': [os.path.join(V13_37_BASE, 'YouTubeRelease_unsigned.apk')],
97 'pgmap': '%s_proguard.map' % V13_37_PREFIX,
98 'libraries' : [ANDROID_JAR],
99 'min-api' : ANDROID_L_API,
100 },
101 'deploy' : {
102 'inputs': ['%s_deploy.jar' % V13_37_PREFIX],
103 'pgconf': [
104 '%s_proguard.config' % V13_37_PREFIX,
105 '%s/proguardsettings/YouTubeRelease_proguard.config' % THIRD_PARTY],
106 # Build for native multi dex, as Currently R8 cannot meet the main-dex
107 # constraints.
108 #'maindexrules' : [
109 # os.path.join(V13_37_BASE, 'mainDexClasses.rules'),
110 # os.path.join(V13_37_BASE, 'main-dex-classes-release-optimized.cfg'),
111 # os.path.join(V13_37_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
112 'min-api' : ANDROID_L_API,
113 },
114 'proguarded' : {
115 'inputs': ['%s_proguard.jar' % V13_37_PREFIX],
116 'pgmap': '%s_proguard.map' % V13_37_PREFIX,
117 'min-api' : ANDROID_L_API,
118 }
119 },
Mads Ager418d1ca2017-05-22 09:35:49 +0200120}