Ejemplo n.º 1
0
def main():
    args = parse_args()
    url_prefix = "{root_url}/{version}".format(**vars(args))

    os.chdir(SOURCE_ROOT)
    version_file = os.path.join(SOURCE_ROOT, 'external_binaries', '.version')

    if (is_updated(version_file, args.version)):
        return

    rm_rf('external_binaries')
    safe_mkdir('external_binaries')

    if sys.platform == 'darwin':
        download_and_unzip(url_prefix, 'Mantle')
        download_and_unzip(url_prefix, 'ReactiveCocoa')
        download_and_unzip(url_prefix, 'Squirrel')
    elif sys.platform in ['cygwin', 'win32']:
        download_and_unzip(url_prefix, 'directxsdk-' + get_target_arch())

    # get sccache & set exec bit. https://bugs.python.org/issue15795
    download_and_unzip(url_prefix, 'sccache-{0}-x64'.format(PLATFORM))
    appname = 'sccache'
    if sys.platform == 'win32':
        appname += '.exe'
    add_exec_bit(os.path.join('external_binaries', appname))

    with open(version_file, 'w') as f:
        f.write(args.version)
def main():
  args = parse_args()
  config = parse_config()

  base_url = args.base_url if args.base_url is not None else config['baseUrl']
  version = config['version']
  output_dir = os.path.join(SOURCE_ROOT, 'external_binaries')
  version_file = os.path.join(output_dir, '.version')

  if (is_updated(version_file, version)):
    return

  rm_rf(output_dir)
  safe_mkdir(output_dir)

  for binary in config['binaries']:
    if not binary_should_be_downloaded(binary):
      continue

    temp_path = download_binary(base_url, version, binary['url'])

    # We assume that all binaries are in zip archives.
    extract_zip(temp_path, output_dir)

    # Hack alert. Set exec bit for sccache binaries.
    # https://bugs.python.org/issue15795
    if 'sccache' in binary['url']:
      add_exec_bit_to_sccache_binary(output_dir)

  with open(version_file, 'w') as f:
    f.write(version)
Ejemplo n.º 3
0
def main():
  os.chdir(SOURCE_ROOT)

  config = 'D'
  if len(sys.argv) == 2 and sys.argv[1] == '-R':
    config = 'R'

  if sys.platform == 'darwin':
    electron = os.path.join(SOURCE_ROOT, 'out', config,
                              '{0}.app'.format(PRODUCT_NAME), 'Contents',
                              'MacOS', PRODUCT_NAME)
  elif sys.platform == 'win32':
    electron = os.path.join(SOURCE_ROOT, 'out', config,
                              '{0}.exe'.format(PROJECT_NAME))
  else:
    electron = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)

  returncode = 0
  try:
    subprocess.check_call([electron, 'spec'] + sys.argv[1:])
  except subprocess.CalledProcessError as e:
    returncode = e.returncode

  if os.environ.has_key('OUTPUT_TO_FILE'):
    output_to_file = os.environ['OUTPUT_TO_FILE']
    with open(output_to_file, 'r') as f:
      print f.read()
    rm_rf(output_to_file)


  return returncode
Ejemplo n.º 4
0
def main():
  args = parse_args()
  url_prefix = "{root_url}/{version}".format(**vars(args))

  os.chdir(SOURCE_ROOT)
  version_file = os.path.join(SOURCE_ROOT, 'external_binaries', '.version')

  if (is_updated(version_file, args.version)):
    return

  rm_rf('external_binaries')
  safe_mkdir('external_binaries')

  if sys.platform == 'darwin':
    download_and_unzip(url_prefix, 'Mantle')
    download_and_unzip(url_prefix, 'ReactiveCocoa')
    download_and_unzip(url_prefix, 'Squirrel')
  elif sys.platform in ['cygwin', 'win32']:
    download_and_unzip(url_prefix, 'directxsdk-' + get_target_arch())

  # get sccache & set exec bit. https://bugs.python.org/issue15795
  download_and_unzip(url_prefix, 'sccache-{0}-x64'.format(PLATFORM))
  appname = 'sccache'
  if sys.platform == 'win32':
    appname += '.exe'
  add_exec_bit(os.path.join('external_binaries', appname))

  with open(version_file, 'w') as f:
    f.write(args.version)
Ejemplo n.º 5
0
def main(destination):
    rm_rf(destination)
    (project_name, product_name) = get_names_from_gyp()

    if PLATFORM in ['darwin', 'linux']:
        generate_breakpad_symbols = os.path.join(
            SOURCE_ROOT, 'tools', 'posix', 'generate_breakpad_symbols.py')
        if PLATFORM == 'darwin':
            start = os.path.join(OUT_DIR, '{0}.app'.format(product_name),
                                 'Contents', 'MacOS', product_name)
        else:
            start = os.path.join(OUT_DIR, project_name)
        args = [
            '--build-dir={0}'.format(OUT_DIR),
            '--binary={0}'.format(start),
            '--symbols-dir={0}'.format(destination),
            '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
            '--clear',
            '--jobs=16',
        ]
    else:
        generate_breakpad_symbols = os.path.join(
            SOURCE_ROOT, 'tools', 'win', 'generate_breakpad_symbols.py')
        args = [
            '--symbols-dir={0}'.format(destination),
            '--jobs=16',
            os.path.relpath(OUT_DIR),
        ]

    execute([sys.executable, generate_breakpad_symbols] + args)
