]> khamidou — GitHub mirrors - electron.git/commitdiff
Ship correct binaries on Windows.
authorCheng Zhao <zcbenz@gmail.com>
Sat, 31 Aug 2013 01:06:27 +0000 (09:06 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 31 Aug 2013 01:06:27 +0000 (09:06 +0800)
script/create-dist.py

index ad76e4bc12fd7789af8d0ff6e0839d3dcbc0643f..8e40919bec2f26a180e97f4afdd8570762b73c4a 100755 (executable)
@@ -17,8 +17,32 @@ NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node')
 DIST_HEADERS_NAME = 'node-{0}'.format(get_atom_shell_version())
 DIST_HEADERS_DIR = os.path.join(DIST_DIR, DIST_HEADERS_NAME)
 
-BUNDLE_NAME = 'Atom.app'
-BUNDLE_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release', BUNDLE_NAME)
+TARGET_PLATFORM = {
+  'cygwin': 'win32',
+  'darwin': 'darwin',
+  'linux2': 'linux',
+  'win32': 'win32',
+}[sys.platform]
+
+TARGET_BINARIES = {
+  'darwin': [
+  ],
+  'win32': [
+    'atom.exe',
+    'chromiumcontent.dll',
+    'content_shell.pak',
+    'icudt.dll',
+    'libGLESv2.dll',
+  ],
+}
+TARGET_DIRECTORIES = {
+  'darwin': [
+    'Atom.app',
+  ],
+  'win32': [
+    'resources',
+  ],
+}
 
 HEADERS_SUFFIX = [
   '.h',
@@ -55,8 +79,15 @@ def force_build():
 
 
 def copy_binaries():
-  shutil.copytree(BUNDLE_DIR, os.path.join(DIST_DIR, BUNDLE_NAME),
-                  symlinks=True)
+  out_dir = os.path.join(SOURCE_ROOT, 'out', 'Release')
+
+  for binary in TARGET_BINARIES[TARGET_PLATFORM]:
+    shutil.copy2(os.path.join(out_dir, binary), DIST_DIR)
+
+  for directory in TARGET_DIRECTORIES[TARGET_PLATFORM]:
+    shutil.copytree(os.path.join(out_dir, directory),
+                    os.path.join(DIST_DIR, directory),
+                    symlinks=True)
 
 
 def copy_headers():