Merge branch 'master' into linux

Conflicts:
	atom.gyp
	vendor/apm
	vendor/brightray
This commit is contained in:
Cheng Zhao 2014-02-14 13:17:00 +00:00
commit 4051d2ebdb
85 changed files with 611 additions and 473 deletions

View file

@ -5,12 +5,12 @@ import os
import subprocess
import sys
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL
from lib.util import scoped_cwd
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26'
@ -52,7 +52,8 @@ def update_submodules():
def bootstrap_brightray(url):
bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap')
subprocess.check_call([sys.executable, bootstrap, url])
subprocess.check_call([sys.executable, bootstrap, '--commit',
LIBCHROMIUMCONTENT_COMMIT, url])
def update_apm():

View file

@ -5,34 +5,51 @@ import re
import subprocess
import sys
from lib.util import get_atom_shell_version, scoped_cwd
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
if len(sys.argv) != 2:
print 'Usage: bump-version.py version'
if len(sys.argv) != 2 or sys.argv[1] == '-h':
print 'Usage: bump-version.py [<version> | major | minor | patch]'
return 1
version = sys.argv[1]
if version[0] == 'v':
version = version[1:]
versions = parse_version(version)
option = sys.argv[1]
increments = ['major', 'minor', 'patch', 'build']
if option in increments:
version = get_atom_shell_version()
versions = parse_version(version.split('-')[0])
versions = increase_version(versions, increments.index(option))
else:
versions = parse_version(option)
os.chdir(SOURCE_ROOT)
update_package_json(version)
update_win_rc(version, versions)
update_version_h(versions)
update_info_plist(version)
tag_version(version)
version = '.'.join(versions[:3])
with scoped_cwd(SOURCE_ROOT):
update_package_json(version)
update_win_rc(version, versions)
update_version_h(versions)
update_info_plist(version)
tag_version(version)
git_push()
def parse_version(version):
if version[0] == 'v':
version = version[1:]
vs = version.split('.')
if len(vs) > 4:
return vs[0:4]
else:
return vs + [0] * (4 - len(vs))
return vs + ['0'] * (4 - len(vs))
def increase_version(versions, index):
versions[index] = str(int(versions[index]) + 1)
return versions
def update_package_json(version):
@ -54,7 +71,7 @@ def update_win_rc(version, versions):
pattern_fvs = re.compile(' *VALUE "FileVersion", "[0-9.]+"')
pattern_pvs = re.compile(' *VALUE "ProductVersion", "[0-9.]+"')
win_rc = os.path.join('app', 'win', 'atom.rc')
win_rc = os.path.join('browser', 'resources', 'win', 'atom.rc')
with open(win_rc, 'r') as f:
lines = f.readlines()
@ -92,7 +109,7 @@ def update_version_h(versions):
def update_info_plist(version):
info_plist = os.path.join('browser', 'mac', 'Info.plist')
info_plist = os.path.join('browser', 'resources', 'mac', 'Info.plist')
with open(info_plist, 'r') as f:
lines = f.readlines()
@ -112,5 +129,9 @@ def tag_version(version):
subprocess.check_call(['git', 'tag', 'v{0}'.format(version)])
def git_push():
subprocess.check_call(['git', 'push'])
if __name__ == '__main__':
sys.exit(main())

View file

@ -13,6 +13,7 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
rm_rf(os.path.join(SOURCE_ROOT, 'out'))
rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))
rm_rf(os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
'libchromiumcontent'))

8
script/cpplint.py vendored
View file

@ -6,13 +6,13 @@ import subprocess
import sys
IGNORE_FILES = [
'app/win/resource.h',
'browser/atom_application_mac.h',
'browser/atom_application_delegate_mac.h',
'browser/native_window_mac.h',
'browser/ui/atom_event_processing_window.h',
'browser/ui/atom_menu_controller_mac.h',
'browser/ui/nsalert_synchronous_sheet_mac.h',
'browser/resources/win/resource.h',
'browser/ui/cocoa/event_processing_window.h',
'browser/ui/cocoa/atom_menu_controller.h',
'browser/ui/cocoa/nsalert_synchronous_sheet.h',
'common/api/api_messages.cc',
'common/api/api_messages.h',
'common/atom_version.h',

View file

@ -7,13 +7,12 @@ import subprocess
import sys
import tarfile
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, NODE_VERSION
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
safe_mkdir
ATOM_SHELL_VRESION = get_atom_shell_version()
NODE_VERSION = 'v0.11.10'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
@ -163,7 +162,8 @@ def download_libchromiumcontent_symbols(url):
download = os.path.join(brightray_dir, 'libchromiumcontent', 'script',
'download')
subprocess.check_call([sys.executable, download, '-f', '-s', url, target_dir])
subprocess.check_call([sys.executable, download, '-f', '-s', '-c',
LIBCHROMIUMCONTENT_COMMIT, url, target_dir])
def create_symbols():

5
script/lib/config.py Normal file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
NODE_VERSION = 'v0.11.10'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'b27290717c08f8c6a58067d3c3725d68b4e6a2e5'

View file

@ -1,54 +0,0 @@
#!/usr/bin/env coffee
# Usage:
# Copy the crash log into pasteboard and then run
# pbpaste | ./script/translate-crash-log-addresses.coffee
atos = (addresses, callback) ->
path = require 'path'
exec = require('child_process').exec
exec 'atos -o vendor/brightray/vendor/download/libchromiumcontent/Release/libchromiumcontent.dylib -arch i386 '.concat(addresses...), (error, stdout, stderr) ->
throw error if error?
callback stdout.split('\n')
parse_stack_trace = (raw) ->
lines = {}
addresses = []
for line in raw
columns = line.split /\ +/
if columns[1] == 'libchromiumcontent.dylib' and /0x[a-f0-9]+/.test columns[3]
lines[columns[0]] = addresses.length
addresses.push '0x' + parseInt(columns[5]).toString(16) + ' '
atos addresses, (parsed) ->
for line in raw
columns = line.split /\ +/
frame = columns[0]
if lines[frame]?
console.log frame, parsed[lines[frame]]
else
console.log line
parse_log_file = (content) ->
state = 'start'
stack_trace = []
lines = content.split /\r?\n/
for line in lines
if state == 'start'
if /Thread \d+ Crashed::/.test line
console.log line
state = 'parse'
else if state == 'parse'
break if line == ''
stack_trace.push line
parse_stack_trace stack_trace
input = ''
process.stdin.resume()
process.stdin.setEncoding 'utf8'
process.stdin.on 'data', (chunk) ->
input += chunk
process.stdin.on 'end', ->
parse_log_file input

View file

@ -7,13 +7,15 @@ from lib.util import safe_mkdir, extract_zip, tempdir, download
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
FRAMEWORKS_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/frameworks'
FRAMEWORKS_URL = 'http://atom-alpha.s3.amazonaws.com'
def main():
os.chdir(SOURCE_ROOT)
safe_mkdir('frameworks')
download_and_unzip('Sparkle')
download_and_unzip('Mantle')
download_and_unzip('ReactiveCocoa')
download_and_unzip('Squirrel')
def download_and_unzip(framework):

View file

@ -8,6 +8,7 @@ import subprocess
import sys
import tempfile
from lib.config import NODE_VERSION
from lib.util import get_atom_shell_version, scoped_cwd, safe_mkdir
from lib.github import GitHub
@ -21,7 +22,6 @@ TARGET_PLATFORM = {
ATOM_SHELL_REPO = 'atom/atom-shell'
ATOM_SHELL_VRESION = get_atom_shell_version()
NODE_VERSION = 'v0.11.10'
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release')