commit
64aaa2bcb1
24 changed files with 277 additions and 190 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,4 +10,5 @@ node_modules/
|
|||
*.xcodeproj
|
||||
*.swp
|
||||
*.pyc
|
||||
debug.log
|
||||
npm-debug.log
|
||||
|
|
3
atom.gyp
3
atom.gyp
|
@ -2,6 +2,7 @@
|
|||
'variables': {
|
||||
'project_name%': 'atom',
|
||||
'product_name%': 'Atom',
|
||||
'version%': '0.23.0',
|
||||
|
||||
'atom_source_root': '<!(["python", "tools/atom_source_root.py"])',
|
||||
},
|
||||
|
@ -142,8 +143,6 @@
|
|||
'<(libchromiumcontent_dir)/natives_blob.bin',
|
||||
'<(libchromiumcontent_dir)/snapshot_blob.bin',
|
||||
'external_binaries/d3dcompiler_47.dll',
|
||||
'external_binaries/msvcp120.dll',
|
||||
'external_binaries/msvcr120.dll',
|
||||
'external_binaries/vccorlib120.dll',
|
||||
'external_binaries/xinput1_3.dll',
|
||||
],
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundleIconFile</key>
|
||||
<string>atom.icns</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.22.3</string>
|
||||
<string>0.23.0</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.8.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
|
|
|
@ -50,8 +50,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,22,3,0
|
||||
PRODUCTVERSION 0,22,3,0
|
||||
FILEVERSION 0,23,0,0
|
||||
PRODUCTVERSION 0,23,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -68,12 +68,12 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "GitHub, Inc."
|
||||
VALUE "FileDescription", "Atom-Shell"
|
||||
VALUE "FileVersion", "0.22.3"
|
||||
VALUE "FileVersion", "0.23.0"
|
||||
VALUE "InternalName", "atom.exe"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2013 GitHub, Inc. All rights reserved."
|
||||
VALUE "OriginalFilename", "atom.exe"
|
||||
VALUE "ProductName", "Atom-Shell"
|
||||
VALUE "ProductVersion", "0.22.3"
|
||||
VALUE "ProductVersion", "0.23.0"
|
||||
VALUE "SquirrelAwareVersion", "1"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#define ATOM_VERSION_H
|
||||
|
||||
#define ATOM_MAJOR_VERSION 0
|
||||
#define ATOM_MINOR_VERSION 22
|
||||
#define ATOM_PATCH_VERSION 3
|
||||
#define ATOM_MINOR_VERSION 23
|
||||
#define ATOM_PATCH_VERSION 0
|
||||
|
||||
#define ATOM_VERSION_IS_RELEASE 1
|
||||
|
||||
|
|
64
common.gypi
64
common.gypi
|
@ -107,27 +107,50 @@
|
|||
'OTHER_LDFLAGS': [ '-Wl,-all_load' ],
|
||||
},
|
||||
}],
|
||||
['OS=="win" and libchromiumcontent_component==0', {
|
||||
['OS=="win"', {
|
||||
'libraries': [ '-lwinmm.lib' ],
|
||||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
# There is nothing like "whole-archive" on Windows, so we
|
||||
# have to manually force some objets files to be included
|
||||
# by referencing them.
|
||||
'ForceSymbolReferences': [
|
||||
'_u_errorName_52',
|
||||
'_ubidi_setPara_52',
|
||||
'_ucsdet_getName_52',
|
||||
'_ulocdata_close_52',
|
||||
'_uregex_matches_52',
|
||||
'_uscript_getCode_52',
|
||||
'_usearch_setPattern_52',
|
||||
'?createInstance@Transliterator@icu_52@@SAPAV12@ABVUnicodeString@2@W4UTransDirection@@AAW4UErrorCode@@@Z',
|
||||
'?nameToUnicodeUTF8@IDNA@icu_52@@UBEXABVStringPiece@2@AAVByteSink@2@AAVIDNAInfo@2@AAW4UErrorCode@@@Z',
|
||||
'?kLineOffsetNotFound@Function@v8@@2HB',
|
||||
], # '/INCLUDE'
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
['libchromiumcontent_component==0', {
|
||||
'variables': {
|
||||
'conditions': [
|
||||
['target_arch=="ia32"', {
|
||||
'reference_symbols': [
|
||||
'_u_errorName_52',
|
||||
'_ubidi_setPara_52',
|
||||
'_ucsdet_getName_52',
|
||||
'_ulocdata_close_52',
|
||||
'_uregex_matches_52',
|
||||
'_uscript_getCode_52',
|
||||
'_usearch_setPattern_52',
|
||||
'?createInstance@Transliterator@icu_52@@SAPAV12@ABVUnicodeString@2@W4UTransDirection@@AAW4UErrorCode@@@Z',
|
||||
'?nameToUnicodeUTF8@IDNA@icu_52@@UBEXABVStringPiece@2@AAVByteSink@2@AAVIDNAInfo@2@AAW4UErrorCode@@@Z',
|
||||
'?kLineOffsetNotFound@Function@v8@@2HB',
|
||||
],
|
||||
}, {
|
||||
'reference_symbols': [
|
||||
'u_errorName_52',
|
||||
'ubidi_setPara_52',
|
||||
'ucsdet_getName_52',
|
||||
'uidna_openUTS46_52',
|
||||
'ulocdata_close_52',
|
||||
'uregex_matches_52',
|
||||
'uscript_getCode_52',
|
||||
'usearch_setPattern_52',
|
||||
'?createInstance@Transliterator@icu_52@@SAPEAV12@AEBVUnicodeString@2@W4UTransDirection@@AEAW4UErrorCode@@@Z'
|
||||
],
|
||||
}],
|
||||
],
|
||||
},
|
||||
'msvs_settings': {
|
||||
'VCLinkerTool': {
|
||||
# There is nothing like "whole-archive" on Windows, so we
|
||||
# have to manually force some objets files to be included
|
||||
# by referencing them.
|
||||
'ForceSymbolReferences': [ '<@(reference_symbols)' ], # '/INCLUDE'
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['OS=="linux" and libchromiumcontent_component==0', {
|
||||
# Prevent the linker from stripping symbols.
|
||||
|
@ -192,6 +215,7 @@
|
|||
4005, # (node.h) macro redefinition
|
||||
4189, # local variable is initialized but not referenced
|
||||
4201, # (uv.h) nameless struct/union
|
||||
4267, # conversion from 'size_t' to 'int', possible loss of data
|
||||
4503, # decorated name length exceeded, name was truncated
|
||||
4800, # (v8.h) forcing value to bool 'true' or 'false'
|
||||
4819, # The file contains a character that cannot be represented in the current code page
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
{
|
||||
"name": "atom-shell",
|
||||
"version": "0.22.3",
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/atom/atom-shell/raw/master/LICENSE.md"
|
||||
}
|
||||
],
|
||||
"devDependencies": {
|
||||
"asar": "0.2.2",
|
||||
"atom-package-manager": "0.144.0",
|
||||
"coffee-script": "~1.7.1",
|
||||
"coffeelint": "~1.3.0",
|
||||
"request": "*",
|
||||
|
|
|
@ -4,9 +4,9 @@ import argparse
|
|||
import os
|
||||
import sys
|
||||
|
||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, \
|
||||
enable_verbose_mode, is_verbose_mode
|
||||
from lib.util import execute_stdout, scoped_cwd
|
||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
|
||||
enable_verbose_mode, is_verbose_mode, get_target_arch
|
||||
from lib.util import execute_stdout, get_atom_shell_version, scoped_cwd
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
@ -19,8 +19,7 @@ def main():
|
|||
os.chdir(SOURCE_ROOT)
|
||||
|
||||
args = parse_args()
|
||||
if (args.yes is False and
|
||||
sys.platform not in ('win32', 'cygwin')):
|
||||
if not args.yes and PLATFORM != 'win32':
|
||||
check_root()
|
||||
if args.verbose:
|
||||
enable_verbose_mode()
|
||||
|
@ -28,12 +27,12 @@ def main():
|
|||
update_win32_python()
|
||||
update_submodules()
|
||||
update_node_modules('.')
|
||||
bootstrap_brightray(args.dev, args.url)
|
||||
bootstrap_brightray(args.dev, args.url, args.target_arch)
|
||||
|
||||
create_chrome_version_h()
|
||||
touch_config_gypi()
|
||||
update_atom_shell()
|
||||
update_atom_modules('spec')
|
||||
update_atom_modules('spec', args.target_arch)
|
||||
|
||||
|
||||
def parse_args():
|
||||
|
@ -53,8 +52,11 @@ def parse_args():
|
|||
action='store_true',
|
||||
help='Run non-interactively by assuming "yes" to all ' \
|
||||
'prompts.')
|
||||
parser.add_argument('--target_arch', default=get_target_arch(),
|
||||
help='Manually specify the arch to build for')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def check_root():
|
||||
if os.geteuid() == 0:
|
||||
print "We suggest not running this as root, unless you're really sure."
|
||||
|
@ -68,29 +70,34 @@ def update_submodules():
|
|||
execute_stdout(['git', 'submodule', 'update', '--init', '--recursive'])
|
||||
|
||||
|
||||
def bootstrap_brightray(is_dev, url):
|
||||
def bootstrap_brightray(is_dev, url, target_arch):
|
||||
bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap')
|
||||
args = ['--commit', LIBCHROMIUMCONTENT_COMMIT, url]
|
||||
args = [
|
||||
'--commit', LIBCHROMIUMCONTENT_COMMIT,
|
||||
'--target_arch', target_arch,
|
||||
url,
|
||||
]
|
||||
if is_dev:
|
||||
args = ['--dev'] + args
|
||||
execute_stdout([sys.executable, bootstrap] + args)
|
||||
|
||||
|
||||
def update_node_modules(dirname):
|
||||
def update_node_modules(dirname, env=None):
|
||||
if env is None:
|
||||
env = os.environ
|
||||
with scoped_cwd(dirname):
|
||||
if is_verbose_mode():
|
||||
execute_stdout([NPM, 'install', '--verbose'])
|
||||
execute_stdout([NPM, 'install', '--verbose'], env)
|
||||
else:
|
||||
execute_stdout([NPM, 'install'])
|
||||
execute_stdout([NPM, 'install'], env)
|
||||
|
||||
|
||||
def update_atom_modules(dirname):
|
||||
with scoped_cwd(dirname):
|
||||
apm = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'apm')
|
||||
if sys.platform in ['win32', 'cygwin']:
|
||||
apm = os.path.join(SOURCE_ROOT, 'node_modules', 'atom-package-manager',
|
||||
'bin', 'apm.cmd')
|
||||
execute_stdout([apm, 'install'])
|
||||
def update_atom_modules(dirname, target_arch):
|
||||
env = os.environ.copy()
|
||||
env['npm_config_arch'] = target_arch
|
||||
env['npm_config_target'] = get_atom_shell_version()
|
||||
env['npm_config_disturl'] = 'https://atom.io/download/atom-shell'
|
||||
update_node_modules(dirname, env)
|
||||
|
||||
|
||||
def update_win32_python():
|
||||
|
|
|
@ -27,12 +27,11 @@ def main():
|
|||
version = '.'.join(versions[:3])
|
||||
|
||||
with scoped_cwd(SOURCE_ROOT):
|
||||
update_package_json(version)
|
||||
update_atom_gyp(version)
|
||||
update_win_rc(version, versions)
|
||||
update_version_h(versions)
|
||||
update_info_plist(version)
|
||||
tag_version(version)
|
||||
git_push()
|
||||
|
||||
|
||||
def increase_version(versions, index):
|
||||
|
@ -42,15 +41,15 @@ def increase_version(versions, index):
|
|||
return versions
|
||||
|
||||
|
||||
def update_package_json(version):
|
||||
pattern = re.compile(' *"version" *: *"[0-9.]+"')
|
||||
with open('package.json', 'r') as f:
|
||||
def update_atom_gyp(version):
|
||||
pattern = re.compile(" *'version%' *: *'[0-9.]+'")
|
||||
with open('atom.gyp', 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
for i in range(0, len(lines)):
|
||||
if pattern.match(lines[i]):
|
||||
lines[i] = ' "version": "{0}",\n'.format(version)
|
||||
with open('package.json', 'w') as f:
|
||||
lines[i] = " 'version%': '{0}',\n".format(version)
|
||||
with open('atom.gyp', 'w') as f:
|
||||
f.write(''.join(lines))
|
||||
return
|
||||
|
||||
|
@ -118,10 +117,5 @@ def tag_version(version):
|
|||
execute(['git', 'tag', 'v{0}'.format(version)])
|
||||
|
||||
|
||||
def git_push():
|
||||
execute(['git', 'push'])
|
||||
execute(['git', 'push', '--tags'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
20
script/clean.py
Executable file
20
script/clean.py
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from lib.util import rm_rf
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
||||
|
||||
def main():
|
||||
os.chdir(SOURCE_ROOT)
|
||||
rm_rf('node_modules')
|
||||
rm_rf('out')
|
||||
rm_rf('spec/node_modules')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
|
@ -7,8 +7,8 @@ import subprocess
|
|||
import sys
|
||||
import stat
|
||||
|
||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
|
||||
DIST_ARCH
|
||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
|
||||
get_target_arch
|
||||
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
|
||||
execute, get_chromedriver_version
|
||||
|
||||
|
@ -79,7 +79,7 @@ def main():
|
|||
copy_chromedriver()
|
||||
copy_license()
|
||||
|
||||
if TARGET_PLATFORM == 'linux':
|
||||
if PLATFORM == 'linux':
|
||||
strip_binaries()
|
||||
copy_system_libraries()
|
||||
|
||||
|
@ -95,17 +95,17 @@ def force_build():
|
|||
|
||||
|
||||
def copy_binaries():
|
||||
for binary in TARGET_BINARIES[TARGET_PLATFORM]:
|
||||
for binary in TARGET_BINARIES[PLATFORM]:
|
||||
shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR)
|
||||
|
||||
for directory in TARGET_DIRECTORIES[TARGET_PLATFORM]:
|
||||
for directory in TARGET_DIRECTORIES[PLATFORM]:
|
||||
shutil.copytree(os.path.join(OUT_DIR, directory),
|
||||
os.path.join(DIST_DIR, directory),
|
||||
symlinks=True)
|
||||
|
||||
|
||||
def copy_chromedriver():
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
if PLATFORM == 'win32':
|
||||
chromedriver = 'chromedriver.exe'
|
||||
else:
|
||||
chromedriver = 'chromedriver'
|
||||
|
@ -122,7 +122,7 @@ def copy_license():
|
|||
|
||||
|
||||
def strip_binaries():
|
||||
for binary in TARGET_BINARIES[TARGET_PLATFORM]:
|
||||
for binary in TARGET_BINARIES[PLATFORM]:
|
||||
if binary.endswith('.so') or '.' not in binary:
|
||||
execute(['strip', os.path.join(DIST_DIR, binary)])
|
||||
|
||||
|
@ -155,25 +155,25 @@ def create_symbols():
|
|||
|
||||
def create_dist_zip():
|
||||
dist_name = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
|
||||
TARGET_PLATFORM, DIST_ARCH)
|
||||
PLATFORM, get_target_arch())
|
||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||
|
||||
with scoped_cwd(DIST_DIR):
|
||||
files = TARGET_BINARIES[TARGET_PLATFORM] + ['LICENSE', 'version']
|
||||
if TARGET_PLATFORM == 'linux':
|
||||
files = TARGET_BINARIES[PLATFORM] + ['LICENSE', 'version']
|
||||
if PLATFORM == 'linux':
|
||||
files += [lib for lib in SYSTEM_LIBRARIES if os.path.exists(lib)]
|
||||
dirs = TARGET_DIRECTORIES[TARGET_PLATFORM]
|
||||
dirs = TARGET_DIRECTORIES[PLATFORM]
|
||||
make_zip(zip_file, files, dirs)
|
||||
|
||||
|
||||
def create_chromedriver_zip():
|
||||
dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(get_chromedriver_version(),
|
||||
TARGET_PLATFORM, DIST_ARCH)
|
||||
PLATFORM, get_target_arch())
|
||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||
|
||||
with scoped_cwd(DIST_DIR):
|
||||
files = ['LICENSE']
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
if PLATFORM == 'win32':
|
||||
files += ['chromedriver.exe']
|
||||
else:
|
||||
files += ['chromedriver']
|
||||
|
@ -182,8 +182,8 @@ def create_chromedriver_zip():
|
|||
|
||||
def create_symbols_zip():
|
||||
dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
|
||||
TARGET_PLATFORM,
|
||||
DIST_ARCH)
|
||||
PLATFORM,
|
||||
get_target_arch())
|
||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||
|
||||
with scoped_cwd(DIST_DIR):
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from lib.config import TARGET_PLATFORM
|
||||
from lib.util import execute, rm_rf
|
||||
from lib.config import PLATFORM
|
||||
from lib.util import atom_gyp, execute, rm_rf
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
@ -15,20 +15,20 @@ CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
|||
|
||||
|
||||
def main(destination):
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
if PLATFORM == 'win32':
|
||||
register_required_dll()
|
||||
|
||||
rm_rf(destination)
|
||||
(project_name, product_name) = get_names_from_gyp()
|
||||
|
||||
if TARGET_PLATFORM in ['darwin', 'linux']:
|
||||
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 TARGET_PLATFORM == 'darwin':
|
||||
if PLATFORM == 'darwin':
|
||||
start = os.path.join(OUT_DIR, '{0}.app'.format(product_name), 'Contents',
|
||||
'MacOS', product_name)
|
||||
else:
|
||||
|
@ -60,10 +60,8 @@ def register_required_dll():
|
|||
|
||||
|
||||
def get_names_from_gyp():
|
||||
gyp = os.path.join(SOURCE_ROOT, 'atom.gyp')
|
||||
with open(gyp) as f:
|
||||
o = eval(f.read());
|
||||
return (o['variables']['project_name%'], o['variables']['product_name%'])
|
||||
variables = atom_gyp()
|
||||
return (variables['project_name%'], variables['product_name%'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -1,23 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import errno
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
|
||||
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
|
||||
LIBCHROMIUMCONTENT_COMMIT = 'f1ad1412461ba3345a27cfe935ffc872dba0ac5b'
|
||||
|
||||
ARCH = {
|
||||
'cygwin': '32bit',
|
||||
'darwin': '64bit',
|
||||
'linux2': platform.architecture()[0],
|
||||
'win32': '32bit',
|
||||
}[sys.platform]
|
||||
DIST_ARCH = {
|
||||
'32bit': 'ia32',
|
||||
'64bit': 'x64',
|
||||
}[ARCH]
|
||||
|
||||
TARGET_PLATFORM = {
|
||||
PLATFORM = {
|
||||
'cygwin': 'win32',
|
||||
'darwin': 'darwin',
|
||||
'linux2': 'linux',
|
||||
|
@ -26,10 +18,51 @@ TARGET_PLATFORM = {
|
|||
|
||||
verbose_mode = False
|
||||
|
||||
|
||||
def get_target_arch():
|
||||
# Always build 64bit on OS X.
|
||||
if PLATFORM == 'darwin':
|
||||
return 'x64'
|
||||
# Only build for host's arch on Linux.
|
||||
elif PLATFORM == 'linux':
|
||||
if platform.architecture()[0] == '32bit':
|
||||
return 'ia32'
|
||||
else:
|
||||
return 'x64'
|
||||
# On Windows it depends on user.
|
||||
elif PLATFORM == 'win32':
|
||||
try:
|
||||
target_arch_path = os.path.join(__file__, '..', '..', '..', 'vendor',
|
||||
'brightray', 'vendor', 'download',
|
||||
'libchromiumcontent', '.target_arch')
|
||||
with open(os.path.normpath(target_arch_path)) as f:
|
||||
return f.read().strip()
|
||||
except IOError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
# Build 32bit by default.
|
||||
return 'ia32'
|
||||
# Maybe we will support other platforms in future.
|
||||
else:
|
||||
return 'x64'
|
||||
|
||||
|
||||
def s3_config():
|
||||
config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''),
|
||||
os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''),
|
||||
os.environ.get('ATOM_SHELL_S3_SECRET_KEY', ''))
|
||||
message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, '
|
||||
'$ATOM_SHELL_S3_ACCESS_KEY, and '
|
||||
'$ATOM_SHELL_S3_SECRET_KEY environment variables')
|
||||
assert all(len(c) for c in config), message
|
||||
return config
|
||||
|
||||
|
||||
def enable_verbose_mode():
|
||||
print 'Running in verbose mode'
|
||||
global verbose_mode
|
||||
verbose_mode = True
|
||||
|
||||
|
||||
def is_verbose_mode():
|
||||
return verbose_mode
|
||||
|
|
|
@ -129,11 +129,11 @@ def safe_mkdir(path):
|
|||
raise
|
||||
|
||||
|
||||
def execute(argv):
|
||||
def execute(argv, env=os.environ):
|
||||
if is_verbose_mode():
|
||||
print ' '.join(argv)
|
||||
try:
|
||||
output = subprocess.check_output(argv, stderr=subprocess.STDOUT)
|
||||
output = subprocess.check_output(argv, stderr=subprocess.STDOUT, env=env)
|
||||
if is_verbose_mode():
|
||||
print output
|
||||
return output
|
||||
|
@ -142,20 +142,28 @@ def execute(argv):
|
|||
raise e
|
||||
|
||||
|
||||
def execute_stdout(argv):
|
||||
def execute_stdout(argv, env=os.environ):
|
||||
if is_verbose_mode():
|
||||
print ' '.join(argv)
|
||||
try:
|
||||
subprocess.check_call(argv)
|
||||
subprocess.check_call(argv, env=env)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print e.output
|
||||
raise e
|
||||
else:
|
||||
execute(argv)
|
||||
execute(argv, env)
|
||||
|
||||
|
||||
def atom_gyp():
|
||||
SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
|
||||
gyp = os.path.join(SOURCE_ROOT, 'atom.gyp')
|
||||
with open(gyp) as f:
|
||||
obj = eval(f.read());
|
||||
return obj['variables']
|
||||
|
||||
|
||||
def get_atom_shell_version():
|
||||
return subprocess.check_output(['git', 'describe', '--tags']).strip()
|
||||
return atom_gyp()['version%']
|
||||
|
||||
|
||||
def get_chromedriver_version():
|
||||
|
@ -176,17 +184,6 @@ def parse_version(version):
|
|||
return vs + ['0'] * (4 - len(vs))
|
||||
|
||||
|
||||
def s3_config():
|
||||
config = (os.environ.get('ATOM_SHELL_S3_BUCKET', ''),
|
||||
os.environ.get('ATOM_SHELL_S3_ACCESS_KEY', ''),
|
||||
os.environ.get('ATOM_SHELL_S3_SECRET_KEY', ''))
|
||||
message = ('Error: Please set the $ATOM_SHELL_S3_BUCKET, '
|
||||
'$ATOM_SHELL_S3_ACCESS_KEY, and '
|
||||
'$ATOM_SHELL_S3_SECRET_KEY environment variables')
|
||||
assert all(len(c) for c in config), message
|
||||
return config
|
||||
|
||||
|
||||
def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
|
||||
args = [
|
||||
's3put',
|
||||
|
|
|
@ -4,7 +4,7 @@ import os
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from lib.config import DIST_ARCH
|
||||
from lib.config import get_target_arch
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
@ -23,14 +23,6 @@ def update_external_binaries():
|
|||
|
||||
|
||||
def update_gyp():
|
||||
target_arch = DIST_ARCH
|
||||
if sys.platform == 'darwin':
|
||||
# Only have 64bit build on OS X.
|
||||
target_arch = 'x64'
|
||||
elif sys.platform in ['cygwin', 'win32']:
|
||||
# Only have 32bit build on Windows.
|
||||
target_arch = 'ia32'
|
||||
|
||||
# Since gyp doesn't support specify link_settings for each configuration,
|
||||
# we are not able to link to different libraries in "Debug" and "Release"
|
||||
# configurations.
|
||||
|
@ -38,6 +30,7 @@ def update_gyp():
|
|||
# for twice, one is to generate "Debug" config, the other one to generate
|
||||
# the "Release" config. And the settings are controlled by the variable
|
||||
# "libchromiumcontent_component" which is defined before running gyp.
|
||||
target_arch = get_target_arch()
|
||||
return (run_gyp(target_arch, 0) or run_gyp(target_arch, 1))
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ import hashlib
|
|||
import os
|
||||
import tempfile
|
||||
|
||||
from lib.util import download, rm_rf, s3_config, s3put
|
||||
from lib.config import s3_config
|
||||
from lib.util import download, rm_rf, s3put
|
||||
|
||||
|
||||
DIST_URL = 'https://atom.io/download/atom-shell/'
|
||||
|
|
31
script/upload-index-json.py
Executable file
31
script/upload-index-json.py
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from lib.config import PLATFORM, s3_config
|
||||
from lib.util import execute, s3put, scoped_cwd
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
||||
|
||||
|
||||
def main():
|
||||
# Upload the index.json.
|
||||
with scoped_cwd(SOURCE_ROOT):
|
||||
atom_shell = os.path.join(OUT_DIR, 'atom')
|
||||
if PLATFORM == 'win32':
|
||||
atom_shell += '.exe'
|
||||
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
|
||||
execute([atom_shell,
|
||||
os.path.join('tools', 'dump-version-info.js'),
|
||||
index_json])
|
||||
|
||||
bucket, access_key, secret_key = s3_config()
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
|
||||
[index_json])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
|
@ -7,8 +7,8 @@ import shutil
|
|||
import sys
|
||||
import tarfile
|
||||
|
||||
from lib.config import TARGET_PLATFORM
|
||||
from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put
|
||||
from lib.config import PLATFORM, get_target_arch, s3_config
|
||||
from lib.util import execute, safe_mkdir, scoped_cwd, s3put
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
@ -47,11 +47,6 @@ def main():
|
|||
bucket, access_key, secret_key = s3_config()
|
||||
upload_node(bucket, access_key, secret_key, args.version)
|
||||
|
||||
# Upload the SHASUMS.txt.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
|
||||
'-v', args.version])
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='upload sumsha file')
|
||||
|
@ -109,39 +104,21 @@ def upload_node(bucket, access_key, secret_key, version):
|
|||
s3put(bucket, access_key, secret_key, DIST_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
|
||||
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
if PLATFORM == 'win32':
|
||||
if get_target_arch() == 'ia32':
|
||||
node_lib = os.path.join(DIST_DIR, 'node.lib')
|
||||
else:
|
||||
node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
|
||||
safe_mkdir(os.path.dirname(node_lib))
|
||||
|
||||
# Copy atom.lib to node.lib
|
||||
node_lib = os.path.join(OUT_DIR, 'node.lib')
|
||||
atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
|
||||
shutil.copy2(atom_lib, node_lib)
|
||||
|
||||
# Upload the 32bit node.lib.
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR,
|
||||
# Upload the node.lib.
|
||||
s3put(bucket, access_key, secret_key, DIST_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the fake 64bit node.lib.
|
||||
touch_x64_node_lib()
|
||||
node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the index.json
|
||||
with scoped_cwd(SOURCE_ROOT):
|
||||
atom_shell = os.path.join(OUT_DIR, 'atom.exe')
|
||||
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
|
||||
execute([atom_shell,
|
||||
os.path.join('script', 'dump-version-info.js'),
|
||||
index_json])
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
|
||||
[index_json])
|
||||
|
||||
|
||||
def touch_x64_node_lib():
|
||||
x64_dir = os.path.join(OUT_DIR, 'x64')
|
||||
safe_mkdir(x64_dir)
|
||||
with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib:
|
||||
node_lib.write('Invalid library')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
import os
|
||||
import glob
|
||||
|
||||
from lib.util import execute, rm_rf, safe_mkdir, s3put, s3_config
|
||||
from lib.config import s3_config
|
||||
from lib.util import execute, rm_rf, safe_mkdir, s3put
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
@ -11,6 +12,7 @@ SYMBOLS_DIR = 'dist\\symbols'
|
|||
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent'
|
||||
PDB_LIST = [
|
||||
'out\\R\\atom.exe.pdb',
|
||||
'out\\R\\node.dll.pdb',
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import subprocess
|
|||
import sys
|
||||
import tempfile
|
||||
|
||||
from lib.config import DIST_ARCH, TARGET_PLATFORM
|
||||
from lib.config import PLATFORM, get_target_arch
|
||||
from lib.util import execute, get_atom_shell_version, parse_version, \
|
||||
get_chromedriver_version, scoped_cwd
|
||||
from lib.github import GitHub
|
||||
|
@ -21,14 +21,14 @@ 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 = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
|
||||
TARGET_PLATFORM,
|
||||
DIST_ARCH)
|
||||
PLATFORM,
|
||||
get_target_arch())
|
||||
SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
|
||||
TARGET_PLATFORM,
|
||||
DIST_ARCH)
|
||||
PLATFORM,
|
||||
get_target_arch())
|
||||
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
|
||||
TARGET_PLATFORM,
|
||||
DIST_ARCH)
|
||||
PLATFORM,
|
||||
get_target_arch())
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -46,9 +46,26 @@ def main():
|
|||
sys.stderr.flush()
|
||||
return 1
|
||||
|
||||
# Upload atom-shell with GitHub Releases API.
|
||||
github = GitHub(auth_token())
|
||||
release_id = create_or_get_release_draft(github, args.version)
|
||||
|
||||
if args.publish_release:
|
||||
# Upload the SHASUMS.txt.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
|
||||
'-v', ATOM_SHELL_VERSION])
|
||||
|
||||
# Upload the index.json.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py')])
|
||||
|
||||
# Press the publish button.
|
||||
publish_release(github, release_id)
|
||||
|
||||
# Do not upload other files when passed "-p".
|
||||
return
|
||||
|
||||
# Upload atom-shell with GitHub Releases API.
|
||||
upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME))
|
||||
upload_atom_shell(github, release_id, os.path.join(DIST_DIR, SYMBOLS_NAME))
|
||||
|
||||
|
@ -57,19 +74,15 @@ def main():
|
|||
upload_atom_shell(github, release_id,
|
||||
os.path.join(DIST_DIR, CHROMEDRIVER_NAME))
|
||||
|
||||
if args.publish_release:
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
# Upload PDBs to Windows symbol server.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')])
|
||||
if PLATFORM == 'win32':
|
||||
# Upload PDBs to Windows symbol server.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')])
|
||||
|
||||
# Upload node headers.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
|
||||
'-v', ATOM_SHELL_VERSION])
|
||||
|
||||
# Press the publish button.
|
||||
publish_release(github, release_id)
|
||||
# Upload node headers.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
|
||||
'-v', ATOM_SHELL_VERSION])
|
||||
|
||||
|
||||
def parse_args():
|
||||
|
@ -83,10 +96,10 @@ def parse_args():
|
|||
|
||||
|
||||
def get_atom_shell_build_version():
|
||||
if TARGET_PLATFORM == 'darwin':
|
||||
if PLATFORM == 'darwin':
|
||||
atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'Atom.app',
|
||||
'Contents', 'MacOS', 'Atom')
|
||||
elif TARGET_PLATFORM == 'win32':
|
||||
elif PLATFORM == 'win32':
|
||||
atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'atom.exe')
|
||||
else:
|
||||
atom_shell = os.path.join(SOURCE_ROOT, 'out', 'R', 'atom')
|
||||
|
|
|
@ -17,6 +17,9 @@ describe 'crash-reporter module', ->
|
|||
beforeEach -> w = new BrowserWindow(show: false)
|
||||
afterEach -> w.destroy()
|
||||
|
||||
# It is not working on 64bit Windows.
|
||||
return if process.platform is 'win32' and process.arch is 'x64'
|
||||
|
||||
it 'should send minidump when renderer crashes', (done) ->
|
||||
@timeout 60000
|
||||
server = http.createServer (req, res) ->
|
||||
|
|
|
@ -43,6 +43,8 @@ function getInfoForCurrentVersion() {
|
|||
'linux-x64-symbols',
|
||||
'win32-ia32',
|
||||
'win32-ia32-symbols',
|
||||
'win32-x64',
|
||||
'win32-x64-symbols',
|
||||
];
|
||||
|
||||
return json;
|
2
vendor/breakpad
vendored
2
vendor/breakpad
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 1e937567e92d2c3beed4556f3c68a4b0362b1e6d
|
||||
Subproject commit 4427c1170387afe46eb3fad259436f1f9f5efa86
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
|||
Subproject commit f2b33daa4ea5a1e1ba0a5b18a3f0470d99b6f962
|
||||
Subproject commit 80a002c4a239f347cc4e0eea7378054977520726
|
Loading…
Reference in a new issue