def main(): os.chdir(SOURCE_ROOT) args = parse_args() config = args.configuration if args.verbose: enable_verbose_mode() spec_modules = os.path.join(SOURCE_ROOT, 'spec', 'node_modules') out_dir = os.path.join(SOURCE_ROOT, 'out', config) version = get_electron_version() node_dir = os.path.join(out_dir, 'node-{0}'.format(version)) # Create node headers script_path = os.path.join(SOURCE_ROOT, 'script', 'create-node-headers.py') execute_stdout([ sys.executable, script_path, '--version', version, '--directory', out_dir ]) if PLATFORM == 'win32': lib_dir = os.path.join(node_dir, 'Release') safe_mkdir(lib_dir) iojs_lib = os.path.join(lib_dir, 'iojs.lib') atom_lib = os.path.join(out_dir, 'node.dll.lib') shutil.copy2(atom_lib, iojs_lib) # Native modules can only be compiled against release builds on Windows if config == 'R' or PLATFORM != 'win32': update_electron_modules(os.path.dirname(spec_modules), get_target_arch(), node_dir) else: update_node_modules(os.path.dirname(spec_modules))
def create_node_headers(): execute_stdout([ sys.executable, os.path.join(SOURCE_ROOT, 'script', 'create-node-headers.py'), '--version', get_electron_version() ])
def main(): os.chdir(SOURCE_ROOT) args = parse_args() config = args.configuration if args.verbose: enable_verbose_mode() spec_modules = os.path.join(SOURCE_ROOT, 'spec', 'node_modules') out_dir = os.path.join(SOURCE_ROOT, 'out', config) version = get_electron_version() node_dir = os.path.join(out_dir, 'node-{0}'.format(version)) # Create node headers script_path = os.path.join(SOURCE_ROOT, 'script', 'create-node-headers.py') execute_stdout([sys.executable, script_path, '--version', version, '--directory', out_dir]) if PLATFORM == 'win32': lib_dir = os.path.join(node_dir, 'Release') safe_mkdir(lib_dir) iojs_lib = os.path.join(lib_dir, 'iojs.lib') atom_lib = os.path.join(out_dir, 'node.dll.lib') shutil.copy2(atom_lib, iojs_lib) node_lib = os.path.join(lib_dir, 'node.lib') shutil.copy2(atom_lib, node_lib) # Native modules can only be compiled against release builds on Windows if config[0] == 'R' or PLATFORM != 'win32': update_electron_modules(os.path.dirname(spec_modules), get_target_arch(), node_dir) else: update_node_modules(os.path.dirname(spec_modules))
def update_electron_modules(dirname, target_arch): env = os.environ.copy() version = get_electron_version() env['npm_config_arch'] = target_arch env['npm_config_target'] = version env['npm_config_nodedir'] = os.path.join(SOURCE_ROOT, 'dist', 'node-{0}'.format(version)) update_node_modules(dirname, env)
def main(): if len(sys.argv) != 2 or sys.argv[1] == '-h': print 'Usage: bump-version.py [<version> | major | minor | patch]' return 1 option = sys.argv[1] increments = ['major', 'minor', 'patch', 'build'] if option in increments: version = get_electron_version() versions = parse_version(version.split('-')[0]) versions = increase_version(versions, increments.index(option)) else: versions = parse_version(option) version = '.'.join(versions[:3]) with scoped_cwd(SOURCE_ROOT): # update_electron_gyp(version) update_win_rc(version, versions) update_version_h(versions) update_info_plist(version) update_package_json(version) tag_version(version)
def main(): if len(sys.argv) != 2 or sys.argv[1] == '-h': print 'Usage: bump-version.py [<version> | major | minor | patch]' return 1 option = sys.argv[1] increments = ['major', 'minor', 'patch', 'build'] if option in increments: version = get_electron_version() versions = parse_version(version.split('-')[0]) versions = increase_version(versions, increments.index(option)) else: versions = parse_version(option) version = '.'.join(versions[:3]) with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version) update_win_rc(version, versions) update_version_h(versions) update_info_plist(version) update_package_json(version) tag_version(version)
def update_electron_modules(dirname, target_arch): env = os.environ.copy() env['npm_config_arch'] = target_arch env['npm_config_target'] = get_electron_version() env['npm_config_disturl'] = 'https://atom.io/download/atom-shell' update_node_modules(dirname, env)
def main(): parser = argparse.ArgumentParser( description='Bump version numbers. Must specify at least one of the three' +' options:\n' +' --bump=patch to increment patch version, or\n' +' --stable to promote current beta to stable, or\n' +' --version={version} to set version number directly\n' +'Note that you can use both --bump and --stable ' +'simultaneously.', formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument( '--version', default=None, dest='new_version', help='new version number' ) parser.add_argument( '--bump', action='store', default=None, dest='bump', help='increment [stable | beta | nightly]' ) parser.add_argument( '--dry-run', action='store_true', default= False, dest='dry_run', help='just to check that version number is correct' ) args = parser.parse_args() curr_version = get_electron_version() if args.bump not in ['stable', 'beta', 'nightly']: raise Exception('bump must be set to either stable, beta or nightly') if is_nightly(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_beta(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_stable(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': raise Exception("You can\'t bump to a beta from stable") elif args.bump == 'stable': version = get_next_stable_from_stable(curr_version) else: not_reached() else: raise Exception("Invalid current version: " + curr_version) if args.new_version == None and args.bump == None and args.stable == False: parser.print_help() return 1 versions = clean_parse_version(version) suffix = '' if '-' in version: suffix = '-' + version.split('-')[1] versions[3] = parse_version(version)[3] version = version.split('-')[0] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version, suffix) update_win_rc(version, versions) update_version_h(versions, suffix) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix) print 'Bumped to version: {0}'.format(version + suffix)
def main(): print get_electron_version()
def main(): parser = argparse.ArgumentParser( description= 'Bump version numbers. Must specify at least one of the three' + ' options:\n' + ' --bump=patch to increment patch version, or\n' + ' --stable to promote current beta to stable, or\n' + ' --version={version} to set version number directly\n' + 'Note that you can use both --bump and --stable ' + 'simultaneously.', formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('--version', default=None, dest='new_version', help='new version number') parser.add_argument('--bump', action='store', default=None, dest='bump', help='increment [major | minor | patch | beta]') parser.add_argument( '--stable', action='store_true', default=False, dest='stable', help='promote to stable (i.e. remove `-beta.x` suffix)') parser.add_argument('--dry-run', action='store_true', default=False, dest='dry_run', help='just to check that version number is correct') args = parser.parse_args() if args.new_version == None and args.bump == None and args.stable == False: parser.print_help() return 1 increments = ['major', 'minor', 'patch', 'beta'] curr_version = get_electron_version() versions = parse_version(re.sub('-beta', '', curr_version)) if args.bump in increments: versions = increase_version(versions, increments.index(args.bump)) if versions[3] == '0': # beta starts at 1 versions = increase_version(versions, increments.index('beta')) if args.stable == True: versions[3] = '0' if args.new_version != None: clean_version = re.sub('-beta', '', args.new_version) clean_version = re.sub('-nightly', '', clean_version) versions = parse_version(clean_version) version = '.'.join(versions[:3]) suffix = '' if args.new_version != None and '-nightly' in args.new_version: suffix = '-nightly.' + versions[3] elif versions[3] != '0': suffix = '-beta.' + versions[3] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version, suffix) update_win_rc(version, versions) update_version_h(versions, suffix) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix) print 'Bumped to version: {0}'.format(version + suffix)
def main(): parser = argparse.ArgumentParser( description='Bump version numbers. Must specify at least one of the three' +' options:\n' +' --bump=patch to increment patch version, or\n' +' --stable to promote current beta to stable, or\n' +' --version={version} to set version number directly\n' +'Note that you can use both --bump and --stable ' +'simultaneously.', formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument( '--version', default=None, dest='new_version', help='new version number' ) parser.add_argument( '--bump', action='store', default=None, dest='bump', help='increment [stable | beta | nightly]' ) parser.add_argument( '--dry-run', action='store_true', default= False, dest='dry_run', help='just to check that version number is correct' ) args = parser.parse_args() curr_version = get_electron_version() if args.bump not in ['stable', 'beta', 'nightly']: raise Exception('bump must be set to either stable, beta or nightly') if is_nightly(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_beta(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': version = get_next_beta(curr_version) elif args.bump == 'stable': version = get_next_stable_from_pre(curr_version) else: not_reached() elif is_stable(curr_version): if args.bump == 'nightly': version = get_next_nightly(curr_version) elif args.bump == 'beta': raise Exception("You can\'t bump to a beta from stable") elif args.bump == 'stable': version = get_next_stable_from_stable(curr_version) else: not_reached() else: raise Exception("Invalid current version: " + curr_version) if args.new_version is None and args.bump is None and not args.stable: parser.print_help() return 1 versions = clean_parse_version(version) suffix = '' if '-' in version: suffix = '-' + version.split('-')[1] versions[3] = parse_version(version)[3] version = version.split('-')[0] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_version(version, suffix) update_win_rc(version, versions, args.bump == "nightly") update_version_h(versions, suffix) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix) print 'Bumped to version: {0}'.format(version + suffix)
import os import shutil import subprocess import sys import tempfile from io import StringIO from lib.config import PLATFORM, get_target_arch, get_env_var, s3_config, \ get_zip_name from lib.util import get_electron_branding, execute, get_electron_version, \ scoped_cwd, s3put, get_electron_exec, \ get_out_dir, SRC_DIR ELECTRON_REPO = 'electron/electron' ELECTRON_VERSION = get_electron_version() PROJECT_NAME = get_electron_branding()['project_name'] PRODUCT_NAME = get_electron_branding()['product_name'] SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) OUT_DIR = get_out_dir() DIST_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION) SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols') DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym') PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb') def main(): args = parse_args()
def create_node_headers(): execute_stdout([sys.executable, os.path.join(SOURCE_ROOT, 'script', 'create-node-headers.py'), '--version', get_electron_version()])
import hashlib import os import shutil import subprocess import sys import tempfile from io import StringIO from lib.config import PLATFORM, get_target_arch, get_env_var, s3_config, \ get_zip_name from lib.util import electron_gyp, execute, get_electron_version, \ parse_version, scoped_cwd, s3put from lib.github import GitHub ELECTRON_REPO = 'electron/electron' ELECTRON_VERSION = get_electron_version() PROJECT_NAME = electron_gyp()['project_name%'] PRODUCT_NAME = electron_gyp()['product_name%'] SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R') DIST_DIR = os.path.join(SOURCE_ROOT, 'dist') DIST_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION) SYMBOLS_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'symbols') DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym') PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb') def main():
def main(): parser = argparse.ArgumentParser( description='Bump version numbers. Must specify at least one of the three' +' options:\n' +' --bump=patch to increment patch version, or\n' +' --stable to promote current beta to stable, or\n' +' --version={version} to set version number directly\n' +'Note that you can use both --bump and --stable ' +'simultaneously.', formatter_class=argparse.RawTextHelpFormatter ) parser.add_argument( '--version', default=None, dest='new_version', help='new version number' ) parser.add_argument( '--bump', action='store', default=None, dest='bump', help='increment [major | minor | patch | beta]' ) parser.add_argument( '--stable', action='store_true', default= False, dest='stable', help='promote to stable (i.e. remove `-beta.x` suffix)' ) parser.add_argument( '--dry-run', action='store_true', default= False, dest='dry_run', help='just to check that version number is correct' ) args = parser.parse_args() if args.new_version == None and args.bump == None and args.stable == False: parser.print_help() return 1 increments = ['major', 'minor', 'patch', 'beta'] curr_version = get_electron_version() versions = parse_version(re.sub('-beta', '', curr_version)) if args.bump in increments: versions = increase_version(versions, increments.index(args.bump)) if versions[3] == '0': # beta starts at 1 versions = increase_version(versions, increments.index('beta')) if args.stable == True: versions[3] = '0' if args.new_version != None: versions = parse_version(re.sub('-beta', '', args.new_version)) version = '.'.join(versions[:3]) suffix = '' if versions[3] == '0' else '-beta.' + versions[3] if args.dry_run: print 'new version number would be: {0}\n'.format(version + suffix) return 0 with scoped_cwd(SOURCE_ROOT): update_electron_gyp(version, suffix) update_win_rc(version, versions) update_version_h(versions) update_info_plist(version) update_package_json(version, suffix) tag_version(version, suffix)