]> khamidou — GitHub mirrors - electron.git/commitdiff
TARGET_PLATFORM => PLATFORM
authorCheng Zhao <zcbenz@gmail.com>
Sat, 11 Apr 2015 09:30:52 +0000 (17:30 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 11 Apr 2015 09:30:52 +0000 (17:30 +0800)
TARGET_PLATFORM is quite misleading since it is actually host platform.

script/bootstrap.py
script/create-dist.py
script/dump-symbols.py
script/lib/config.py
script/upload-node-headers.py
script/upload.py

index ececbb6eae99a018eb3749f58315262050edb12c..5dd2488902eccfeb57ffcf6120f46a4bdd6b07ac 100755 (executable)
@@ -4,7 +4,7 @@ import argparse
 import os
 import sys
 
-from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
+from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
                        enable_verbose_mode, is_verbose_mode
 from lib.util import execute_stdout, scoped_cwd
 
@@ -19,7 +19,7 @@ def main():
   os.chdir(SOURCE_ROOT)
 
   args = parse_args()
-  if not args.yes and TARGET_PLATFORM != 'win32':
+  if not args.yes and PLATFORM != 'win32':
     check_root()
   if args.verbose:
     enable_verbose_mode()
index faa04038b1e0b0d043383be6790528b34a7e7fe2..4d1ae544c1b33deeede4839783d3a6c3ec3b95b6 100755 (executable)
@@ -7,7 +7,7 @@ import subprocess
 import sys
 import stat
 
-from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
+from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
                        DIST_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, DIST_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, DIST_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,7 +182,7 @@ def create_chromedriver_zip():
 
 def create_symbols_zip():
   dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
-                                                          TARGET_PLATFORM,
+                                                          PLATFORM,
                                                           DIST_ARCH)
   zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
 
index 10471517b6982831cd60f24f88ffa85e5eca6428..ccad30227bae081ad740d6f2e541ca1400a9286b 100755 (executable)
@@ -3,7 +3,7 @@
 import os
 import sys
 
-from lib.config import TARGET_PLATFORM
+from lib.config import PLATFORM
 from lib.util import execute, rm_rf
 
 
@@ -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:
index 388ca02fffa958bdb622ba97a0c5ac36e22a18b5..2c2a7eda41aa8d321e1bae4c1ad493bcf4c75c14 100644 (file)
@@ -17,7 +17,7 @@ DIST_ARCH = {
     '64bit': 'x64',
 }[ARCH]
 
-TARGET_PLATFORM = {
+PLATFORM = {
   'cygwin': 'win32',
   'darwin': 'darwin',
   'linux2': 'linux',
index 7add94b33429479b0775e67b4c63d12542ac0924..a971af78e5ff9b8decfd366ccb0deb538f42bce1 100755 (executable)
@@ -7,7 +7,7 @@ import shutil
 import sys
 import tarfile
 
-from lib.config import TARGET_PLATFORM
+from lib.config import PLATFORM
 from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put
 
 
@@ -109,7 +109,7 @@ 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':
     # 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')
index 677247a2e6e75dad127c57eb3afbc494341be273..0c2b2ba6a32bc62be8b0db13301205449151e71f 100755 (executable)
@@ -7,7 +7,7 @@ import subprocess
 import sys
 import tempfile
 
-from lib.config import DIST_ARCH, TARGET_PLATFORM
+from lib.config import DIST_ARCH, PLATFORM
 from lib.util import execute, get_atom_shell_version, parse_version, \
                      get_chromedriver_version, scoped_cwd
 from lib.github import GitHub
@@ -21,13 +21,13 @@ 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,
+                                                PLATFORM,
                                                 DIST_ARCH)
 SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
-                                                           TARGET_PLATFORM,
+                                                           PLATFORM,
                                                            DIST_ARCH)
 CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
-                                                          TARGET_PLATFORM,
+                                                          PLATFORM,
                                                           DIST_ARCH)
 
 
@@ -58,7 +58,7 @@ def main():
                       os.path.join(DIST_DIR, CHROMEDRIVER_NAME))
 
   if args.publish_release:
-    if TARGET_PLATFORM == 'win32':
+    if PLATFORM == 'win32':
       # Upload PDBs to Windows symbol server.
       execute([sys.executable,
                os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')])
@@ -83,10 +83,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')