Ejemplo n.º 6
0
def main():
    args = parse_args()
    config = parse_config()

    base_url = args.base_url if args.base_url is not None else config['baseUrl']
    version = config['version']
    output_dir = os.path.join(SOURCE_ROOT, 'external_binaries')
    version_file = os.path.join(output_dir, '.version')

    if (is_updated(version_file, version) and not args.force):
        return

    rm_rf(output_dir)
    safe_mkdir(output_dir)

    for binary in config['binaries']:
        if not binary_should_be_downloaded(binary):
            continue

        temp_path = download_binary(base_url, version, binary['url'],
                                    binary['sha'])

        # We assume that all binaries are in zip archives.
        extract_zip(temp_path, output_dir)

        # Hack alert. Set exec bit for sccache binaries.
        # https://bugs.python.org/issue15795
        if 'sccache' in binary['url']:
            add_exec_bit_to_sccache_binary(output_dir)

    with open(version_file, 'w') as f:
        f.write(version)
Ejemplo n.º 7
0
def main(destination):
  rm_rf(destination)
  (project_name, product_name) = get_names_from_gyp()

  if PLATFORM in ['darwin', 'linux']:
    generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'posix',
                                             'generate_breakpad_symbols.py')
    if PLATFORM == 'darwin':
      start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents',
                           'MacOS', product_name)
    else:
      start = os.path.join(OUT_DIR, project_name)
    args = [
      '--build-dir={0}'.format(OUT_DIR),
      '--binary={0}'.format(start),
      '--symbols-dir={0}'.format(destination),
      '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
      '--clear',
      '--jobs=16',
    ]
  else:
    generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'win',
                                             'generate_breakpad_symbols.py')
    args = [
      '--symbols-dir={0}'.format(destination),
      '--jobs=16',
      os.path.relpath(OUT_DIR),
    ]

  execute([sys.executable, generate_breakpad_symbols] + args)
Ejemplo n.º 8
0
def main():
    args = parse_args()

    if args.chromium_dir:
        globals().update(CHROMIUM_DIR=args.chromium_dir)

    if args.verbose:
        enable_verbose_mode()

    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    copy_license()
    if PLATFORM == 'win32':
        copy_vcruntime_binaries()
        copy_ucrt_binaries()

    if PLATFORM != 'win32' and not args.no_api_docs:
        create_api_json_schema()
        create_typescript_definitions()

    if PLATFORM == 'linux':
        strip_binaries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip('chromedriver', ELECTRON_VERSION)
    create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
    create_ffmpeg_zip()
    create_symbols_zip()
Ejemplo n.º 9
0
def main():
  args = parse_args()

  if args.chromium_dir:
    globals().update(CHROMIUM_DIR=args.chromium_dir)

  if args.verbose:
    enable_verbose_mode()

  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  force_build()
  create_symbols()
  copy_binaries()
  copy_chrome_binary('chromedriver')
  copy_chrome_binary('mksnapshot')
  copy_license()
  if PLATFORM == 'win32':
    copy_vcruntime_binaries()
    copy_ucrt_binaries()

  if PLATFORM != 'win32' and not args.no_api_docs:
    create_api_json_schema()
    create_typescript_definitions()

  if PLATFORM == 'linux':
    strip_binaries()

  create_version()
  create_dist_zip()
  create_chrome_binary_zip('chromedriver', ELECTRON_VERSION)
  create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
  create_ffmpeg_zip()
  create_symbols_zip()
Ejemplo n.º 10
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    copy_license()

    args = parse_args()

    if PLATFORM != 'win32' and not args.no_api_docs:
        create_api_json_schema()
        create_typescript_definitions()

    if PLATFORM == 'linux':
        strip_binaries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip('chromedriver', ELECTRON_VERSION)
    create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
    create_ffmpeg_zip()
    create_symbols_zip()
Ejemplo n.º 11
0
def main():
    os.chdir(SOURCE_ROOT)

    config = "D"
    if len(sys.argv) == 2 and sys.argv[1] == "-R":
        config = "R"

    if sys.platform == "darwin":
        atom_shell = os.path.join(
            SOURCE_ROOT, "out", config, "{0}.app".format(PRODUCT_NAME), "Contents", "MacOS", PRODUCT_NAME
        )
    elif sys.platform == "win32":
        atom_shell = os.path.join(SOURCE_ROOT, "out", config, "{0}.exe".format(PROJECT_NAME))
    else:
        atom_shell = os.path.join(SOURCE_ROOT, "out", config, PROJECT_NAME)

    returncode = 0
    try:
        subprocess.check_call([atom_shell, "spec"] + sys.argv[1:])
    except subprocess.CalledProcessError as e:
        returncode = e.returncode

    if os.environ.has_key("OUTPUT_TO_FILE"):
        output_to_file = os.environ["OUTPUT_TO_FILE"]
        with open(output_to_file, "r") as f:
            print f.read()
        rm_rf(output_to_file)

    return returncode
