Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 1 | # 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 | |
| 5 | import glob |
| 6 | import os |
| 7 | import utils |
| 8 | |
Yohann Roussel | 49e54a1 | 2017-06-23 18:08:07 +0200 | [diff] [blame] | 9 | ANDROID_L_API = '21' |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 10 | BASE = os.path.join(utils.THIRD_PARTY, 'youtube') |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 11 | |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 12 | V12_10_BASE = os.path.join(BASE, 'youtube.android_12.10') |
| 13 | V12_10_PREFIX = os.path.join(V12_10_BASE, 'YouTubeRelease') |
| 14 | |
| 15 | V12_17_BASE = os.path.join(BASE, 'youtube.android_12.17') |
| 16 | V12_17_PREFIX = os.path.join(V12_17_BASE, 'YouTubeRelease') |
| 17 | |
Søren Gjesse | cc33fb4 | 2017-06-09 10:25:08 +0200 | [diff] [blame] | 18 | V12_22_BASE = os.path.join(BASE, 'youtube.android_12.22') |
| 19 | V12_22_PREFIX = os.path.join(V12_22_BASE, 'YouTubeRelease') |
| 20 | |
Søren Gjesse | fe2de55 | 2018-09-24 16:31:10 +0200 | [diff] [blame] | 21 | V13_37_BASE = os.path.join(BASE, 'youtube.android_13.37') |
| 22 | V13_37_PREFIX = os.path.join(V13_37_BASE, 'YouTubeRelease') |
| 23 | |
Søren Gjesse | 4ae66b2 | 2019-05-10 02:15:24 +0200 | [diff] [blame] | 24 | V14_19_BASE = os.path.join(BASE, 'youtube.android_14.19') |
| 25 | V14_19_PREFIX = os.path.join(V14_19_BASE, 'YouTubeRelease') |
| 26 | |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 27 | # NOTE: we always use android.jar for SDK v25, later we might want to revise it |
| 28 | # to use proper android.jar version for each of youtube version separately. |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 29 | ANDROID_JAR = utils.get_android_jar(25) |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 30 | |
| 31 | VERSIONS = { |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 32 | '12.10': { |
| 33 | 'dex' : { |
| 34 | 'inputs': [os.path.join(V12_10_BASE, 'YouTubeRelease_unsigned.apk')], |
| 35 | 'pgmap': '%s_proguard.map' % V12_10_PREFIX, |
| 36 | 'libraries' : [ANDROID_JAR], |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 37 | 'min-api' : ANDROID_L_API, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 38 | }, |
| 39 | 'deploy' : { |
| 40 | 'inputs': ['%s_deploy.jar' % V12_10_PREFIX], |
| 41 | 'pgconf': ['%s_proguard.config' % V12_10_PREFIX, |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 42 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY], |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 43 | 'min-api' : ANDROID_L_API, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 44 | } |
Christoffer Quist Adamsen | ec896b6 | 2018-09-28 11:33:10 +0200 | [diff] [blame] | 45 | # The 'proguarded' version cannot be handled by D8/R8 because there are |
| 46 | # parameter annotations for parameters that do not exist, which is not |
| 47 | # handled gracefully by ASM (see b/116089492). |
| 48 | #'proguarded' : { |
| 49 | # 'inputs': ['%s_proguard.jar' % V12_10_PREFIX], |
| 50 | # 'pgmap': '%s_proguard.map' % V12_10_PREFIX, |
| 51 | # 'min-api' : ANDROID_L_API, |
| 52 | #} |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 53 | }, |
| 54 | '12.17': { |
| 55 | 'dex' : { |
| 56 | 'inputs': [os.path.join(V12_17_BASE, 'YouTubeRelease_unsigned.apk')], |
| 57 | 'pgmap': '%s_proguard.map' % V12_17_PREFIX, |
| 58 | 'libraries' : [ANDROID_JAR], |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 59 | 'min-api' : ANDROID_L_API, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 60 | }, |
| 61 | 'deploy' : { |
| 62 | 'inputs': ['%s_deploy.jar' % V12_17_PREFIX], |
| 63 | 'pgconf': ['%s_proguard.config' % V12_17_PREFIX, |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 64 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY], |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 65 | 'min-api' : ANDROID_L_API, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 66 | }, |
| 67 | 'proguarded' : { |
| 68 | 'inputs': ['%s_proguard.jar' % V12_17_PREFIX], |
Yohann Roussel | 49e54a1 | 2017-06-23 18:08:07 +0200 | [diff] [blame] | 69 | 'pgmap': '%s_proguard.map' % V12_17_PREFIX, |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 70 | 'min-api' : ANDROID_L_API, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 71 | } |
| 72 | }, |
Søren Gjesse | cc33fb4 | 2017-06-09 10:25:08 +0200 | [diff] [blame] | 73 | '12.22': { |
| 74 | 'dex' : { |
| 75 | 'inputs': [os.path.join(V12_22_BASE, 'YouTubeRelease_unsigned.apk')], |
| 76 | 'pgmap': '%s_proguard.map' % V12_22_PREFIX, |
| 77 | 'libraries' : [ANDROID_JAR], |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 78 | 'min-api' : ANDROID_L_API, |
Søren Gjesse | cc33fb4 | 2017-06-09 10:25:08 +0200 | [diff] [blame] | 79 | }, |
| 80 | 'deploy' : { |
| 81 | 'inputs': ['%s_deploy.jar' % V12_22_PREFIX], |
Søren Gjesse | f1bc41e | 2017-06-19 16:33:16 +0200 | [diff] [blame] | 82 | 'pgconf': [ |
| 83 | '%s_proguard.config' % V12_22_PREFIX, |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 84 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY], |
Søren Gjesse | c801ecc | 2017-08-03 13:40:06 +0200 | [diff] [blame] | 85 | 'maindexrules' : [ |
Søren Gjesse | f1bc41e | 2017-06-19 16:33:16 +0200 | [diff] [blame] | 86 | os.path.join(V12_22_BASE, 'mainDexClasses.rules'), |
| 87 | os.path.join(V12_22_BASE, 'main-dex-classes-release.cfg'), |
| 88 | os.path.join(V12_22_BASE, 'main_dex_YouTubeRelease_proguard.cfg')], |
Søren Gjesse | cc33fb4 | 2017-06-09 10:25:08 +0200 | [diff] [blame] | 89 | }, |
| 90 | 'proguarded' : { |
| 91 | 'inputs': ['%s_proguard.jar' % V12_22_PREFIX], |
Yohann Roussel | 49e54a1 | 2017-06-23 18:08:07 +0200 | [diff] [blame] | 92 | 'pgmap': '%s_proguard.map' % V12_22_PREFIX, |
Ian Zerny | 877c186 | 2017-07-06 11:12:26 +0200 | [diff] [blame] | 93 | 'min-api' : ANDROID_L_API, |
Søren Gjesse | cc33fb4 | 2017-06-09 10:25:08 +0200 | [diff] [blame] | 94 | } |
| 95 | }, |
Søren Gjesse | fe2de55 | 2018-09-24 16:31:10 +0200 | [diff] [blame] | 96 | '13.37': { |
| 97 | 'dex' : { |
| 98 | 'inputs': [os.path.join(V13_37_BASE, 'YouTubeRelease_unsigned.apk')], |
| 99 | 'pgmap': '%s_proguard.map' % V13_37_PREFIX, |
| 100 | 'libraries' : [ANDROID_JAR], |
| 101 | 'min-api' : ANDROID_L_API, |
| 102 | }, |
| 103 | 'deploy' : { |
| 104 | 'inputs': ['%s_deploy.jar' % V13_37_PREFIX], |
| 105 | 'pgconf': [ |
| 106 | '%s_proguard.config' % V13_37_PREFIX, |
Rico Wind | 6238f22 | 2018-10-03 10:36:10 +0200 | [diff] [blame] | 107 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY], |
Søren Gjesse | fe2de55 | 2018-09-24 16:31:10 +0200 | [diff] [blame] | 108 | # Build for native multi dex, as Currently R8 cannot meet the main-dex |
| 109 | # constraints. |
| 110 | #'maindexrules' : [ |
| 111 | # os.path.join(V13_37_BASE, 'mainDexClasses.rules'), |
| 112 | # os.path.join(V13_37_BASE, 'main-dex-classes-release-optimized.cfg'), |
| 113 | # os.path.join(V13_37_BASE, 'main_dex_YouTubeRelease_proguard.cfg')], |
| 114 | 'min-api' : ANDROID_L_API, |
| 115 | }, |
| 116 | 'proguarded' : { |
| 117 | 'inputs': ['%s_proguard.jar' % V13_37_PREFIX], |
| 118 | 'pgmap': '%s_proguard.map' % V13_37_PREFIX, |
| 119 | 'min-api' : ANDROID_L_API, |
| 120 | } |
| 121 | }, |
Søren Gjesse | 4ae66b2 | 2019-05-10 02:15:24 +0200 | [diff] [blame] | 122 | '14.19': { |
| 123 | 'dex' : { |
| 124 | 'inputs': [os.path.join(V14_19_BASE, 'YouTubeRelease_unsigned.apk')], |
| 125 | 'pgmap': '%s_proguard.map' % V14_19_PREFIX, |
| 126 | 'libraries' : [ANDROID_JAR], |
| 127 | 'min-api' : ANDROID_L_API, |
| 128 | }, |
| 129 | 'deploy' : { |
| 130 | 'inputs': ['%s_deploy.jar' % V14_19_PREFIX], |
| 131 | 'pgconf': [ |
| 132 | '%s_proguard.config' % V14_19_PREFIX, |
| 133 | '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY], |
Christoffer Quist Adamsen | 955fa63 | 2019-06-03 14:55:49 +0200 | [diff] [blame] | 134 | 'proto-shrinking': 1, |
Søren Gjesse | 4ae66b2 | 2019-05-10 02:15:24 +0200 | [diff] [blame] | 135 | # Build for native multi dex, as Currently R8 cannot meet the main-dex |
| 136 | # constraints. |
| 137 | #'maindexrules' : [ |
| 138 | # os.path.join(V14_19_BASE, 'mainDexClasses.rules'), |
| 139 | # os.path.join(V14_19_BASE, 'main-dex-classes-release-optimized.cfg'), |
| 140 | # os.path.join(V14_19_BASE, 'main_dex_YouTubeRelease_proguard.cfg')], |
| 141 | 'min-api' : ANDROID_L_API, |
| 142 | }, |
| 143 | 'proguarded' : { |
| 144 | 'inputs': ['%s_proguard.jar' % V14_19_PREFIX], |
| 145 | 'pgmap': '%s_proguard.map' % V14_19_PREFIX, |
| 146 | 'min-api' : ANDROID_L_API, |
| 147 | } |
| 148 | }, |
Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame] | 149 | } |