Ejemplo n.º 1
0
def run():
    OPTIONS.parse_configure_file()

    # Check if internal/ exists. Run git-clone if not.
    if not os.path.isdir(_ARC_INTERNAL_DIR):
        # TODO(tandrii): Move this nacl-x86_64-bionic-internal recipe's botupdate
        # step.
        url = 'https://chrome-internal.googlesource.com/arc/internal-packages.git'
        logging.info('Cloning %s' % url)
        subprocess.check_call('git clone %s internal' % url,
                              cwd=_ARC_ROOT,
                              shell=True)

    # On 'internal' mode, sync the HEAD to the DEPS revision.
    # On 'internal-dev', just use the current HEAD.
    if OPTIONS.internal_apks_source() == 'internal':
        # Check if internal/ is clean and on master.
        if _git_has_local_modification():
            logging.error('%s has local modification' % _ARC_INTERNAL_DIR)
            sys.exit(-1)

        # Check if internal/ is up to date. Run git-reset if not.
        with open(_DEPS_FILE) as f:
            target_revision = f.read().rstrip()
        logging.info('%s has %s' % (_DEPS_FILE, target_revision))
        if target_revision != _get_current_arc_int_revision():
            sync_repo(target_revision)

    # Run the configuration for the current HEAD revision. This steps includes
    # syncing internal/third_party/ repositories when needed.
    subprocess.check_call(os.path.join(_ARC_INTERNAL_DIR,
                                       'build/configure.py'))

    return 0
Ejemplo n.º 2
0
def run():
  OPTIONS.parse_configure_file()

  # Check if internal/ exists. Run git-clone if not.
  if not os.path.isdir(_ARC_INTERNAL_DIR):
    # TODO(tandrii): Move this nacl-x86_64-bionic-internal recipe's botupdate
    # step.
    url = 'https://chrome-internal.googlesource.com/arc/internal-packages.git'
    logging.info('Cloning %s' % url)
    subprocess.check_call('git clone %s internal' % url,
                          cwd=_ARC_ROOT, shell=True)

  # On 'internal' mode, sync the HEAD to the DEPS revision.
  # On 'internal-dev', just use the current HEAD.
  if OPTIONS.internal_apks_source() == 'internal':
    # Check if internal/ is clean and on master.
    if _git_has_local_modification():
      logging.error('%s has local modification' % _ARC_INTERNAL_DIR)
      sys.exit(-1)

    # Check if internal/ is up to date. Run git-reset if not.
    with open(_DEPS_FILE) as f:
      target_revision = f.read().rstrip()
    logging.info('%s has %s' % (_DEPS_FILE, target_revision))
    if target_revision != _get_current_arc_int_revision():
      sync_repo(target_revision)

  # Run the configuration for the current HEAD revision. This steps includes
  # syncing internal/third_party/ repositories when needed.
  subprocess.check_call(os.path.join(_ARC_INTERNAL_DIR, 'build/configure.py'))

  return 0
Ejemplo n.º 3
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})
Ejemplo n.º 4
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})
Ejemplo n.º 5
0
def _ensure_downloads_up_to_date():
  cache_path = OPTIONS.download_cache_path()
  cache_size = OPTIONS.download_cache_size()

  sync_nacl_sdk.check_and_perform_updates(cache_path, cache_size)
  download_sdk_and_ndk.check_and_perform_updates(cache_path, cache_size)
  download_cts_files.check_and_perform_updates(cache_path, cache_size)
  download_arc_welder_deps.check_and_perform_updates(cache_path, cache_size)

  if sync_gdb_multiarch.main():
    sys.exit(1)

  # The open source repository does not have download_internal_apks.py.
  if (not open_source.is_open_source_repo() and
      OPTIONS.internal_apks_source() == 'prebuilt'):
    import download_internal_apks
    download_internal_apks.check_and_perform_updates(cache_path, cache_size)

  if not open_source.is_open_source_repo():
    import download_third_party_apks
    download_third_party_apks.check_and_perform_updates(cache_path, cache_size)
Ejemplo n.º 6
0
def _ensure_downloads_up_to_date():
    cache_path = OPTIONS.download_cache_path()
    cache_size = OPTIONS.download_cache_size()

    sync_nacl_sdk.check_and_perform_updates(cache_path, cache_size)
    download_sdk_and_ndk.check_and_perform_updates(cache_path, cache_size)
    download_cts_files.check_and_perform_updates(cache_path, cache_size)
    download_arc_welder_deps.check_and_perform_updates(cache_path, cache_size)

    if sync_gdb_multiarch.main():
        sys.exit(1)

    # The open source repository does not have download_internal_apks.py.
    if (not open_source.is_open_source_repo()
            and OPTIONS.internal_apks_source() == 'prebuilt'):
        import download_internal_apks
        download_internal_apks.check_and_perform_updates(
            cache_path, cache_size)

    if not open_source.is_open_source_repo():
        import download_third_party_apks
        download_third_party_apks.check_and_perform_updates(
            cache_path, cache_size)