Ejemplo n.º 12
0
def main():
  args = parse_args()
  config = parse_config()

  base_url = args.base_url if args.base_url is not None else config['baseUrl']
  
  output_dir = os.path.join(SOURCE_ROOT, 'external_binaries')
  config_hash_path = os.path.join(output_dir, '.hash')

  if (not is_updated(config_hash_path) and not args.force):
    return

  rm_rf(output_dir)
  safe_mkdir(output_dir)

  for binary in config['files']:
    if not binary_should_be_downloaded(binary):
      continue

    temp_path = download_binary(base_url, binary['sha'], binary['name'])

    if temp_path.endswith('.zip'):
      extract_zip(temp_path, output_dir)
    else:
      tar = tarfile.open(temp_path, "r:gz")
      tar.extractall(output_dir)
      tar.close()

    # Hack alert. Set exec bit for sccache binaries.
    # https://bugs.python.org/issue15795
    if 'sccache' in binary['name']:
      add_exec_bit_to_sccache_binary(output_dir)

  with open(config_hash_path, 'w') as f:
    f.write(sha256(CONFIG_PATH))
Ejemplo n.º 13
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  force_build()
  create_symbols()
  copy_binaries()
  copy_chrome_binary('chromedriver')
  copy_chrome_binary('mksnapshot')
  copy_license()

  args = parse_args()

  if PLATFORM != 'win32' and not args.no_api_docs:
    create_api_json_schema()
    create_typescript_definitions()

  if PLATFORM == 'linux':
    strip_binaries()

  create_version()
  create_dist_zip()
  create_chrome_binary_zip('chromedriver', ELECTRON_VERSION)
  create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
  create_ffmpeg_zip()
  create_symbols_zip()
Ejemplo n.º 14
0
def main():
  os.chdir(SOURCE_ROOT)
  rm_rf('node_modules')
  rm_rf('dist')
  rm_rf('out')
  rm_rf('spec/node_modules')
  rm_rf('vendor/brightray/vendor/download/libchromiumcontent')
Ejemplo n.º 15
0
def create_app_copy(initial_app_path):
  print 'Creating copy of app for testing'
  app_path = os.path.join(os.path.dirname(initial_app_path),
                          os.path.basename(initial_app_path)
                          + '-mksnapshot-test')

  rm_rf(app_path)
  shutil.copytree(initial_app_path, app_path, symlinks=True)
  return app_path
Ejemplo n.º 16
0
def create_app_copy(initial_app_path):
  print 'Creating copy of app for testing'
  app_path = os.path.join(os.path.dirname(initial_app_path),
                          os.path.basename(initial_app_path)
                          + '-mksnapshot-test')

  rm_rf(app_path)
  shutil.copytree(initial_app_path, app_path, symlinks=True)
  return app_path
Ejemplo n.º 17
0
def create_symbols():
  directory = 'Atom-Shell.breakpad.syms'
  rm_rf(os.path.join(OUT_DIR, directory))

  build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
  subprocess.check_output([sys.executable, build, '-c', 'Release',
                           '-t', 'atom_dump_symbols'])

  shutil.copytree(os.path.join(OUT_DIR, directory),
                  os.path.join(DIST_DIR, directory),
                  symlinks=True)
Ejemplo n.º 18
0
def create_symbols():
    directory = 'Atom-Shell.breakpad.syms'
    rm_rf(os.path.join(OUT_DIR, directory))

    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    subprocess.check_output(
        [sys.executable, build, '-c', 'Release', '-t', 'atom_dump_symbols'])

    shutil.copytree(os.path.join(OUT_DIR, directory),
                    os.path.join(DIST_DIR, directory),
                    symlinks=True)
