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 5import glob 6import os 7import utils 8 9THIRD_PARTY = os.path.join(utils.REPO_ROOT, 'third_party') 10BASE = os.path.join(THIRD_PARTY, 'gmscore') 11 12V4_BASE = os.path.join(BASE, 'v4') 13V5_BASE = os.path.join(BASE, 'v5') 14V6_BASE = os.path.join(BASE, 'v6') 15V7_BASE = os.path.join(BASE, 'v7') 16V8_BASE = os.path.join(BASE, 'v8') 17 18V9_BASE = os.path.join(BASE, 'gmscore_v9') 19V9_PREFIX = os.path.join(V9_BASE, 'GmsCore_prod_alldpi_release_all_locales') 20 21V10_BASE = os.path.join(BASE, 'gmscore_v10') 22V10_PREFIX = os.path.join(V10_BASE, 'GmsCore_prod_alldpi_release_all_locales') 23 24LATEST_BASE = os.path.join(BASE, 'latest') 25LATEST_PREFIX = os.path.join(LATEST_BASE, 'GmsCore_prod_alldpi_release_all_locales') 26ANDROID_L_API = '21' 27 28# NOTE: we always use android.jar for SDK v25, later we might want to revise it 29# to use proper android.jar version for each of gmscore version separately. 30ANDROID_JAR = os.path.join(THIRD_PARTY, 'android_jar', 'lib-v25', 'android.jar') 31 32VERSIONS = { 33 'v4': { 34 'dex' : { 35 'inputs' : glob.glob(os.path.join(V4_BASE, '*.dex')), 36 'pgmap' : os.path.join(V4_BASE, 'proguard.map'), 37 'libraries' : [ANDROID_JAR], 38 'r8-flags': '--ignore-missing-classes', 39 'min-api' : ANDROID_L_API, 40 } 41 }, 42 'v5': { 43 'dex' : { 44 'inputs' : glob.glob(os.path.join(V5_BASE, '*.dex')), 45 'pgmap' : os.path.join(V5_BASE, 'proguard.map'), 46 'libraries' : [ANDROID_JAR], 47 'r8-flags': '--ignore-missing-classes', 48 'min-api' : ANDROID_L_API, 49 } 50 }, 51 'v6': { 52 'dex' : { 53 'inputs' : glob.glob(os.path.join(V6_BASE, '*.dex')), 54 'pgmap' : os.path.join(V6_BASE, 'proguard.map'), 55 'libraries' : [ANDROID_JAR], 56 'r8-flags': '--ignore-missing-classes', 57 'min-api' : ANDROID_L_API, 58 } 59 }, 60 'v7': { 61 'dex' : { 62 'inputs' : glob.glob(os.path.join(V7_BASE, '*.dex')), 63 'pgmap' : os.path.join(V7_BASE, 'proguard.map'), 64 'libraries' : [ANDROID_JAR], 65 'r8-flags': '--ignore-missing-classes', 66 'min-api' : ANDROID_L_API, 67 } 68 }, 69 'v8': { 70 'dex' : { 71 'inputs' : glob.glob(os.path.join(V8_BASE, '*.dex')), 72 'pgmap' : os.path.join(V8_BASE, 'proguard.map'), 73 'libraries' : [ANDROID_JAR], 74 'r8-flags': '--ignore-missing-classes', 75 'min-api' : ANDROID_L_API, 76 } 77 }, 78 'v9': { 79 'dex' : { 80 'inputs': [os.path.join(V9_BASE, 'armv7_GmsCore_prod_alldpi_release.apk')], 81 'pgmap': '%s_proguard.map' % V9_PREFIX, 82 'libraries' : [ANDROID_JAR], 83 'r8-flags': '--ignore-missing-classes', 84 'min-api' : ANDROID_L_API, 85 }, 86 'deploy' : { 87 'pgconf': ['%s_proguard.config' % V9_PREFIX], 88 'inputs': ['%s_deploy.jar' % V9_PREFIX], 89 'min-api' : ANDROID_L_API, 90 }, 91 'proguarded' : { 92 'inputs': ['%s_proguard.jar' % V9_PREFIX], 93 'pgmap': '%s_proguard.map' % V9_PREFIX, 94 'min-api' : ANDROID_L_API, 95 } 96 }, 97 'v10': { 98 'dex' : { 99 'inputs': [os.path.join(V10_BASE, 'armv7_GmsCore_prod_alldpi_release.apk')], 100 'pgmap': '%s_proguard.map' % V10_PREFIX, 101 'libraries' : [ANDROID_JAR], 102 'r8-flags': '--ignore-missing-classes', 103 'min-api' : ANDROID_L_API, 104 }, 105 'deploy' : { 106 'inputs': ['%s_deploy.jar' % V10_PREFIX], 107 'pgconf': ['%s_proguard.config' % V10_PREFIX], 108 'min-api' : ANDROID_L_API, 109 }, 110 'proguarded' : { 111 'inputs': ['%s_proguard.jar' % V10_PREFIX], 112 'pgmap': '%s_proguard.map' % V10_PREFIX, 113 'min-api' : ANDROID_L_API, 114 } 115 }, 116 'latest': { 117 'deploy' : { 118 'inputs': ['%s_deploy.jar' % LATEST_PREFIX], 119 'pgconf': [ 120 '%s_proguard.config' % LATEST_PREFIX, 121 '%s/proguardsettings/GmsCore_proguard.config' % THIRD_PARTY], 122 'min-api' : ANDROID_L_API, 123 }, 124 }, 125} 126