コード例 #1
0
    def build_gms_core_or_use_prebuilt(self):
        if OPTIONS.enable_art_aot():
            # Rule for pre-optimizing gms-core apk.
            boot_image_dir = os.path.join(build_common.get_android_fs_root(),
                                          'system/framework',
                                          build_common.get_art_isa())
            self.rule(
                'gms_core_apk_preoptimize',
                'src/build/gms_core_apk_preoptimize.py --input $in --output $out',
                description='Preoptimizing gmscore sub apks contained in $in')
            self.build(GmsCoreNinjaGenerator._APK_PATH,
                       'gms_core_apk_preoptimize',
                       GmsCoreNinjaGenerator._ORIGINAL_APK_PATH,
                       implicit=[
                           toolchain.get_tool('java', 'dex2oat'),
                           os.path.join(boot_image_dir, 'boot.art'),
                           os.path.join(boot_image_dir, 'boot.oat')
                       ])

        if not OPTIONS.internal_apks_source_is_internal():
            return

        flags = '--eng' if OPTIONS.is_debug_code_enabled() else ''
        build_log = os.path.join('out/gms-core-build/build.log')
        command = ('internal/build/build.py gms-core %s > %s 2>&1 || '
                   '(cat %s; exit 1)') % (flags, build_log, build_log)

        if OPTIONS.internal_apks_source() == 'internal-dev':
            # Only for local development.  play-services.apk dependes on jars below to
            # build, just to use ARC specific feature like ArcMessageBridge and
            # Tracing.  This dependency is a must-have for a clean build.  But this
            # dependency can cause unrelated framework change to trigger rebuild of
            # play-services.apk, which is very slow.  With this option, eng will self
            # manages the dependency, which is almost always satisfied.
            jars = []
        else:
            # Simply make these jars the dependencies of gms-core-build, which
            # references ArcMessage and ArcMessageBridge in the jar.  Note that these
            # jars changes often and is like to cause unnecessary rebuild of gms-core,
            # which is very slow.  We may think about a way to minimize the
            # dependency.
            #
            # See also: internal/mods/gms-core/vendor/unbundled_google/packages/ \
            #     OneUp/package/Android.mk
            #     OneUp/package/generate_package.mk
            jars = [
                build_common.get_build_path_for_jar('arc-services-framework',
                                                    subpath='classes.jar'),
                build_common.get_build_path_for_jar('framework',
                                                    subpath='classes.jar'),
            ]

        self.build(GmsCoreNinjaGenerator._ALL_OUTPUTS,
                   'run_shell_command',
                   implicit=['src/build/DEPS.arc-int'] + jars,
                   variables={'command': command})
コード例 #2
0
  def build_gms_core_or_use_prebuilt(self):
    if OPTIONS.enable_art_aot():
      # Rule for pre-optimizing gms-core apk.
      boot_image_dir = os.path.join(build_common.get_android_fs_root(),
                                    'system/framework',
                                    build_common.get_art_isa())
      self.rule(
          'gms_core_apk_preoptimize',
          'src/build/gms_core_apk_preoptimize.py --input $in --output $out',
          description='Preoptimizing gmscore sub apks contained in $in')
      self.build(GmsCoreNinjaGenerator._APK_PATH,
                 'gms_core_apk_preoptimize',
                 GmsCoreNinjaGenerator._ORIGINAL_APK_PATH,
                 implicit=[toolchain.get_tool('java', 'dex2oat'),
                           os.path.join(boot_image_dir, 'boot.art'),
                           os.path.join(boot_image_dir, 'boot.oat')])

    if not OPTIONS.internal_apks_source_is_internal():
      return

    flags = '--eng' if OPTIONS.is_debug_code_enabled() else ''
    build_log = os.path.join('out/gms-core-build/build.log')
    command = ('internal/build/build.py gms-core %s > %s 2>&1 || '
               '(cat %s; exit 1)') % (flags, build_log, build_log)

    if OPTIONS.internal_apks_source() == 'internal-dev':
      # Only for local development.  play-services.apk dependes on jars below to
      # build, just to use ARC specific feature like ArcMessageBridge and
      # Tracing.  This dependency is a must-have for a clean build.  But this
      # dependency can cause unrelated framework change to trigger rebuild of
      # play-services.apk, which is very slow.  With this option, eng will self
      # manages the dependency, which is almost always satisfied.
      jars = []
    else:
      # Simply make these jars the dependencies of gms-core-build, which
      # references ArcMessage and ArcMessageBridge in the jar.  Note that these
      # jars changes often and is like to cause unnecessary rebuild of gms-core,
      # which is very slow.  We may think about a way to minimize the
      # dependency.
      #
      # See also: internal/mods/gms-core/vendor/unbundled_google/packages/ \
      #     OneUp/package/Android.mk
      #     OneUp/package/generate_package.mk
      jars = [
          build_common.get_build_path_for_jar('arc-services-framework',
                                              subpath='classes.jar'),
          build_common.get_build_path_for_jar('framework',
                                              subpath='classes.jar'),
      ]

    self.build(GmsCoreNinjaGenerator._ALL_OUTPUTS,
               'run_shell_command',
               implicit=['src/build/DEPS.arc-int'] + jars,
               variables={'command': command})