Ejemplo n.º 19
0
def main():
  os.chdir(SOURCE_ROOT)

  args = parse_args()
  config = args.configuration

  if args.verbose:
    enable_verbose_mode()
    os.environ['ELECTRON_ENABLE_LOGGING'] = '1'

  spec_modules = os.path.join(SOURCE_ROOT, 'spec', 'node_modules')
  if args.rebuild_native_modules or not os.path.isdir(spec_modules):
    rebuild_native_modules(args.verbose, config)

  if sys.platform == 'darwin':
    electron = os.path.join(SOURCE_ROOT, 'out', config,
                              '{0}.app'.format(PRODUCT_NAME), 'Contents',
                              'MacOS', PRODUCT_NAME)
    resources_path = os.path.join(SOURCE_ROOT, 'out', config,
                                   '{0}.app'.format(PRODUCT_NAME), 'Contents',
                                   'Resources')
  elif sys.platform == 'win32':
    electron = os.path.join(SOURCE_ROOT, 'out', config,
                              '{0}.exe'.format(PROJECT_NAME))
    resources_path = os.path.join(SOURCE_ROOT, 'out', config)
    if config != 'R':
      os.environ['ELECTRON_SKIP_NATIVE_MODULE_TESTS'] = '1'
  else:
    electron = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)
    resources_path = os.path.join(SOURCE_ROOT, 'out', config)

  returncode = 0
  try:
    if args.use_instrumented_asar:
      install_instrumented_asar_file(resources_path)
    os.environ["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "1"
    subprocess.check_call([electron, 'spec'] + sys.argv[1:])
  except subprocess.CalledProcessError as e:
    returncode = e.returncode
  except KeyboardInterrupt:
    returncode = 0

  if args.use_instrumented_asar:
    restore_uninstrumented_asar_file(resources_path)

  if os.environ.has_key('OUTPUT_TO_FILE'):
    output_to_file = os.environ['OUTPUT_TO_FILE']
    with open(output_to_file, 'r') as f:
      print f.read()
    rm_rf(output_to_file)


  return returncode
Ejemplo n.º 20
0
def create_app_copy(config):
  initial_app_path = os.path.join(SOURCE_ROOT, 'out', config)
  app_path = os.path.join(SOURCE_ROOT, 'out', config + '-no-proprietary-codecs')

  if sys.platform == 'darwin':
    app_name = '{0}.app'.format(PRODUCT_NAME)
    initial_app_path = os.path.join(initial_app_path, app_name)
    app_path = os.path.join(app_path, app_name)

  rm_rf(app_path)
  shutil.copytree(initial_app_path, app_path, symlinks=True)
  return app_path
Ejemplo n.º 21
0
def main():
  os.chdir(SOURCE_ROOT)

  rm_rf(SYMBOLS_DIR)
  safe_mkdir(SYMBOLS_DIR)
  for pdb in PDB_LIST:
    run_symstore(pdb, SYMBOLS_DIR, 'AtomShell')

  bucket, access_key, secret_key = s3_config()
  files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
  files = [f.lower() for f in files]
  upload_symbols(bucket, access_key, secret_key, files)
Ejemplo n.º 22
0
def main():
    os.chdir(SOURCE_ROOT)

    rm_rf(SYMBOLS_DIR)
    safe_mkdir(SYMBOLS_DIR)
    for pdb in PDB_LIST:
        run_symstore(pdb, SYMBOLS_DIR, PRODUCT_NAME)

    bucket, access_key, secret_key = s3_config()
    files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
    files = [f.lower() for f in files]
    upload_symbols(bucket, access_key, secret_key, files)
Ejemplo n.º 23
0
def create_app_copy(initial_app_path):
  app_path = os.path.join(os.path.dirname(initial_app_path),
                          os.path.basename(initial_app_path)
                          + '-no-proprietary-codecs')

  if sys.platform == 'darwin':
    app_name = '{0}.app'.format(PRODUCT_NAME)
    initial_app_path = os.path.join(initial_app_path, app_name)
    app_path = os.path.join(app_path, app_name)

  rm_rf(app_path)
  shutil.copytree(initial_app_path, app_path, symlinks=True)
  return app_path
Ejemplo n.º 24
0
def create_app_copy(args):
    initial_app_path = os.path.join(args.source_root, 'out', args.config)
    app_path = os.path.join(args.source_root, 'out',
                            args.config + '-no-proprietary-codecs')

    if sys.platform == 'darwin':
        app_name = '{0}.app'.format(PRODUCT_NAME)
        initial_app_path = os.path.join(initial_app_path, app_name)
        app_path = os.path.join(app_path, app_name)

    rm_rf(app_path)
    shutil.copytree(initial_app_path, app_path, symlinks=True)
    return app_path
Ejemplo n.º 25
0
def main():
    args = parse_args()

    url = DIST_URL + args.version + "/"
    directory, files = download_files(url, get_files_list(args.version))
    checksums = [
        create_checksum("sha1", directory, "SHASUMS.txt", files),
        create_checksum("sha256", directory, "SHASUMS256.txt", files),
    ]

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, directory, "atom-shell/dist/{0}".format(args.version), checksums)

    rm_rf(directory)
Ejemplo n.º 26
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    ##create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    copy_licence()

    create_version()
    create_dist_zip()
    create_ffmpeg_zip()
Ejemplo n.º 27
0
def main():
    args = parse_args()

    url = DIST_URL + args.version + '/'
    directory, files = download_files(url, get_files_list(args.version))
    checksums = [
        create_checksum('sha1', directory, 'SHASUMS.txt', files),
        create_checksum('sha256', directory, 'SHASUMS256.txt', files)
    ]

    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, directory,
          'atom-shell/dist/{0}'.format(args.version), checksums)

    rm_rf(directory)
Ejemplo n.º 28
0
def create_app_copy(initial_app_path):
    app_path = os.path.join(
        os.path.dirname(initial_app_path),
        os.path.basename(initial_app_path) + '-no-proprietary-codecs')

    if sys.platform == 'darwin':
        product_name = gn(initial_app_path).args().get_string(
            'electron_product_name')
        app_name = '{0}.app'.format(product_name)
        initial_app_path = os.path.join(initial_app_path, app_name)
        app_path = os.path.join(app_path, app_name)

    rm_rf(app_path)
    shutil.copytree(initial_app_path, app_path, symlinks=True)
    return app_path
Ejemplo n.º 29
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  args = parse_args()

  force_build()
  download_libchromiumcontent_symbols(args.url)
  create_symbols()
  copy_binaries()
  copy_headers()
  copy_license()
  create_version()
  create_dist_zip()
  create_symbols_zip()
  create_header_tarball()
