blob: 8e1349bd95a2abed5c5fb78415695a260feb14ad [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
Mads Ager418d1ca2017-05-22 09:35:49 +02005import os
6import utils
7
Christoffer Quist Adamsenae60e662019-11-08 10:34:35 +01008ANDROID_H_MR2_API = '13'
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
Christoffer Quist Adamsend839c3f2020-08-20 10:12:34 +020012V15_33_BASE = os.path.join(BASE, 'youtube.android_15.33')
13V15_33_PREFIX = os.path.join(V15_33_BASE, 'YouTubeRelease')
14
Christoffer Quist Adamsene18f9202021-05-31 13:14:20 +020015V16_20_BASE = os.path.join(BASE, 'youtube.android_16.20')
16V16_20_PREFIX = os.path.join(V16_20_BASE, 'YouTubeRelease')
17
18LATEST_VERSION = '16.20'
Mads Ager418d1ca2017-05-22 09:35:49 +020019
20VERSIONS = {
Christoffer Quist Adamsend839c3f2020-08-20 10:12:34 +020021 '15.33': {
22 'dex' : {
23 'inputs': [os.path.join(V15_33_BASE, 'YouTubeRelease_unsigned.apk')],
24 'pgmap': '%s_proguard.map' % V15_33_PREFIX,
Christoffer Quist Adamsen4380de32021-04-23 06:24:31 +020025 'libraries' : [utils.get_android_jar(25)],
Christoffer Quist Adamsend839c3f2020-08-20 10:12:34 +020026 'min-api' : ANDROID_L_API,
27 },
28 'deploy' : {
29 # When -injars and -libraryjars are used for specifying inputs library
30 # sanitization is on by default. For this version of YouTube -injars and
31 # -libraryjars are not used, but library sanitization is still required.
32 'sanitize_libraries': True,
33 'inputs': ['%s_deploy.jar' % V15_33_PREFIX],
34 'libraries' : [os.path.join(V15_33_BASE, 'legacy_YouTubeRelease_combined_library_jars.jar')],
35 'pgconf': [
36 '%s_proguard.config' % V15_33_PREFIX,
37 '%s_proguard_missing_classes.config' % V15_33_PREFIX,
Christoffer Quist Adamsen1ca046c2021-02-21 11:25:16 +010038 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
39 utils.IGNORE_WARNINGS_RULES],
Christoffer Quist Adamsend839c3f2020-08-20 10:12:34 +020040 'maindexrules' : [
41 os.path.join(V15_33_BASE, 'mainDexClasses.rules'),
42 os.path.join(V15_33_BASE, 'main-dex-classes-release-optimized.pgcfg'),
43 os.path.join(V15_33_BASE, 'main_dex_YouTubeRelease_proguard.cfg')],
44 'min-api' : ANDROID_H_MR2_API,
45 },
46 'proguarded' : {
47 'inputs': ['%s_proguard.jar' % V15_33_PREFIX],
48 'pgmap': '%s_proguard.map' % V15_33_PREFIX,
49 'min-api' : ANDROID_L_API,
50 }
51 },
Christoffer Quist Adamsene18f9202021-05-31 13:14:20 +020052 '16.20': {
53 'deploy' : {
54 'sanitize_libraries': False,
55 'inputs': ['%s_deploy.jar' % V16_20_PREFIX],
56 'libraries' : [
57 os.path.join(
58 V16_20_BASE,
59 'legacy_YouTubeRelease_combined_library_jars_filtered.jar')],
60 'pgconf': [
61 '%s_proguard.config' % V16_20_PREFIX,
62 '%s/proguardsettings/YouTubeRelease_proguard.config' % utils.THIRD_PARTY,
63 utils.IGNORE_WARNINGS_RULES],
64 'min-api' : ANDROID_L_API,
65 'android_java8_libs': {
66 'config': '%s/desugar_jdk_libs/full_desugar_jdk_libs.json' % V16_20_BASE,
67 # Intentionally not adding desugar_jdk_libs_configuration.jar since it
68 # is part of jdk_libs_to_desugar.jar in YouTube 16.20.
69 'program': ['%s/desugar_jdk_libs/jdk_libs_to_desugar.jar' % V16_20_BASE],
70 'library': '%s/android_jar/lib-v30/android.jar' % utils.THIRD_PARTY,
71 'pgconf': [
72 '%s/desugar_jdk_libs/base.pgcfg' % V16_20_BASE,
73 '%s/desugar_jdk_libs/minify_desugar_jdk_libs.pgcfg' % V16_20_BASE
74 ]
75 }
76 },
77 'proguarded' : {
78 'inputs': ['%s_proguard.jar' % V16_20_PREFIX],
79 'pgmap': '%s_proguard.map' % V16_20_PREFIX,
80 'min-api' : ANDROID_L_API,
81 }
82 },
Mads Ager418d1ca2017-05-22 09:35:49 +020083}
Christoffer Quist Adamsen81d41502021-06-25 09:33:43 +020084
85def GetLatestVersion():
86 return LATEST_VERSION
87
88def GetName():
89 return 'youtube'
90
91def GetMemoryData(version):
92 assert version == '16.20'
93 return {
Morten Krogh-Jespersen1d5c4ea2021-08-26 08:11:18 +020094 'find-xmx-min': 3150,
Morten Krogh-Jespersend7f16202021-08-23 09:41:52 +020095 'find-xmx-max': 3300,
Christoffer Quist Adamsen81d41502021-06-25 09:33:43 +020096 'find-xmx-range': 64,
Morten Krogh-Jespersend7f16202021-08-23 09:41:52 +020097 'oom-threshold': 3100,
Christoffer Quist Adamsen81d41502021-06-25 09:33:43 +020098 # TODO(b/143431825): Youtube can OOM randomly in memory configurations
99 # that should work.
100 'skip-find-xmx-max': True,
101 }