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 | |
| 9 | THIRD_PARTY = os.path.join(utils.REPO_ROOT, 'third_party') |
| 10 | BASE = os.path.join(THIRD_PARTY, 'gmscore') |
| 11 | |
| 12 | V4_BASE = os.path.join(BASE, 'v4') |
| 13 | V5_BASE = os.path.join(BASE, 'v5') |
| 14 | V6_BASE = os.path.join(BASE, 'v6') |
| 15 | V7_BASE = os.path.join(BASE, 'v7') |
| 16 | V8_BASE = os.path.join(BASE, 'v8') |
| 17 | |
| 18 | V9_BASE = os.path.join(BASE, 'gmscore_v9') |
| 19 | V9_PREFIX = os.path.join(V9_BASE, 'GmsCore_prod_alldpi_release_all_locales') |
| 20 | |
| 21 | V10_BASE = os.path.join(BASE, 'gmscore_v10') |
| 22 | V10_PREFIX = os.path.join(V10_BASE, 'GmsCore_prod_alldpi_release_all_locales') |
| 23 | |
| 24 | # 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 gmscore version separately. |
| 26 | ANDROID_JAR = os.path.join(THIRD_PARTY, 'android_jar', 'lib-v25', 'android.jar') |
| 27 | |
| 28 | VERSIONS = { |
| 29 | 'v4': { |
| 30 | 'dex' : { |
| 31 | 'inputs' : glob.glob(os.path.join(V4_BASE, '*.dex')), |
| 32 | 'pgmap' : os.path.join(V4_BASE, 'proguard.map'), |
| 33 | 'libraries' : [ANDROID_JAR], |
| 34 | 'r8-flags': '--ignore-missing-classes', |
| 35 | } |
| 36 | }, |
| 37 | 'v5': { |
| 38 | 'dex' : { |
| 39 | 'inputs' : glob.glob(os.path.join(V5_BASE, '*.dex')), |
| 40 | 'pgmap' : os.path.join(V5_BASE, 'proguard.map'), |
| 41 | 'libraries' : [ANDROID_JAR], |
| 42 | 'r8-flags': '--ignore-missing-classes', |
| 43 | } |
| 44 | }, |
| 45 | 'v6': { |
| 46 | 'dex' : { |
| 47 | 'inputs' : glob.glob(os.path.join(V6_BASE, '*.dex')), |
| 48 | 'pgmap' : os.path.join(V6_BASE, 'proguard.map'), |
| 49 | 'libraries' : [ANDROID_JAR], |
| 50 | 'r8-flags': '--ignore-missing-classes', |
| 51 | } |
| 52 | }, |
| 53 | 'v7': { |
| 54 | 'dex' : { |
| 55 | 'inputs' : glob.glob(os.path.join(V7_BASE, '*.dex')), |
| 56 | 'pgmap' : os.path.join(V7_BASE, 'proguard.map'), |
| 57 | 'libraries' : [ANDROID_JAR], |
| 58 | 'r8-flags': '--ignore-missing-classes', |
| 59 | } |
| 60 | }, |
| 61 | 'v8': { |
| 62 | 'dex' : { |
| 63 | 'inputs' : glob.glob(os.path.join(V8_BASE, '*.dex')), |
| 64 | 'pgmap' : os.path.join(V8_BASE, 'proguard.map'), |
| 65 | 'libraries' : [ANDROID_JAR], |
| 66 | 'r8-flags': '--ignore-missing-classes', |
| 67 | } |
| 68 | }, |
| 69 | 'v9': { |
| 70 | 'dex' : { |
| 71 | 'inputs': [os.path.join(V9_BASE, 'armv7_GmsCore_prod_alldpi_release.apk')], |
| 72 | 'pgmap': '%s_proguard.map' % V9_PREFIX, |
| 73 | 'libraries' : [ANDROID_JAR], |
| 74 | 'r8-flags': '--ignore-missing-classes', |
| 75 | }, |
| 76 | 'deploy' : { |
| 77 | 'pgconf': ['%s_proguard.config' % V9_PREFIX], |
| 78 | 'inputs': ['%s_deploy.jar' % V9_PREFIX] |
| 79 | }, |
| 80 | 'proguarded' : { |
| 81 | 'inputs': ['%s_proguard.jar' % V9_PREFIX], |
| 82 | 'pgmap': '%s_proguard.map' % V9_PREFIX |
| 83 | } |
| 84 | }, |
| 85 | 'v10': { |
| 86 | 'dex' : { |
| 87 | 'inputs': [os.path.join(V10_BASE, 'armv7_GmsCore_prod_alldpi_release.apk')], |
| 88 | 'pgmap': '%s_proguard.map' % V10_PREFIX, |
| 89 | 'libraries' : [ANDROID_JAR], |
| 90 | 'r8-flags': '--ignore-missing-classes', |
| 91 | }, |
| 92 | 'deploy' : { |
| 93 | 'inputs': ['%s_deploy.jar' % V10_PREFIX], |
| 94 | 'pgconf': ['%s_proguard.config' % V10_PREFIX], |
| 95 | }, |
| 96 | 'proguarded' : { |
| 97 | 'inputs': ['%s_proguard.jar' % V10_PREFIX], |
| 98 | 'pgmap': '%s_proguard.map' % V10_PREFIX |
| 99 | } |
| 100 | }, |
| 101 | } |