Ejemplo n.º 30
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    args = parse_args()

    force_build()
    download_libchromiumcontent_symbols(args.url)
    create_symbols()
    copy_binaries()
    copy_headers()
    copy_license()
    create_version()
    create_dist_zip()
    create_symbols_zip()
    create_header_tarball()
Ejemplo n.º 31
0
def main():
    args = parse_args()
    if args.verbose:
        enable_verbose_mode()
    rm_rf(args.destination)
    source_root = os.path.abspath(args.source_root)
    build_path = os.path.join(source_root, args.build_dir)
    (project_name, product_name) = get_names_from_branding()

    if PLATFORM in ['darwin', 'linux']:

        if PLATFORM == 'darwin':
            #macOS has an additional helper app; provide the path to that binary also
            main_app = os.path.join(build_path, '{0}.app'.format(product_name),
                                    'Contents', 'MacOS', product_name)
            helper_name = product_name + " Helper"
            helper_app = os.path.join(build_path,
                                      '{0}.app'.format(helper_name),
                                      'Contents', 'MacOS',
                                      product_name + " Helper")
            binaries = [main_app, helper_app]
            for binary in binaries:
                generate_posix_symbols(binary, source_root, build_path,
                                       args.destination)
        else:
            binary = os.path.join(build_path, project_name)
            generate_posix_symbols(binary, source_root, build_path,
                                   args.destination)

    else:
        generate_breakpad_symbols = os.path.join(
            ELECTRON_ROOT, 'tools', 'win', 'generate_breakpad_symbols.py')
        args = [
            '--symbols-dir={0}'.format(args.destination),
            '--jobs=16',
            os.path.relpath(build_path),
        ]
        if is_verbose_mode():
            args += ['-v']
        #Make sure msdia140.dll is in the path (needed for dump_syms.exe)
        env = os.environ.copy()
        msdia140_dll_path = os.path.join(GN_SRC_DIR, 'third_party',
                                         'llvm-build', 'Release+Asserts',
                                         'bin')
        env['PATH'] = os.path.pathsep.join([env.get('PATH', '')] +
                                           [msdia140_dll_path])
        execute([sys.executable, generate_breakpad_symbols] + args, env)
Ejemplo n.º 32
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  force_build()
  create_symbols()
  copy_binaries()
  copy_chromedriver()
  copy_license()

  if TARGET_PLATFORM == 'linux':
    strip_binaries()
    copy_system_libraries()

  create_version()
  create_dist_zip()
  create_chromedriver_zip()
  create_symbols_zip()
Ejemplo n.º 33
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    #create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    generate_licenses()
    copy_license()

    if PLATFORM == 'linux':
        strip_binaries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip('chromedriver', get_chromedriver_version())
    create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
Ejemplo n.º 34
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chromedriver()
    copy_license()

    if PLATFORM == 'linux':
        strip_binaries()
        copy_system_libraries()

    create_version()
    create_dist_zip()
    create_chromedriver_zip()
    create_symbols_zip()
Ejemplo n.º 35
0
def main():
  args = parse_args()
  if args.verbose:
    enable_verbose_mode()
  rm_rf(args.destination)
  source_root = os.path.abspath(args.source_root)
  build_path = os.path.join(source_root, args.build_dir)
  (project_name, product_name) = get_names_from_branding()

  if PLATFORM in ['darwin', 'linux']:

    if PLATFORM == 'darwin':
      #macOS has an additional helper app; provide the path to that binary also
      main_app = os.path.join(build_path, '{0}.app'.format(product_name),
                            'Contents', 'MacOS', product_name)
      helper_name = product_name + " Helper"
      helper_app = os.path.join(build_path, '{0}.app'.format(helper_name),
                            'Contents', 'MacOS', product_name + " Helper")
      binaries = [main_app, helper_app]
      for binary in binaries:
        generate_posix_symbols(binary, source_root, build_path,
                                        args.destination)
    else:
      binary = os.path.join(build_path, project_name)
      generate_posix_symbols(binary, source_root, build_path,
                                      args.destination)

  else:
    generate_breakpad_symbols = os.path.join(ELECTRON_ROOT, 'tools', 'win',
                                             'generate_breakpad_symbols.py')
    args = [
      '--symbols-dir={0}'.format(args.destination),
      '--jobs=16',
      os.path.relpath(build_path),
    ]
    if is_verbose_mode():
      args += ['-v']
    #Make sure msdia140.dll is in the path (needed for dump_syms.exe)
    env = os.environ.copy()
    msdia140_dll_path =  os.path.join(SRC_DIR, 'third_party', 'llvm-build',
                                      'Release+Asserts', 'bin')
    env['PATH'] = os.path.pathsep.join(
        [env.get('PATH', '')] + [msdia140_dll_path])
    execute([sys.executable, generate_breakpad_symbols] + args, env)