コード例 #3
0
ファイル: generate_build_prop.py プロジェクト: zhangpf/arc
    # available. The number is the major version number in the upper sixteen bits
    # followed by the minor version number in the lower sixteen bits.
    print 'ro.opengles.version=131072'

# Normally added upstream at android/build/core/main.mk. Services can restrict
# functionality based on this value (currently very few do).  Setting this
# value allows CtsOsTestCases:android.os.cts.BuildTest to pass.
secure = "0"
if build_common.get_build_type() == "user":
    secure = "1"
print 'ro.secure=' + secure

# The following three properties synchronize dex2oat's arguments at build time
# and runtime.
dex2oatFlags = build_common.get_dex2oat_target_dependent_flags_map()
print('dalvik.vm.isa.' + build_common.get_art_isa() + '.features=' +
      dex2oatFlags['instruction-set-features'])
print 'dalvik.vm.dex2oat-filter=' + dex2oatFlags['compiler-filter']
if 'no-include-debug-symbols' in dex2oatFlags:
    print 'dalvik.vm.dex2oat-flags=--no-include-debug-symbols'

# This property tells dex2oat to compile x86 code even though we say in the
# ABI_LIST above that we only support ARM.
if OPTIONS.is_i686():
    print 'ro.dalvik.vm.isa.arm=x86'
if OPTIONS.is_x86_64():
    print 'ro.dalvik.vm.isa.arm=x86_64'

# When AOT is not enabled, make sure dex2oat does not run.
if not OPTIONS.enable_art_aot():
    print 'ro.arc.dex2oat.disabled=1'
コード例 #4
0
ファイル: generate_build_prop.py プロジェクト: epowers/arc
  # available. The number is the major version number in the upper sixteen bits
  # followed by the minor version number in the lower sixteen bits.
  print 'ro.opengles.version=131072'

# Normally added upstream at android/build/core/main.mk. Services can restrict
# functionality based on this value (currently very few do).  Setting this
# value allows CtsOsTestCases:android.os.cts.BuildTest to pass.
secure = "0"
if build_common.get_build_type() == "user":
  secure = "1"
print 'ro.secure=' + secure

# The following three properties synchronize dex2oat's arguments at build time
# and runtime.
dex2oatFlags = build_common.get_dex2oat_target_dependent_flags_map()
print ('dalvik.vm.isa.' + build_common.get_art_isa() + '.features=' +
       dex2oatFlags['instruction-set-features'])
print 'dalvik.vm.dex2oat-filter=' + dex2oatFlags['compiler-filter']
if 'no-include-debug-symbols' in dex2oatFlags:
  print 'dalvik.vm.dex2oat-flags=--no-include-debug-symbols'

# This property tells dex2oat to compile x86 code even though we say in the
# ABI_LIST above that we only support ARM.
if OPTIONS.is_i686():
  print 'ro.dalvik.vm.isa.arm=x86'
if OPTIONS.is_x86_64():
  print 'ro.dalvik.vm.isa.arm=x86_64'

# When AOT is not enabled, make sure dex2oat does not run.
if not OPTIONS.enable_art_aot():
  print 'ro.arc.dex2oat.disabled=1'