Ejemplo n.º 36
0
def main():
  os.chdir(SOURCE_ROOT)

  config = 'D'
  if len(sys.argv) == 2 and sys.argv[1] == '-R':
    config = 'R'

  if sys.platform == 'darwin':
    electron = os.path.join(SOURCE_ROOT, 'out', config,
                              '{0}.app'.format(PRODUCT_NAME), 'Contents',
                              'MacOS', PRODUCT_NAME)
    resources_path = os.path.join(SOURCE_ROOT, 'out', config,
                                   '{0}.app'.format(PRODUCT_NAME), 'Contents',
                                   'Resources')
  elif sys.platform == 'win32':
    electron = os.path.join(SOURCE_ROOT, 'out', config,
                              '{0}.exe'.format(PROJECT_NAME))
    resources_path = os.path.join(SOURCE_ROOT, 'out', config)
  else:
    electron = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)
    resources_path = os.path.join(SOURCE_ROOT, 'out', config)

  use_instrumented_asar = '--use-instrumented-asar' in sys.argv
  returncode = 0
  try:
    if use_instrumented_asar:
      install_instrumented_asar_file(resources_path)
    subprocess.check_call([electron, 'spec'] + sys.argv[1:])
  except subprocess.CalledProcessError as e:
    returncode = e.returncode
  except KeyboardInterrupt:
    returncode = 0

  if use_instrumented_asar:
    restore_uninstrumented_asar_file(resources_path)

  if os.environ.has_key('OUTPUT_TO_FILE'):
    output_to_file = os.environ['OUTPUT_TO_FILE']
    with open(output_to_file, 'r') as f:
      print f.read()
    rm_rf(output_to_file)


  return returncode
Ejemplo n.º 37
0
def main():
  os.chdir(SOURCE_ROOT)
  version_file = os.path.join(SOURCE_ROOT, 'external_binaries', '.version')

  if (is_updated(version_file, VERSION)):
    return

  rm_rf('external_binaries')
  safe_mkdir('external_binaries')

  if sys.platform == 'darwin':
    download_and_unzip('Mantle')
    download_and_unzip('ReactiveCocoa')
    download_and_unzip('Squirrel')
  elif sys.platform in ['cygwin', 'win32']:
    download_and_unzip('directxsdk-' + get_target_arch())

  with open(version_file, 'w') as f:
    f.write(VERSION)
Ejemplo n.º 38
0
def main():
    os.chdir(SOURCE_ROOT)

    config = 'D'
    if len(sys.argv) == 2 and sys.argv[1] == '-R':
        config = 'R'

    if sys.platform == 'darwin':
        electron = os.path.join(SOURCE_ROOT, 'out', config,
                                '{0}.app'.format(PRODUCT_NAME), 'Contents',
                                'MacOS', PRODUCT_NAME)
        resources_path = os.path.join(SOURCE_ROOT, 'out', config,
                                      '{0}.app'.format(PRODUCT_NAME),
                                      'Contents', 'Resources')
    elif sys.platform == 'win32':
        electron = os.path.join(SOURCE_ROOT, 'out', config,
                                '{0}.exe'.format(PROJECT_NAME))
        resources_path = os.path.join(SOURCE_ROOT, 'out', config)
    else:
        electron = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)
        resources_path = os.path.join(SOURCE_ROOT, 'out', config)

    use_instrumented_asar = '--use-instrumented-asar' in sys.argv
    returncode = 0
    try:
        if use_instrumented_asar:
            install_instrumented_asar_file(resources_path)
        subprocess.check_call([electron, 'spec'] + sys.argv[1:])
    except subprocess.CalledProcessError as e:
        returncode = e.returncode
    except KeyboardInterrupt:
        returncode = 0

    if use_instrumented_asar:
        restore_uninstrumented_asar_file(resources_path)

    if os.environ.has_key('OUTPUT_TO_FILE'):
        output_to_file = os.environ['OUTPUT_TO_FILE']
        with open(output_to_file, 'r') as f:
            print f.read()
        rm_rf(output_to_file)

    return returncode
Ejemplo n.º 39
0
def main():
    os.chdir(SOURCE_ROOT)
    version_file = os.path.join(SOURCE_ROOT, 'external_binaries', '.version')

    if (is_updated(version_file, VERSION)):
        return

    rm_rf('external_binaries')
    safe_mkdir('external_binaries')

    if sys.platform == 'darwin':
        download_and_unzip('Mantle')
        download_and_unzip('ReactiveCocoa')
        download_and_unzip('Squirrel')
    elif sys.platform in ['cygwin', 'win32']:
        download_and_unzip('directxsdk-' + get_target_arch())

    with open(version_file, 'w') as f:
        f.write(VERSION)
Ejemplo n.º 40
0
def main():
    args = parse_args()
    dist_url = args.dist_url
    if dist_url[-1] != "/":
        dist_url += "/"

    url = dist_url + args.version + '/'
    directory, files = download_files(url, get_files_list(args.version))
    checksums = [
        create_checksum('sha1', directory, 'SHASUMS.txt', files),
        create_checksum('sha256', directory, 'SHASUMS256.txt', files)
    ]

    if args.target_dir is None:
        store_artifact(directory, 'atom-shell/dist/{0}'.format(args.version),
                       checksums)
    else:
        copy_files(checksums, args.target_dir)

    rm_rf(directory)
Ejemplo n.º 41
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  args = parse_args()

  force_build()
  download_libchromiumcontent_symbols(args.url)
  create_symbols()
  copy_binaries()
  copy_chromedriver()
  copy_license()

  if TARGET_PLATFORM == 'linux':
    copy_system_libraries()

  create_version()
  create_dist_zip()
  create_chromedriver_zip()
  create_symbols_zip()
Ejemplo n.º 42
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    args = parse_args()

    force_build()
    download_libchromiumcontent_symbols(args.url)
    create_symbols()
    copy_binaries()
    copy_chromedriver()
    copy_license()

    if TARGET_PLATFORM == 'linux':
        copy_system_libraries()

    create_version()
    create_dist_zip()
    create_chromedriver_zip()
    create_symbols_zip()
Ejemplo n.º 43
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    copy_license()

    if PLATFORM == 'linux':
        strip_binaries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip('chromedriver', get_chromedriver_version())
    create_chrome_binary_zip('mksnapshot', ATOM_SHELL_VERSION)
    create_ffmpeg_zip()
    create_symbols_zip()
Ejemplo n.º 44
0
def main():
    os.chdir(SOURCE_ROOT)
    version_file = os.path.join(SOURCE_ROOT, "external_binaries", ".version")

    if is_updated(version_file, VERSION):
        return

    rm_rf("external_binaries")
    safe_mkdir("external_binaries")

    if sys.platform == "darwin":
        download_and_unzip("Mantle")
        download_and_unzip("ReactiveCocoa")
        download_and_unzip("Squirrel")
    elif sys.platform in ["cygwin", "win32"]:
        download_and_unzip("directxsdk-" + get_target_arch())
        download_and_unzip("vs2015-crt-" + get_target_arch())

    with open(version_file, "w") as f:
        f.write(VERSION)
Ejemplo n.º 45
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chrome_binary("chromedriver")
    copy_chrome_binary("mksnapshot")
    copy_license()

    if PLATFORM == "linux":
        strip_binaries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip("chromedriver", get_chromedriver_version())
    create_chrome_binary_zip("mksnapshot", ATOM_SHELL_VERSION)
    create_ffmpeg_zip()
    create_symbols_zip()
Ejemplo n.º 46
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  force_build()
  create_symbols()
  copy_binaries()
  copy_chrome_binary('chromedriver')
  copy_chrome_binary('mksnapshot')
  copy_license()

  if PLATFORM == 'linux':
    strip_binaries()

  create_version()
  create_dist_zip()
  create_chrome_binary_zip('chromedriver', get_chromedriver_version())
  create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
  create_ffmpeg_zip()
  create_symbols_zip()
Ejemplo n.º 47
0
def main():
  args = parse_args()
  dist_url = args.dist_url
  if dist_url[-1] != "/":
    dist_url += "/"

  url = dist_url + args.version + '/'
  directory, files = download_files(url, get_files_list(args.version))
  checksums = [
    create_checksum('sha1', directory, 'SHASUMS.txt', files),
    create_checksum('sha256', directory, 'SHASUMS256.txt', files)
  ]

  if args.target_dir is None:
    bucket, access_key, secret_key = s3_config()
    s3put(bucket, access_key, secret_key, directory,
          'atom-shell/dist/{0}'.format(args.version), checksums)
  else:
    copy_files(checksums, args.target_dir)

  rm_rf(directory)
Ejemplo n.º 48
0
def main(destination):
    rm_rf(destination)
    (project_name, product_name) = get_names_from_gyp()

    if PLATFORM in ['darwin', 'linux']:
        generate_breakpad_symbols = os.path.join(
            SOURCE_ROOT, 'tools', 'posix', 'generate_breakpad_symbols.py')
        if PLATFORM == 'darwin':
            #macOS has an additional helper app; provide the path to that binary also
            main_app = os.path.join(OUT_DIR, '{0}.app'.format(product_name),
                                    'Contents', 'MacOS', product_name)
            helper_name = product_name + " Helper"
            helper_app = os.path.join(OUT_DIR, '{0}.app'.format(helper_name),
                                      'Contents', 'MacOS',
                                      product_name + " Helper")
            binaries = [main_app, helper_app]
        else:
            binaries = [os.path.join(OUT_DIR, project_name)]
        args = [
            '--build-dir={0}'.format(OUT_DIR),
            '--symbols-dir={0}'.format(destination),
            '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
            '--clear',
            '--jobs=16',
        ]
        for binary in binaries:
            args += '--binary={0}'.format(binary),

    else:
        generate_breakpad_symbols = os.path.join(
            SOURCE_ROOT, 'tools', 'win', 'generate_breakpad_symbols.py')
        args = [
            '--symbols-dir={0}'.format(destination),
            '--jobs=16',
            os.path.relpath(OUT_DIR),
        ]

    execute([sys.executable, generate_breakpad_symbols] + args)
Ejemplo n.º 49
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  target_arch = get_target_arch()

  force_build()
  create_symbols()
  copy_binaries()
  copy_chrome_binary('chromedriver')
  copy_chrome_binary('mksnapshot')
  copy_license()

  if PLATFORM == 'linux':
    strip_binaries()
    if target_arch != 'arm':
      copy_system_libraries()

  create_version()
  create_dist_zip()
  create_chrome_binary_zip('chromedriver', get_chromedriver_version())
  create_chrome_binary_zip('mksnapshot', ATOM_SHELL_VERSION)
  create_symbols_zip()
Ejemplo n.º 50
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    copy_license()

    if PLATFORM != 'win32':
        create_api_json_schema()

    if PLATFORM == 'linux':
        strip_binaries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip('chromedriver', get_chromedriver_version())
    create_chrome_binary_zip('mksnapshot', ELECTRON_VERSION)
    create_ffmpeg_zip()
    create_symbols_zip()
Ejemplo n.º 51
0
def main(destination):
  if PLATFORM == 'win32':
    register_required_dll()

  rm_rf(destination)
  (project_name, product_name) = get_names_from_gyp()

  if PLATFORM in ['darwin', 'linux']:
    # Generate the dump_syms tool.
    build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
    execute([sys.executable, build, '-c', 'R', '-t', 'dump_syms'])

    generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'posix',
                                             'generate_breakpad_symbols.py')
    if PLATFORM == 'darwin':
      start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents',
                           'MacOS', product_name)
    else:
      start = os.path.join(OUT_DIR, project_name)
    args = [
      '--build-dir={0}'.format(OUT_DIR),
      '--binary={0}'.format(start),
      '--symbols-dir={0}'.format(destination),
      '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
      '--clear',
      '--jobs=16',
    ]
  else:
    generate_breakpad_symbols = os.path.join(SOURCE_ROOT, 'tools', 'win',
                                             'generate_breakpad_symbols.py')
    args = [
      '--symbols-dir={0}'.format(destination),
      '--jobs=16',
      os.path.relpath(OUT_DIR),
    ]

  execute([sys.executable, generate_breakpad_symbols] + args)
Ejemplo n.º 52
0
def main():
  args = parse_args()
  if args.verbose:
    enable_verbose_mode()
  rm_rf(args.destination)
  source_root = os.path.abspath(args.source_root)
  build_path = os.path.join(source_root, args.build_dir)
  product_name = gn(build_path).args().get_string('electron_product_name')
  project_name = gn(build_path).args().get_string('electron_project_name')

  if PLATFORM in ['darwin', 'linux']:

    if PLATFORM == 'darwin':
      #macOS has an additional helper app; provide the path to that binary also
      main_app = os.path.join(build_path, '{0}.app'.format(product_name),
                            'Contents', 'MacOS', product_name)
      helper_name = product_name + " Helper"
      helper_app = os.path.join(build_path, '{0}.app'.format(helper_name),
                            'Contents', 'MacOS', product_name + " Helper")
      binaries = [main_app, helper_app]
      for binary in binaries:        
        generate_posix_symbols(binary, source_root, build_path, 
                                        args.destination)
    else:
      binary = os.path.join(build_path, project_name)
      generate_posix_symbols(binary, source_root, build_path, 
                                      args.destination)

  else:
    generate_breakpad_symbols = os.path.join(ELECTRON_ROOT, 'tools', 'win',
                                             'generate_breakpad_symbols.py')
    args = [
      '--symbols-dir={0}'.format(args.destination),
      '--jobs=16',
      os.path.relpath(build_path),
    ]  
    execute([sys.executable, generate_breakpad_symbols] + args)
Ejemplo n.º 53
0
def main(destination):
    if PLATFORM == 'win32':
        register_required_dll()

    rm_rf(destination)
    (project_name, product_name) = get_names_from_gyp()

    if PLATFORM in ['darwin', 'linux']:
        # Generate the dump_syms tool.
        build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
        execute([sys.executable, build, '-c', 'R', '-t', 'dump_syms'])

        generate_breakpad_symbols = os.path.join(
            SOURCE_ROOT, 'tools', 'posix', 'generate_breakpad_symbols.py')
        if PLATFORM == 'darwin':
            start = os.path.join(OUT_DIR, '{0}.app'.format(product_name),
                                 'Contents', 'MacOS', product_name)
        else:
            start = os.path.join(OUT_DIR, project_name)
        args = [
            '--build-dir={0}'.format(OUT_DIR),
            '--binary={0}'.format(start),
            '--symbols-dir={0}'.format(destination),
            '--libchromiumcontent-dir={0}'.format(CHROMIUM_DIR),
            '--clear',
            '--jobs=16',
        ]
    else:
        generate_breakpad_symbols = os.path.join(
            SOURCE_ROOT, 'tools', 'win', 'generate_breakpad_symbols.py')
        args = [
            '--symbols-dir={0}'.format(destination),
            '--jobs=16',
            os.path.relpath(OUT_DIR),
        ]

    execute([sys.executable, generate_breakpad_symbols] + args)
Ejemplo n.º 54
0
def main():
  os.chdir(SOURCE_ROOT)
  rm_rf('node_modules')
  rm_rf('out')
  rm_rf('spec/node_modules')
Ejemplo n.º 55
0
def remove_directory(directory):
  print 'Removing %s' % directory
  rm_rf(directory)
Ejemplo n.º 56
0
def main():
  os.chdir(SOURCE_ROOT)
  rm_rf('node_modules')
  rm_rf('dist')
  rm_rf('out')
  rm_rf('spec/node_modules')
  rm_rf('vendor/brightray/vendor/download/libchromiumcontent')
  rm_rf(os.path.expanduser('~/.node-gyp'))
Ejemplo n.º 57
0
def main():
    os.chdir(SOURCE_ROOT)
    rm_rf('node_modules')
    rm_rf('out')
    rm_rf('spec/node_modules')