Merge pull request #1389 from atom/rename-to-electron
Rename to electron
This commit is contained in:
commit
cd0aa4a956
76 changed files with 375 additions and 313 deletions
23
README.md
23
README.md
|
@ -1,25 +1,14 @@
|
||||||
# Atom Shell [](https://travis-ci.org/atom/atom-shell)
|
# Electron [](https://travis-ci.org/atom/electron)
|
||||||
|
|
||||||
The Atom Shell framework lets you write cross-platform desktop applications
|
The Electron framework lets you write cross-platform desktop applications
|
||||||
using JavaScript, HTML and CSS. It is based on [io.js](http://iojs.org) and
|
using JavaScript, HTML and CSS. It is based on [io.js](http://iojs.org) and
|
||||||
[Chromium](http://www.chromium.org) and is used in the [Atom
|
[Chromium](http://www.chromium.org) and is used in the [Atom
|
||||||
editor](https://github.com/atom/atom).
|
editor](https://github.com/atom/atom).
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
Prebuilt binaries and debug symbols of atom-shell for Linux, Windows and Mac can
|
Prebuilt binaries and debug symbols of Electron for Linux, Windows and Mac can
|
||||||
be found on the [releases](https://github.com/atom/atom-shell/releases) page.
|
be found on the [releases](https://github.com/atom/electron/releases) page.
|
||||||
|
|
||||||
You can also use [`npm`](https://docs.npmjs.com/) to install prebuilt atom-shell
|
|
||||||
binaries:
|
|
||||||
|
|
||||||
```
|
|
||||||
# Install globally in your $PATH
|
|
||||||
npm install atom-shell -g
|
|
||||||
|
|
||||||
# Install as a development dependency
|
|
||||||
npm install atom-shell --save-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
### Mirrors
|
### Mirrors
|
||||||
|
|
||||||
|
@ -28,8 +17,8 @@ npm install atom-shell --save-dev
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Guides and the API reference are located in the
|
Guides and the API reference are located in the
|
||||||
[docs](https://github.com/atom/atom-shell/tree/master/docs) directory. It also
|
[docs](https://github.com/atom/electron/tree/master/docs) directory. It also
|
||||||
contains documents describing how to build and contribute to atom-shell.
|
contains documents describing how to build and contribute to Electron.
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
|
|
17
atom.gyp
17
atom.gyp
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
'variables': {
|
'variables': {
|
||||||
'project_name%': 'atom',
|
'project_name%': 'electron',
|
||||||
'product_name%': 'Atom',
|
'product_name%': 'Electron',
|
||||||
|
'company_name%': 'GitHub, Inc',
|
||||||
|
'company_abbr%': 'github',
|
||||||
'version%' : '0.23.0',
|
'version%' : '0.23.0',
|
||||||
|
|
||||||
'atom_source_root': '<!(["python", "tools/atom_source_root.py"])',
|
'atom_source_root': '<!(["python", "tools/atom_source_root.py"])',
|
||||||
|
@ -11,6 +13,10 @@
|
||||||
'vendor/native_mate/native_mate_files.gypi',
|
'vendor/native_mate/native_mate_files.gypi',
|
||||||
],
|
],
|
||||||
'target_defaults': {
|
'target_defaults': {
|
||||||
|
'defines': [
|
||||||
|
'ATOM_PRODUCT_NAME="<(product_name)"',
|
||||||
|
'ATOM_PROJECT_NAME="<(project_name)"',
|
||||||
|
],
|
||||||
'mac_framework_dirs': [
|
'mac_framework_dirs': [
|
||||||
'<(atom_source_root)/external_binaries',
|
'<(atom_source_root)/external_binaries',
|
||||||
],
|
],
|
||||||
|
@ -41,6 +47,7 @@
|
||||||
'<(project_name)_helper',
|
'<(project_name)_helper',
|
||||||
],
|
],
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
|
'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name)',
|
||||||
'INFOPLIST_FILE': 'atom/browser/resources/mac/Info.plist',
|
'INFOPLIST_FILE': 'atom/browser/resources/mac/Info.plist',
|
||||||
'LD_RUNPATH_SEARCH_PATHS': [
|
'LD_RUNPATH_SEARCH_PATHS': [
|
||||||
'@executable_path/../Frameworks',
|
'@executable_path/../Frameworks',
|
||||||
|
@ -201,7 +208,6 @@
|
||||||
'vendor/node/node.gyp:node',
|
'vendor/node/node.gyp:node',
|
||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
'PRODUCT_NAME="<(product_name)"',
|
|
||||||
# This is defined in skia/skia_common.gypi.
|
# This is defined in skia/skia_common.gypi.
|
||||||
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
|
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
|
||||||
# Disable warnings for g_settings_list_schemas.
|
# Disable warnings for g_settings_list_schemas.
|
||||||
|
@ -371,9 +377,6 @@
|
||||||
'vendor',
|
'vendor',
|
||||||
'<(libchromiumcontent_src_dir)',
|
'<(libchromiumcontent_src_dir)',
|
||||||
],
|
],
|
||||||
'defines': [
|
|
||||||
'PRODUCT_NAME="<(product_name)"',
|
|
||||||
],
|
|
||||||
'export_dependent_settings': [
|
'export_dependent_settings': [
|
||||||
'<(project_name)_lib',
|
'<(project_name)_lib',
|
||||||
],
|
],
|
||||||
|
@ -395,6 +398,7 @@
|
||||||
'<(libchromiumcontent_dir)/snapshot_blob.bin',
|
'<(libchromiumcontent_dir)/snapshot_blob.bin',
|
||||||
],
|
],
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
|
'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).framework',
|
||||||
'INFOPLIST_FILE': 'atom/common/resources/mac/Info.plist',
|
'INFOPLIST_FILE': 'atom/common/resources/mac/Info.plist',
|
||||||
'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name) Framework.framework/<(product_name) Framework',
|
'LD_DYLIB_INSTALL_NAME': '@rpath/<(product_name) Framework.framework/<(product_name) Framework',
|
||||||
'LD_RUNPATH_SEARCH_PATHS': [
|
'LD_RUNPATH_SEARCH_PATHS': [
|
||||||
|
@ -472,6 +476,7 @@
|
||||||
],
|
],
|
||||||
'mac_bundle': 1,
|
'mac_bundle': 1,
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
|
'ATOM_BUNDLE_ID': 'com.<(company_abbr).<(project_name).helper',
|
||||||
'INFOPLIST_FILE': 'atom/renderer/resources/mac/Info.plist',
|
'INFOPLIST_FILE': 'atom/renderer/resources/mac/Info.plist',
|
||||||
'LD_RUNPATH_SEARCH_PATHS': [
|
'LD_RUNPATH_SEARCH_PATHS': [
|
||||||
'@executable_path/../../..',
|
'@executable_path/../../..',
|
||||||
|
|
|
@ -29,7 +29,7 @@ int AtomInitializeICUandStartNode(int argc, char *argv[]) {
|
||||||
brightray::MainApplicationBundlePath()
|
brightray::MainApplicationBundlePath()
|
||||||
.Append("Contents")
|
.Append("Contents")
|
||||||
.Append("Frameworks")
|
.Append("Frameworks")
|
||||||
.Append(PRODUCT_NAME " Framework.framework"));
|
.Append(ATOM_PRODUCT_NAME " Framework.framework"));
|
||||||
base::i18n::InitializeICU();
|
base::i18n::InitializeICU();
|
||||||
return atom::NodeMain(argc, argv);
|
return atom::NodeMain(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
|
|
||||||
#include "base/mac/bundle_locations.h"
|
#include "base/mac/bundle_locations.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
#include "base/files/file_util.h"
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
|
#include "brightray/common/application_info.h"
|
||||||
#include "brightray/common/mac/main_application_bundle.h"
|
#include "brightray/common/mac/main_application_bundle.h"
|
||||||
#include "content/public/common/content_paths.h"
|
#include "content/public/common/content_paths.h"
|
||||||
|
|
||||||
|
@ -19,19 +21,30 @@ base::FilePath GetFrameworksPath() {
|
||||||
.Append("Frameworks");
|
.Append("Frameworks");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path,
|
||||||
|
const std::string& name) {
|
||||||
|
return frameworks_path.Append(name + " Helper.app")
|
||||||
|
.Append("Contents")
|
||||||
|
.Append("MacOS")
|
||||||
|
.Append(name + " Helper");
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void AtomMainDelegate::OverrideFrameworkBundlePath() {
|
void AtomMainDelegate::OverrideFrameworkBundlePath() {
|
||||||
base::mac::SetOverrideFrameworkBundlePath(
|
base::mac::SetOverrideFrameworkBundlePath(
|
||||||
GetFrameworksPath().Append(PRODUCT_NAME " Framework.framework"));
|
GetFrameworksPath().Append(ATOM_PRODUCT_NAME " Framework.framework"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomMainDelegate::OverrideChildProcessPath() {
|
void AtomMainDelegate::OverrideChildProcessPath() {
|
||||||
base::FilePath helper_path =
|
base::FilePath frameworks_path = GetFrameworksPath();
|
||||||
GetFrameworksPath().Append(PRODUCT_NAME " Helper.app")
|
base::FilePath helper_path = GetHelperAppPath(frameworks_path,
|
||||||
.Append("Contents")
|
ATOM_PRODUCT_NAME);
|
||||||
.Append("MacOS")
|
if (!base::PathExists(helper_path))
|
||||||
.Append(PRODUCT_NAME " Helper");
|
helper_path = GetHelperAppPath(frameworks_path,
|
||||||
|
brightray::GetApplicationName());
|
||||||
|
if (!base::PathExists(helper_path))
|
||||||
|
LOG(FATAL) << "Unable to find helper app";
|
||||||
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
|
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,11 @@
|
||||||
|
|
||||||
#include "atom/browser/atom_browser_main_parts.h"
|
#include "atom/browser/atom_browser_main_parts.h"
|
||||||
|
|
||||||
#import "atom/browser/mac/atom_application.h"
|
#include "atom/browser/mac/atom_application.h"
|
||||||
#import "atom/browser/mac/atom_application_delegate.h"
|
#include "atom/browser/mac/atom_application_delegate.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/mac/bundle_locations.h"
|
||||||
#import "base/mac/foundation_util.h"
|
#include "base/mac/foundation_util.h"
|
||||||
#include "ui/base/l10n/l10n_util_mac.h"
|
#include "ui/base/l10n/l10n_util_mac.h"
|
||||||
#import "vendor/brightray/common/mac/main_application_bundle.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -23,12 +22,7 @@ void AtomBrowserMainParts::PreMainMessageLoopStart() {
|
||||||
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
|
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
|
||||||
[NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
|
[NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
|
||||||
|
|
||||||
base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
|
NSBundle* frameworkBundle = base::mac::FrameworkBundle();
|
||||||
.Append("Contents")
|
|
||||||
.Append("Frameworks")
|
|
||||||
.Append(PRODUCT_NAME " Framework.framework");
|
|
||||||
NSBundle* frameworkBundle = [NSBundle
|
|
||||||
bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
|
|
||||||
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
|
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
|
||||||
bundle:frameworkBundle];
|
bundle:frameworkBundle];
|
||||||
[mainNib instantiateWithOwner:application topLevelObjects:nil];
|
[mainNib instantiateWithOwner:application topLevelObjects:nil];
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "atom/browser/native_window.h"
|
#include "atom/browser/native_window.h"
|
||||||
#include "atom/browser/window_list.h"
|
#include "atom/browser/window_list.h"
|
||||||
#include "atom/common/atom_version.h"
|
#include "atom/common/atom_version.h"
|
||||||
|
#include "brightray/common/application_info.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -31,11 +32,11 @@ void Browser::ClearRecentDocuments() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileVersion() const {
|
std::string Browser::GetExecutableFileVersion() const {
|
||||||
return ATOM_VERSION_STRING;
|
return brightray::GetApplicationVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileProductName() const {
|
std::string Browser::GetExecutableFileProductName() const {
|
||||||
return "Atom-Shell";
|
return brightray::GetApplicationName();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
|
|
||||||
#include "atom/browser/browser.h"
|
#include "atom/browser/browser.h"
|
||||||
|
|
||||||
#import "atom/browser/mac/atom_application.h"
|
#include "atom/browser/mac/atom_application.h"
|
||||||
#import "atom/browser/mac/atom_application_delegate.h"
|
#include "atom/browser/mac/atom_application_delegate.h"
|
||||||
#include "atom/browser/native_window.h"
|
#include "atom/browser/native_window.h"
|
||||||
#include "atom/browser/window_list.h"
|
#include "atom/browser/window_list.h"
|
||||||
#import "base/mac/bundle_locations.h"
|
#include "base/mac/foundation_util.h"
|
||||||
#import "base/mac/foundation_util.h"
|
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
|
#include "brightray/common/application_info.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -27,15 +27,11 @@ void Browser::ClearRecentDocuments() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileVersion() const {
|
std::string Browser::GetExecutableFileVersion() const {
|
||||||
NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
|
return brightray::GetApplicationVersion();
|
||||||
NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
|
|
||||||
return base::SysNSStringToUTF8(version);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Browser::GetExecutableFileProductName() const {
|
std::string Browser::GetExecutableFileProductName() const {
|
||||||
NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
|
return brightray::GetApplicationName();
|
||||||
NSString *version = [infoDictionary objectForKey:@"CFBundleName"];
|
|
||||||
return base::SysNSStringToUTF8(version);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Browser::DockBounce(BounceType type) {
|
int Browser::DockBounce(BounceType type) {
|
||||||
|
|
|
@ -118,7 +118,7 @@ void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Browser::SetAppUserModelID(const std::string& name) {
|
void Browser::SetAppUserModelID(const std::string& name) {
|
||||||
app_user_model_id_ = base::string16(L"atom-shell.app.");
|
app_user_model_id_ = base::string16(L"electron.app.");
|
||||||
app_user_model_id_ += base::UTF8ToUTF16(name);
|
app_user_model_id_ += base::UTF8ToUTF16(name);
|
||||||
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
|
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ std::string Browser::GetExecutableFileProductName() const {
|
||||||
return base::UTF16ToUTF8(version_info->product_name());
|
return base::UTF16ToUTF8(version_info->product_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Atom-Shell";
|
return ATOM_PRODUCT_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -25,10 +25,10 @@ app.on('ready', function() {
|
||||||
if (process.platform == 'darwin') {
|
if (process.platform == 'darwin') {
|
||||||
var template = [
|
var template = [
|
||||||
{
|
{
|
||||||
label: 'Atom Shell',
|
label: 'Electron',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'About Atom Shell',
|
label: 'About Electron',
|
||||||
selector: 'orderFrontStandardAboutPanel:'
|
selector: 'orderFrontStandardAboutPanel:'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ app.on('ready', function() {
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Hide Atom Shell',
|
label: 'Hide Electron',
|
||||||
accelerator: 'Command+H',
|
accelerator: 'Command+H',
|
||||||
selector: 'hide:'
|
selector: 'hide:'
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Atom Shell</title>
|
<title>Electron</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
color: #555;
|
color: #555;
|
||||||
|
@ -72,19 +72,19 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h2 style="-webkit-app-region: drag">Welcome to Atom Shell</h2>
|
<h2 style="-webkit-app-region: drag">Welcome to Electron</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To run your app with atom-shell, execute the following command under your
|
To run your app with Electron, execute the following command under your
|
||||||
Console (or Terminal):
|
Console (or Terminal):
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<script>document.write('<pre>' + command + '</pre>')</script>
|
<script>document.write('<pre>' + command + '</pre>')</script>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The <code>path-to-your-app</code> should be the path to your own atom-shell
|
The <code>path-to-your-app</code> should be the path to your own Electron
|
||||||
app, you can read the <a href='https://github.com/atom/atom-shell/blob/master/docs/tutorial/quick-start.md'>quick start</a>
|
app, you can read the <a href='https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md'>quick start</a>
|
||||||
guide in atom-shell's <a href='https://github.com/atom/atom-shell/blob/master/docs'>docs</a>
|
guide in Electron's <a href='https://github.com/atom/electron/blob/master/docs'>docs</a>
|
||||||
on how to write one.
|
on how to write one.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ if (option.file && !option.webdriver) {
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (e.code == 'MODULE_NOT_FOUND') {
|
if (e.code == 'MODULE_NOT_FOUND') {
|
||||||
app.focus();
|
app.focus();
|
||||||
dialog.showErrorBox('Error opening app', 'The app provided is not a valid atom-shell app, please read the docs on how to write one:\nhttps://github.com/atom/atom-shell/tree/master/docs');
|
dialog.showErrorBox('Error opening app', 'The app provided is not a valid electron app, please read the docs on how to write one:\nhttps://github.com/atom/electron/tree/master/docs');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
console.error('App threw an error when running', e);
|
console.error('App threw an error when running', e);
|
||||||
|
@ -58,7 +58,7 @@ if (option.file && !option.webdriver) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (option.version) {
|
} else if (option.version) {
|
||||||
console.log('v' + process.versions['atom-shell']);
|
console.log('v' + process.versions['electron']);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
} else {
|
} else {
|
||||||
require('./default_app.js');
|
require('./default_app.js');
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "atom-shell-default-app",
|
"name": "electron",
|
||||||
"productName": "Atom Shell Default App",
|
"productName": "Electron",
|
||||||
"version": "0.1.0",
|
|
||||||
"main": "main.js"
|
"main": "main.js"
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
|
||||||
// Override the user agent to contain application and atom-shell's version.
|
// Override the user agent to contain application and atom-shell's version.
|
||||||
Browser* browser = Browser::Get();
|
Browser* browser = Browser::Get();
|
||||||
std::string product_name = base::StringPrintf(
|
std::string product_name = base::StringPrintf(
|
||||||
"%s/%s Chrome/%s AtomShell/" ATOM_VERSION_STRING,
|
"%s/%s Chrome/%s " ATOM_PRODUCT_NAME "/" ATOM_VERSION_STRING,
|
||||||
RemoveWhitespace(browser->GetName()).c_str(),
|
RemoveWhitespace(browser->GetName()).c_str(),
|
||||||
browser->GetVersion().c_str(),
|
browser->GetVersion().c_str(),
|
||||||
CHROME_VERSION_STRING);
|
CHROME_VERSION_STRING);
|
||||||
|
@ -226,7 +226,7 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
|
||||||
if (options.Get(switches::kKiosk, &kiosk) && kiosk) {
|
if (options.Get(switches::kKiosk, &kiosk) && kiosk) {
|
||||||
SetKiosk(kiosk);
|
SetKiosk(kiosk);
|
||||||
}
|
}
|
||||||
std::string title("Atom Shell");
|
std::string title("Electron");
|
||||||
options.Get(switches::kTitle, &title);
|
options.Get(switches::kTitle, &title);
|
||||||
SetTitle(title);
|
SetTitle(title);
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ void NodeDebugger::SendConnectMessage() {
|
||||||
"Protocol-Version: 1\r\n"
|
"Protocol-Version: 1\r\n"
|
||||||
"Embedding-Host: %s\r\n"
|
"Embedding-Host: %s\r\n"
|
||||||
"%s: 0\r\n",
|
"%s: 0\r\n",
|
||||||
v8::V8::GetVersion(), "Atom-Shell", kContentLength), true);
|
v8::V8::GetVersion(), ATOM_PRODUCT_NAME, kContentLength), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.github.atom-shell</string>
|
<string>${ATOM_BUNDLE_ID}</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 345 KiB After Width: | Height: | Size: 76 KiB |
|
@ -120,7 +120,7 @@ struct RunState {
|
||||||
};
|
};
|
||||||
|
|
||||||
bool CreateDialogThread(RunState* run_state) {
|
bool CreateDialogThread(RunState* run_state) {
|
||||||
base::Thread* thread = new base::Thread("AtomShell_FileDialogThread");
|
base::Thread* thread = new base::Thread(ATOM_PRODUCT_NAME "FileDialogThread");
|
||||||
thread->init_com_with_mta(false);
|
thread->init_com_with_mta(false);
|
||||||
if (!thread->Start())
|
if (!thread->Start())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace atom {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const char kViewClassName[] = "AtomMenuBar";
|
const char kViewClassName[] = "ElectronMenuBar";
|
||||||
|
|
||||||
// Default color of the menu bar.
|
// Default color of the menu bar.
|
||||||
const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
|
const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
|
||||||
|
|
|
@ -24,7 +24,7 @@ const UINT kNotifyIconMessage = WM_APP + 1;
|
||||||
// |kBaseIconId| is 2 to avoid conflicts with plugins that hard-code id 1.
|
// |kBaseIconId| is 2 to avoid conflicts with plugins that hard-code id 1.
|
||||||
const UINT kBaseIconId = 2;
|
const UINT kBaseIconId = 2;
|
||||||
|
|
||||||
const wchar_t kNotifyIconHostWindowClass[] = L"AtomShell_NotifyIconHostWindow";
|
const wchar_t kNotifyIconHostWindowClass[] = L"Electron_NotifyIconHostWindow";
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,8 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
|
||||||
|
|
||||||
mate::Dictionary versions;
|
mate::Dictionary versions;
|
||||||
if (dict.Get("versions", &versions)) {
|
if (dict.Get("versions", &versions)) {
|
||||||
versions.Set("atom-shell", ATOM_VERSION_STRING);
|
versions.Set(ATOM_PROJECT_NAME, ATOM_VERSION_STRING);
|
||||||
|
versions.Set("atom-shell", ATOM_VERSION_STRING); // For compatibility.
|
||||||
versions.Set("chrome", CHROME_VERSION_STRING);
|
versions.Set("chrome", CHROME_VERSION_STRING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,13 @@ class CrashReporter
|
||||||
start: (options={}) ->
|
start: (options={}) ->
|
||||||
{@productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
|
{@productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra} = options
|
||||||
|
|
||||||
@productName ?= 'Atom-Shell'
|
app =
|
||||||
|
if process.type is 'browser'
|
||||||
|
require 'app'
|
||||||
|
else
|
||||||
|
require('remote').require 'app'
|
||||||
|
|
||||||
|
@productName ?= app.getName()
|
||||||
companyName ?= 'GitHub, Inc'
|
companyName ?= 'GitHub, Inc'
|
||||||
submitUrl ?= 'http://54.249.141.255:1127/post'
|
submitUrl ?= 'http://54.249.141.255:1127/post'
|
||||||
autoSubmit ?= true
|
autoSubmit ?= true
|
||||||
|
@ -17,11 +23,7 @@ class CrashReporter
|
||||||
|
|
||||||
extra._productName ?= @productName
|
extra._productName ?= @productName
|
||||||
extra._companyName ?= companyName
|
extra._companyName ?= companyName
|
||||||
extra._version ?=
|
extra._version ?= app.getVersion()
|
||||||
if process.type is 'browser'
|
|
||||||
require('app').getVersion()
|
|
||||||
else
|
|
||||||
require('remote').require('app').getVersion()
|
|
||||||
|
|
||||||
start = => binding.start @productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra
|
start = => binding.start @productName, companyName, submitUrl, autoSubmit, ignoreSystemCrashHandler, extra
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ void CrashReporterLinux::InitBreakpad(const std::string& product_name,
|
||||||
bool skip_system_crash_handler) {
|
bool skip_system_crash_handler) {
|
||||||
EnableCrashDumping(product_name);
|
EnableCrashDumping(product_name);
|
||||||
|
|
||||||
crash_keys_.SetKeyValue("prod", "Atom-Shell");
|
crash_keys_.SetKeyValue("prod", ATOM_PRODUCT_NAME);
|
||||||
crash_keys_.SetKeyValue("ver", version.c_str());
|
crash_keys_.SetKeyValue("ver", version.c_str());
|
||||||
upload_url_ = submit_url;
|
upload_url_ = submit_url;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name,
|
||||||
NSMutableDictionary* parameters =
|
NSMutableDictionary* parameters =
|
||||||
[NSMutableDictionary dictionaryWithCapacity:4];
|
[NSMutableDictionary dictionaryWithCapacity:4];
|
||||||
|
|
||||||
[parameters setValue:@"Atom-Shell"
|
[parameters setValue:@ATOM_PRODUCT_NAME
|
||||||
forKey:@BREAKPAD_PRODUCT];
|
forKey:@BREAKPAD_PRODUCT];
|
||||||
[parameters setValue:base::SysUTF8ToNSString(product_name)
|
[parameters setValue:base::SysUTF8ToNSString(product_name)
|
||||||
forKey:@BREAKPAD_PRODUCT_DISPLAY];
|
forKey:@BREAKPAD_PRODUCT_DISPLAY];
|
||||||
|
|
|
@ -103,7 +103,7 @@ google_breakpad::CustomClientInfo* CrashReporterWin::GetCustomInfo(
|
||||||
custom_info_entries_.reserve(2 + upload_parameters_.size());
|
custom_info_entries_.reserve(2 + upload_parameters_.size());
|
||||||
|
|
||||||
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
|
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
|
||||||
L"prod", L"Atom-Shell"));
|
L"prod", L"Electron"));
|
||||||
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
|
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
|
||||||
L"ver", base::UTF8ToWide(version).c_str()));
|
L"ver", base::UTF8ToWide(version).c_str()));
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ int Main(const wchar_t* cmd) {
|
||||||
NULL);
|
NULL);
|
||||||
cmd_line.AppendSwitch("no-window");
|
cmd_line.AppendSwitch("no-window");
|
||||||
cmd_line.AppendSwitchASCII("max-reports", "128");
|
cmd_line.AppendSwitchASCII("max-reports", "128");
|
||||||
cmd_line.AppendSwitchASCII("reporter", "atom-shell-crash-service");
|
cmd_line.AppendSwitchASCII("reporter", ATOM_PROJECT_NAME "-crash-service");
|
||||||
cmd_line.AppendSwitchNative("pipe-name", pipe_name);
|
cmd_line.AppendSwitchNative("pipe-name", pipe_name);
|
||||||
|
|
||||||
breakpad::CrashService crash_service;
|
breakpad::CrashService crash_service;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
std::string GetApplicationName() {
|
std::string GetApplicationName() {
|
||||||
return "Atom-Shell";
|
return ATOM_PRODUCT_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetApplicationVersion() {
|
std::string GetApplicationVersion() {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "base/message_loop/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/path_service.h"
|
#include "base/path_service.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
|
#include "content/public/common/content_paths.h"
|
||||||
#include "native_mate/locker.h"
|
#include "native_mate/locker.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ using content::BrowserThread;
|
||||||
#define REFERENCE_MODULE(name) \
|
#define REFERENCE_MODULE(name) \
|
||||||
extern "C" void _register_ ## name(void); \
|
extern "C" void _register_ ## name(void); \
|
||||||
void (*fp_register_ ## name)(void) = _register_ ## name
|
void (*fp_register_ ## name)(void) = _register_ ## name
|
||||||
// Atom Shell's builtin modules.
|
// Electron's builtin modules.
|
||||||
REFERENCE_MODULE(atom_browser_app);
|
REFERENCE_MODULE(atom_browser_app);
|
||||||
REFERENCE_MODULE(atom_browser_auto_updater);
|
REFERENCE_MODULE(atom_browser_auto_updater);
|
||||||
REFERENCE_MODULE(atom_browser_content_tracing);
|
REFERENCE_MODULE(atom_browser_content_tracing);
|
||||||
|
@ -157,6 +158,10 @@ node::Environment* NodeBindings::CreateEnvironment(
|
||||||
mate::Dictionary process(context->GetIsolate(), env->process_object());
|
mate::Dictionary process(context->GetIsolate(), env->process_object());
|
||||||
process.Set("type", process_type);
|
process.Set("type", process_type);
|
||||||
process.Set("resourcesPath", resources_path);
|
process.Set("resourcesPath", resources_path);
|
||||||
|
// The path to helper app.
|
||||||
|
base::FilePath helper_exec_path;
|
||||||
|
PathService::Get(content::CHILD_PROCESS_EXE, &helper_exec_path);
|
||||||
|
process.Set("helperExecPath", helper_exec_path);
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>Atom Framework</string>
|
<string>${PRODUCT_NAME} Framework</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.github.AtomFramework</string>
|
<string>${ATOM_BUNDLE_ID}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>Atom Framework</string>
|
<string>${PRODUCT_NAME} Framework</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<array class="NSMutableArray" key="NSMenuItems">
|
<array class="NSMutableArray" key="NSMenuItems">
|
||||||
<object class="NSMenuItem" id="238522557">
|
<object class="NSMenuItem" id="238522557">
|
||||||
<reference key="NSMenu" ref="110575045"/>
|
<reference key="NSMenu" ref="110575045"/>
|
||||||
<string key="NSTitle">About Atom</string>
|
<string key="NSTitle">About</string>
|
||||||
<string key="NSKeyEquiv"/>
|
<string key="NSKeyEquiv"/>
|
||||||
<int key="NSMnemonicLoc">2147483647</int>
|
<int key="NSMnemonicLoc">2147483647</int>
|
||||||
<reference key="NSOnImage" ref="229763992"/>
|
<reference key="NSOnImage" ref="229763992"/>
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMenuItem" id="755159360">
|
<object class="NSMenuItem" id="755159360">
|
||||||
<reference key="NSMenu" ref="110575045"/>
|
<reference key="NSMenu" ref="110575045"/>
|
||||||
<string key="NSTitle">Hide Atom</string>
|
<string key="NSTitle">Hide</string>
|
||||||
<string key="NSKeyEquiv">h</string>
|
<string key="NSKeyEquiv">h</string>
|
||||||
<int key="NSKeyEquivModMask">1048576</int>
|
<int key="NSKeyEquivModMask">1048576</int>
|
||||||
<int key="NSMnemonicLoc">2147483647</int>
|
<int key="NSMnemonicLoc">2147483647</int>
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMenuItem" id="632727374">
|
<object class="NSMenuItem" id="632727374">
|
||||||
<reference key="NSMenu" ref="110575045"/>
|
<reference key="NSMenu" ref="110575045"/>
|
||||||
<string key="NSTitle">Quit Atom</string>
|
<string key="NSTitle">Quit</string>
|
||||||
<string key="NSKeyEquiv">q</string>
|
<string key="NSKeyEquiv">q</string>
|
||||||
<int key="NSKeyEquivModMask">1048576</int>
|
<int key="NSKeyEquivModMask">1048576</int>
|
||||||
<int key="NSMnemonicLoc">2147483647</int>
|
<int key="NSMnemonicLoc">2147483647</int>
|
||||||
|
|
|
@ -72,7 +72,7 @@ window.confirm = (message, title='') ->
|
||||||
|
|
||||||
# But we do not support prompt().
|
# But we do not support prompt().
|
||||||
window.prompt = ->
|
window.prompt = ->
|
||||||
throw new Error('prompt() is and will not be supported in atom-shell.')
|
throw new Error('prompt() is and will not be supported.')
|
||||||
|
|
||||||
window.opener =
|
window.opener =
|
||||||
postMessage: (message, targetOrigin='*') ->
|
postMessage: (message, targetOrigin='*') ->
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.github.atom-shell.helper</string>
|
<string>${ATOM_BUNDLE_ID}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>${PRODUCT_NAME}</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
|
|
|
@ -23,14 +23,14 @@ Under most cases you should just do everything in `ready` event.
|
||||||
|
|
||||||
## Event: ready
|
## Event: ready
|
||||||
|
|
||||||
Emitted when atom-shell has done everything initialization.
|
Emitted when Electron has done everything initialization.
|
||||||
|
|
||||||
## Event: window-all-closed
|
## Event: window-all-closed
|
||||||
|
|
||||||
Emitted when all windows have been closed.
|
Emitted when all windows have been closed.
|
||||||
|
|
||||||
This event is only emitted when the application is not going to quit. If a
|
This event is only emitted when the application is not going to quit. If a
|
||||||
user pressed `Cmd + Q`, or the developer called `app.quit()`, atom-shell would
|
user pressed `Cmd + Q`, or the developer called `app.quit()`, Electron would
|
||||||
first try to close all windows and then emit the `will-quit` event, and in
|
first try to close all windows and then emit the `will-quit` event, and in
|
||||||
this case the `window-all-closed` would not be emitted.
|
this case the `window-all-closed` would not be emitted.
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ used.
|
||||||
Usually the `name` field of `package.json` is a short lowercased name, according
|
Usually the `name` field of `package.json` is a short lowercased name, according
|
||||||
to the spec of npm modules. So usually you should also specify a `productName`
|
to the spec of npm modules. So usually you should also specify a `productName`
|
||||||
field, which is your application's full capitalized name, and it will be
|
field, which is your application's full capitalized name, and it will be
|
||||||
preferred over `name` by atom-shell.
|
preferred over `name` by Electron.
|
||||||
|
|
||||||
## app.resolveProxy(url, callback)
|
## app.resolveProxy(url, callback)
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ You can also create a window without chrome by using
|
||||||
* `extra-plugin-dirs` Array - Array of paths that would be searched for
|
* `extra-plugin-dirs` Array - Array of paths that would be searched for
|
||||||
plugins. Note that if you want to add a directory under your app, you
|
plugins. Note that if you want to add a directory under your app, you
|
||||||
should use `__dirname` or `process.resourcesPath` to join the paths to
|
should use `__dirname` or `process.resourcesPath` to join the paths to
|
||||||
make them absolute, using relative paths would make atom-shell search
|
make them absolute, using relative paths would make Electron search
|
||||||
under current working directory.
|
under current working directory.
|
||||||
* `experimental-features` Boolean
|
* `experimental-features` Boolean
|
||||||
* `experimental-canvas-features` Boolean
|
* `experimental-canvas-features` Boolean
|
||||||
|
@ -116,7 +116,7 @@ would cancel the close.
|
||||||
|
|
||||||
Usually you would want to use the `beforeunload` handler to decide whether the
|
Usually you would want to use the `beforeunload` handler to decide whether the
|
||||||
window should be closed, which will also be called when the window is
|
window should be closed, which will also be called when the window is
|
||||||
reloaded. In atom-shell, returning an empty string or `false` would cancel the
|
reloaded. In Electron, returning an empty string or `false` would cancel the
|
||||||
close. An example is:
|
close. An example is:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
@ -124,7 +124,7 @@ window.onbeforeunload = function(e) {
|
||||||
console.log('I do not want to be closed');
|
console.log('I do not want to be closed');
|
||||||
|
|
||||||
// Unlike usual browsers, in which a string should be returned and the user is
|
// Unlike usual browsers, in which a string should be returned and the user is
|
||||||
// prompted to confirm the page unload. atom-shell gives the power completely
|
// prompted to confirm the page unload. Electron gives the power completely
|
||||||
// to the developers, return empty string or false would prevent the unloading
|
// to the developers, return empty string or false would prevent the unloading
|
||||||
// now. You can also use the dialog API to let user confirm it.
|
// now. You can also use the dialog API to let user confirm it.
|
||||||
return false;
|
return false;
|
||||||
|
@ -512,7 +512,7 @@ process.
|
||||||
* `printBackground` Boolean - Also prints the background color and image of
|
* `printBackground` Boolean - Also prints the background color and image of
|
||||||
the web page, defaults to `false`.
|
the web page, defaults to `false`.
|
||||||
|
|
||||||
Prints window's web page. When `silent` is set to `false`, atom-shell will pick
|
Prints window's web page. When `silent` is set to `false`, Electron will pick
|
||||||
up system's default printer and default settings for printing.
|
up system's default printer and default settings for printing.
|
||||||
|
|
||||||
Calling `window.print()` in web page is equivalent to call
|
Calling `window.print()` in web page is equivalent to call
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Supported Chrome command line switches
|
# Supported Chrome command line switches
|
||||||
|
|
||||||
Following command lines switches in Chrome browser are also Supported in
|
Following command lines switches in Chrome browser are also Supported in
|
||||||
atom-shell, you can use [app.commandLine.appendSwitch][append-switch] to append
|
Electron, you can use [app.commandLine.appendSwitch][append-switch] to append
|
||||||
them in your app's main script before the [ready][ready] event of [app][app]
|
them in your app's main script before the [ready][ready] event of [app][app]
|
||||||
module is emitted:
|
module is emitted:
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ crashReporter.start({
|
||||||
## crashReporter.start(options)
|
## crashReporter.start(options)
|
||||||
|
|
||||||
* `options` Object
|
* `options` Object
|
||||||
* `productName` String, default: Atom-Shell
|
* `productName` String, default: Electron
|
||||||
* `companyName` String, default: GitHub, Inc
|
* `companyName` String, default: GitHub, Inc
|
||||||
* `submitUrl` String, default: http://54.249.141.255:1127/post
|
* `submitUrl` String, default: http://54.249.141.255:1127/post
|
||||||
* URL that crash reports would be sent to as POST
|
* URL that crash reports would be sent to as POST
|
||||||
|
@ -36,14 +36,14 @@ sent or the crash reporter is not started, `null` will be returned.
|
||||||
|
|
||||||
The crash reporter will send the following data to the `submitUrl` as `POST`:
|
The crash reporter will send the following data to the `submitUrl` as `POST`:
|
||||||
|
|
||||||
* `rept` String - e.g. 'atom-shell-crash-service'
|
* `rept` String - e.g. 'electron-crash-service'
|
||||||
* `ver` String - The version of atom-shell
|
* `ver` String - The version of Electron
|
||||||
* `platform` String - e.g. 'win32'
|
* `platform` String - e.g. 'win32'
|
||||||
* `process_type` String - e.g. 'renderer'
|
* `process_type` String - e.g. 'renderer'
|
||||||
* `ptime` Number
|
* `ptime` Number
|
||||||
* `_version` String - The version in `package.json`
|
* `_version` String - The version in `package.json`
|
||||||
* `_productName` String - The product name in the crashReporter `options` object
|
* `_productName` String - The product name in the crashReporter `options` object
|
||||||
* `prod` String - Name of the underlying product. In this case Atom-Shell
|
* `prod` String - Name of the underlying product. In this case Electron
|
||||||
* `_companyName` String - The company name in the crashReporter `options` object
|
* `_companyName` String - The company name in the crashReporter `options` object
|
||||||
* `upload_file_minidump` File - The crashreport as file
|
* `upload_file_minidump` File - The crashreport as file
|
||||||
* All level one properties of the `extra` object in the crashReporter `options` object
|
* All level one properties of the `extra` object in the crashReporter `options` object
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# `File` object
|
# `File` object
|
||||||
|
|
||||||
The DOM's File interface provides abstraction around native files, in order to
|
The DOM's File interface provides abstraction around native files, in order to
|
||||||
let users work on native files directly with HTML5 file API, atom-shell has
|
let users work on native files directly with HTML5 file API, Electron has
|
||||||
added a `path` attribute to `File` interface which exposes the file's real path
|
added a `path` attribute to `File` interface which exposes the file's real path
|
||||||
on filesystem.
|
on filesystem.
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ var win = new BrowserWindow({ transparent: true, frame: false });
|
||||||
## Draggable region
|
## Draggable region
|
||||||
|
|
||||||
By default, the frameless window is non-draggable. Apps need to specify
|
By default, the frameless window is non-draggable. Apps need to specify
|
||||||
`-webkit-app-region: drag` in CSS to tell atom-shell which regions are draggable
|
`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable
|
||||||
(like the OS's standard titlebar), and apps can also use
|
(like the OS's standard titlebar), and apps can also use
|
||||||
`-webkit-app-region: no-drag` to exclude the non-draggable area from the
|
`-webkit-app-region: no-drag` to exclude the non-draggable area from the
|
||||||
draggable region. Note that only rectangular shape is currently supported.
|
draggable region. Note that only rectangular shape is currently supported.
|
||||||
|
|
|
@ -33,10 +33,10 @@ Another example of creating the application menu with the simple template API:
|
||||||
// main.js
|
// main.js
|
||||||
var template = [
|
var template = [
|
||||||
{
|
{
|
||||||
label: 'Atom Shell',
|
label: 'Electron',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'About Atom Shell',
|
label: 'About Electron',
|
||||||
selector: 'orderFrontStandardAboutPanel:'
|
selector: 'orderFrontStandardAboutPanel:'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ var template = [
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Hide Atom Shell',
|
label: 'Hide Electron',
|
||||||
accelerator: 'Command+H',
|
accelerator: 'Command+H',
|
||||||
selector: 'hide:'
|
selector: 'hide:'
|
||||||
},
|
},
|
||||||
|
@ -228,7 +228,7 @@ Linux, and here are some notes on making your app's menu more native-like.
|
||||||
|
|
||||||
On OS X there are many system defined standard menus, like the `Services` and
|
On OS X there are many system defined standard menus, like the `Services` and
|
||||||
`Windows` menus. To make your menu a standard menu, you can just set your menu's
|
`Windows` menus. To make your menu a standard menu, you can just set your menu's
|
||||||
label to one of followings, and atom-shell will recognize them and make them
|
label to one of followings, and Electron will recognize them and make them
|
||||||
become standard menus:
|
become standard menus:
|
||||||
|
|
||||||
* `Window`
|
* `Window`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# NativeImage
|
# NativeImage
|
||||||
|
|
||||||
In atom-shell for the APIs that take images, you can pass either file paths or
|
In Electron for the APIs that take images, you can pass either file paths or
|
||||||
`NativeImage` instances. When passing `null`, an empty image will be used.
|
`NativeImage` instances. When passing `null`, an empty image will be used.
|
||||||
|
|
||||||
For example when creating tray or setting window's icon, you can pass image's
|
For example when creating tray or setting window's icon, you can pass image's
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# Process object
|
# Process object
|
||||||
|
|
||||||
The `process` object in atom-shell has following differences between the one in
|
The `process` object in Electron has following differences between the one in
|
||||||
upstream node:
|
upstream node:
|
||||||
|
|
||||||
* `process.type` String - Process's type, can be `browser` (i.e. main process) or `renderer`.
|
* `process.type` String - Process's type, can be `browser` (i.e. main process) or `renderer`.
|
||||||
* `process.versions['atom-shell']` String - Version of atom-shell.
|
* `process.versions['electron']` String - Version of Electron.
|
||||||
* `process.versions['chrome']` String - Version of Chromium.
|
* `process.versions['chrome']` String - Version of Chromium.
|
||||||
* `process.resourcesPath` String - Path to JavaScript source code.
|
* `process.resourcesPath` String - Path to JavaScript source code.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
The `remote` module provides a simple way to do inter-process communication
|
The `remote` module provides a simple way to do inter-process communication
|
||||||
between the renderer process and the main process.
|
between the renderer process and the main process.
|
||||||
|
|
||||||
In atom-shell, only GUI-related modules are available in the renderer process.
|
In Electron, only GUI-related modules are available in the renderer process.
|
||||||
Without the `remote` module, users who wanted to call a main process API in
|
Without the `remote` module, users who wanted to call a main process API in
|
||||||
the renderer process would have to explicitly send inter-process messages
|
the renderer process would have to explicitly send inter-process messages
|
||||||
to the main process. With the `remote` module, users can invoke methods of
|
to the main process. With the `remote` module, users can invoke methods of
|
||||||
|
@ -35,7 +35,7 @@ corresponding remote object in the renderer process, namely the `win` object.
|
||||||
|
|
||||||
## Lifetime of remote objects
|
## Lifetime of remote objects
|
||||||
|
|
||||||
Atom-shell makes sure that as long as the remote object in the renderer process
|
Electron makes sure that as long as the remote object in the renderer process
|
||||||
lives (in other words, has not been garbage collected), the corresponding object
|
lives (in other words, has not been garbage collected), the corresponding object
|
||||||
in the main process would never be released. When the remote object has been
|
in the main process would never be released. When the remote object has been
|
||||||
garbage collected, the corresponding object in the main process would be
|
garbage collected, the corresponding object in the main process would be
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# Synopsis
|
# Synopsis
|
||||||
|
|
||||||
All [node.js's built-in modules](http://nodejs.org/api/) are available in
|
All [node.js's built-in modules](http://nodejs.org/api/) are available in
|
||||||
atom-shell, and third-party node modules are fully supported too (including the
|
Electron, and third-party node modules are fully supported too (including the
|
||||||
[native modules](../tutorial/using-native-node-modules.md)).
|
[native modules](../tutorial/using-native-node-modules.md)).
|
||||||
|
|
||||||
Atom-shell also provides some extra built-in modules for developing native
|
Electron also provides some extra built-in modules for developing native
|
||||||
desktop applications. Some modules are only available on the main process, some
|
desktop applications. Some modules are only available on the main process, some
|
||||||
are only available on the renderer process, and some can be used on both processes.
|
are only available on the renderer process, and some can be used on both processes.
|
||||||
The basic rule is: if a module is GUI or low-level system related, then it should
|
The basic rule is: if a module is GUI or low-level system related, then it should
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# `<webview>` tag
|
# `<webview>` tag
|
||||||
|
|
||||||
Use the `webview` tag to embed 'guest' content (such as web pages) in your
|
Use the `webview` tag to embed 'guest' content (such as web pages) in your
|
||||||
atom-shell app. The guest content is contained within the `webview` container;
|
Electron app. The guest content is contained within the `webview` container;
|
||||||
an embedder page within your app controls how the guest content is laid out and
|
an embedder page within your app controls how the guest content is laid out and
|
||||||
rendered.
|
rendered.
|
||||||
|
|
||||||
|
|
|
@ -1,48 +1,50 @@
|
||||||
# Technical differences to NW.js (formerly node-webkit)
|
# Technical differences to NW.js (formerly node-webkit)
|
||||||
|
|
||||||
Like NW.js, atom-shell provides a platform to write desktop applications
|
__Note: Electron was previously named Atom Shell.__
|
||||||
|
|
||||||
|
Like NW.js, Electron provides a platform to write desktop applications
|
||||||
with JavaScript and HTML, and has Node integration to grant access to low level
|
with JavaScript and HTML, and has Node integration to grant access to low level
|
||||||
system in web pages.
|
system in web pages.
|
||||||
|
|
||||||
But there are also fundamental differences between the two projects that make
|
But there are also fundamental differences between the two projects that make
|
||||||
atom-shell a completely separate product from NW.js:
|
Electron a completely separate product from NW.js:
|
||||||
|
|
||||||
**1. Entry of application**
|
__1. Entry of application__
|
||||||
|
|
||||||
In NW.js, the main entry of an application is a web page, you specify a
|
In NW.js, the main entry of an application is a web page, you specify a
|
||||||
main page in the `package.json` and it would be opened in a browser window as
|
main page in the `package.json` and it would be opened in a browser window as
|
||||||
the application's main window.
|
the application's main window.
|
||||||
|
|
||||||
While in atom-shell, the entry point is a JavaScript script, instead of
|
While in Electron, the entry point is a JavaScript script, instead of
|
||||||
providing a URL directly, you need to manually create a browser window and load
|
providing a URL directly, you need to manually create a browser window and load
|
||||||
html file in it with corresponding API. You also need to listen to window events
|
html file in it with corresponding API. You also need to listen to window events
|
||||||
to decide when to quit the application.
|
to decide when to quit the application.
|
||||||
|
|
||||||
So atom-shell works more like the Node.js runtime, and APIs are more low level,
|
So Electron works more like the Node.js runtime, and APIs are more low level,
|
||||||
you can also use atom-shell for web testing purpose like
|
you can also use Electron for web testing purpose like
|
||||||
[phantomjs](http://phantomjs.org/).
|
[phantomjs](http://phantomjs.org/).
|
||||||
|
|
||||||
**2. Build system**
|
__2. Build system__
|
||||||
|
|
||||||
In order to avoid the complexity of building the whole Chromium, atom-shell uses
|
In order to avoid the complexity of building the whole Chromium, Electron uses
|
||||||
[libchromiumcontent](https://github.com/brightray/libchromiumcontent) to access
|
[libchromiumcontent](https://github.com/brightray/libchromiumcontent) to access
|
||||||
Chromium's Content API, libchromiumcontent is a single, shared library that
|
Chromium's Content API, libchromiumcontent is a single, shared library that
|
||||||
includes the Chromium Content module and all its dependencies. So users don't
|
includes the Chromium Content module and all its dependencies. So users don't
|
||||||
need a powerful machine to build atom-shell.
|
need a powerful machine to build Electron.
|
||||||
|
|
||||||
**3. Node integration**
|
__3. Node integration__
|
||||||
|
|
||||||
In NW.js, the Node integration in web pages requires patching Chromium to
|
In NW.js, the Node integration in web pages requires patching Chromium to
|
||||||
work, while in atom-shell we chose a different way to integrate libuv loop to
|
work, while in Electron we chose a different way to integrate libuv loop to
|
||||||
each platform's message loop to avoid hacking Chromium, see the
|
each platform's message loop to avoid hacking Chromium, see the
|
||||||
[`node_bindings`](../../atom/common/) code for how that was done.
|
[`node_bindings`](../../atom/common/) code for how that was done.
|
||||||
|
|
||||||
**4. Multi-context**
|
__4. Multi-context__
|
||||||
|
|
||||||
If you are an experienced NW.js user, you should be familiar with the
|
If you are an experienced NW.js user, you should be familiar with the
|
||||||
concept of Node context and web context, these concepts were invented because
|
concept of Node context and web context, these concepts were invented because
|
||||||
of how the NW.js was implemented.
|
of how the NW.js was implemented.
|
||||||
|
|
||||||
By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/)
|
By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/)
|
||||||
feature of Node, atom-shell doesn't introduce a new JavaScript context in web
|
feature of Node, Electron doesn't introduce a new JavaScript context in web
|
||||||
pages.
|
pages.
|
||||||
|
|
|
@ -30,17 +30,17 @@ $ sudo npm install npm -g
|
||||||
## Getting the code
|
## Getting the code
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/atom/atom-shell.git
|
$ git clone https://github.com/atom/electron.git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Bootstrapping
|
## Bootstrapping
|
||||||
|
|
||||||
The bootstrap script will download all necessary build dependencies and create
|
The bootstrap script will download all necessary build dependencies and create
|
||||||
build project files. Notice that we're using `ninja` to build `atom-shell` so
|
build project files. Notice that we're using `ninja` to build Electron so
|
||||||
there is no `Makefile` generated.
|
there is no `Makefile` generated.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd atom-shell
|
$ cd electron
|
||||||
$ ./script/bootstrap.py -v
|
$ ./script/bootstrap.py -v
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ versions of clang. Try using clang 3.0, default version in Ubuntu 12.04.
|
||||||
If you get an error like:
|
If you get an error like:
|
||||||
|
|
||||||
````
|
````
|
||||||
/usr/bin/ld: warning: libudev.so.0, needed by /home/suyash/projects/atom-shell/vendor/brightray/vendor/download/libchromiumcontent/Release/libchromiumcontent.so, not found (try using -rpath or -rpath-link)
|
/usr/bin/ld: warning: libudev.so.0, needed by .../vendor/brightray/vendor/download/libchromiumcontent/Release/libchromiumcontent.so, not found (try using -rpath or -rpath-link)
|
||||||
````
|
````
|
||||||
|
|
||||||
and you are on Ubuntu 13.04+, 64 bit system, try doing
|
and you are on Ubuntu 13.04+, 64 bit system, try doing
|
||||||
|
|
|
@ -14,17 +14,17 @@ following python modules:
|
||||||
## Getting the code
|
## Getting the code
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/atom/atom-shell.git
|
$ git clone https://github.com/atom/electron.git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Bootstrapping
|
## Bootstrapping
|
||||||
|
|
||||||
The bootstrap script will download all necessary build dependencies and create
|
The bootstrap script will download all necessary build dependencies and create
|
||||||
build project files. Notice that we're using `ninja` to build `atom-shell` so
|
build project files. Notice that we're using `ninja` to build Electron so
|
||||||
there is no Xcode project generated.
|
there is no Xcode project generated.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd atom-shell
|
$ cd electron
|
||||||
$ ./script/bootstrap.py -v
|
$ ./script/bootstrap.py -v
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@ You can also only build the `Debug` target:
|
||||||
$ ./script/build.py -c D
|
$ ./script/build.py -c D
|
||||||
```
|
```
|
||||||
|
|
||||||
After building is done, you can find `Atom.app` under `out/D`.
|
After building is done, you can find `Electron.app` under `out/D`.
|
||||||
|
|
||||||
## 32bit support
|
## 32bit support
|
||||||
|
|
||||||
Currently atom-shell can only be built for 64bit target on OS X, and there is no
|
Electron can only be built for 64bit target on OS X, and there is no plan to
|
||||||
plan to support 32bit on OS X in future.
|
support 32bit OS X in future.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,15 @@
|
||||||
* Visual Studio 2013 - [download VS 2013 Community Edition for
|
* Visual Studio 2013 - [download VS 2013 Community Edition for
|
||||||
free](http://www.visualstudio.com/products/visual-studio-community-vs)
|
free](http://www.visualstudio.com/products/visual-studio-community-vs)
|
||||||
* [Python 2.7](http://www.python.org/download/releases/2.7/)
|
* [Python 2.7](http://www.python.org/download/releases/2.7/)
|
||||||
* 32bit [node.js](http://nodejs.org/download/)
|
* [Node.js](http://nodejs.org/download/)
|
||||||
* [git](http://git-scm.com)
|
* [git](http://git-scm.com)
|
||||||
|
|
||||||
If you don't have a Windows installation at the moment,
|
If you don't have a Windows installation at the moment,
|
||||||
[modern.ie](https://www.modern.ie/en-us/virtualization-tools#downloads) has
|
[modern.ie](https://www.modern.ie/en-us/virtualization-tools#downloads) has
|
||||||
timebombed versions of Windows that you can use to build Atom Shell.
|
timebombed versions of Windows that you can use to build Electron.
|
||||||
|
|
||||||
The building of atom-shell is done entirely with command-line scripts, so you
|
The building of Electron is done entirely with command-line scripts, so you
|
||||||
can use any editor you like to develop atom-shell, but it also means you can
|
can use any editor you like to develop Electron, but it also means you can
|
||||||
not use Visual Studio for the development. Support of building with Visual
|
not use Visual Studio for the development. Support of building with Visual
|
||||||
Studio will come in the future.
|
Studio will come in the future.
|
||||||
|
|
||||||
|
@ -24,17 +24,17 @@ Studio will come in the future.
|
||||||
## Getting the code
|
## Getting the code
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
git clone https://github.com/atom/atom-shell.git
|
git clone https://github.com/atom/electron.git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Bootstrapping
|
## Bootstrapping
|
||||||
|
|
||||||
The bootstrap script will download all necessary build dependencies and create
|
The bootstrap script will download all necessary build dependencies and create
|
||||||
build project files. Notice that we're using `ninja` to build atom-shell so
|
build project files. Notice that we're using `ninja` to build Electron so
|
||||||
there is no Visual Studio project generated.
|
there is no Visual Studio project generated.
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
cd atom-shell
|
cd electron
|
||||||
python script\bootstrap.py -v
|
python script\bootstrap.py -v
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -54,10 +54,16 @@ python script\build.py -c D
|
||||||
|
|
||||||
After building is done, you can find `atom.exe` under `out\D`.
|
After building is done, you can find `atom.exe` under `out\D`.
|
||||||
|
|
||||||
## 64bit support
|
## 64bit build
|
||||||
|
|
||||||
Currently atom-shell can only be built for 32bit target on Windows, support for
|
To build for the 64bit target, you need to pass `--target_arch=x64` when running
|
||||||
64bit will come in future.
|
the bootstrap script:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
python script\bootstrap.py -v --target_arch=x64
|
||||||
|
```
|
||||||
|
|
||||||
|
The other building steps are exactly the same.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Build system overview
|
# Build system overview
|
||||||
|
|
||||||
Atom Shell uses `gyp` for project generation, and `ninja` for building, project
|
Electron uses `gyp` for project generation, and `ninja` for building, project
|
||||||
configurations can be found in `.gyp` and `.gypi` files.
|
configurations can be found in `.gyp` and `.gypi` files.
|
||||||
|
|
||||||
## Gyp files
|
## Gyp files
|
||||||
|
|
||||||
Following `gyp` files contain the main rules of building Atom Shell:
|
Following `gyp` files contain the main rules of building Electron:
|
||||||
|
|
||||||
* `atom.gyp` defines how Atom Shell itself is built.
|
* `atom.gyp` defines how Electron itself is built.
|
||||||
* `common.gypi` adjusts the build configurations of Node to make it build
|
* `common.gypi` adjusts the build configurations of Node to make it build
|
||||||
together with Chromium.
|
together with Chromium.
|
||||||
* `vendor/brightray/brightray.gyp` defines how `brightray` is built, and
|
* `vendor/brightray/brightray.gyp` defines how `brightray` is built, and
|
||||||
|
@ -23,7 +23,7 @@ Chromium introduced the "component build", which builds each component as a
|
||||||
separate shared library, making linking very quick but sacrificing file size
|
separate shared library, making linking very quick but sacrificing file size
|
||||||
and performance.
|
and performance.
|
||||||
|
|
||||||
In Atom Shell we took a very similar approach: for `Debug` builds, the binary
|
In Electron we took a very similar approach: for `Debug` builds, the binary
|
||||||
will be linked to shared library version of Chromium's components to achieve
|
will be linked to shared library version of Chromium's components to achieve
|
||||||
fast linking time; for `Release` builds, the binary will be linked to the static
|
fast linking time; for `Release` builds, the binary will be linked to the static
|
||||||
library versions, so we can have the best possible binary size and performance.
|
library versions, so we can have the best possible binary size and performance.
|
||||||
|
@ -35,7 +35,7 @@ script. By default both static libraries and shared libraries will be
|
||||||
downloaded and the final size should be between 800MB and 2GB according to the
|
downloaded and the final size should be between 800MB and 2GB according to the
|
||||||
platform.
|
platform.
|
||||||
|
|
||||||
If you only want to build Atom Shell quickly for testing or development, you
|
If you only want to build Electron quickly for testing or development, you
|
||||||
can only download the shared library versions by passing the `--dev` parameter:
|
can only download the shared library versions by passing the `--dev` parameter:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -45,20 +45,20 @@ $ ./script/build.py -c D
|
||||||
|
|
||||||
## Two-phrase project generation
|
## Two-phrase project generation
|
||||||
|
|
||||||
Atom Shell links with different sets of libraries in `Release` and `Debug`
|
Electron links with different sets of libraries in `Release` and `Debug`
|
||||||
builds, however `gyp` doesn't support configuring different link settings for
|
builds, however `gyp` doesn't support configuring different link settings for
|
||||||
different configurations.
|
different configurations.
|
||||||
|
|
||||||
To work around this Atom Shell uses a `gyp` variable
|
To work around this Electron uses a `gyp` variable
|
||||||
`libchromiumcontent_component` to control which link settings to use, and only
|
`libchromiumcontent_component` to control which link settings to use, and only
|
||||||
generates one target when running `gyp`.
|
generates one target when running `gyp`.
|
||||||
|
|
||||||
## Target names
|
## Target names
|
||||||
|
|
||||||
Unlike most projects that use `Release` and `Debug` as target names, Atom Shell
|
Unlike most projects that use `Release` and `Debug` as target names, Electron
|
||||||
uses `R` and `D` instead. This is because `gyp` randomly crashes if there is
|
uses `R` and `D` instead. This is because `gyp` randomly crashes if there is
|
||||||
only one `Release` or `Debug` build configuration is defined, and Atom Shell has
|
only one `Release` or `Debug` build configuration is defined, and Electron has
|
||||||
to only generate one target for one time as stated above.
|
to only generate one target for one time as stated above.
|
||||||
|
|
||||||
This only affects developers, if you are only building Atom Shell for rebranding
|
This only affects developers, if you are only building Electron for rebranding
|
||||||
you are not affected.
|
you are not affected.
|
||||||
|
|
|
@ -25,4 +25,4 @@ Guide](https://github.com/styleguide/javascript), and also following rules:
|
||||||
When creating a new API, we should prefer getters and setters instead of
|
When creating a new API, we should prefer getters and setters instead of
|
||||||
jQuery's one-function style, for example, `.getText()` and `.setText(text)`
|
jQuery's one-function style, for example, `.getText()` and `.setText(text)`
|
||||||
are preferred to `.text([text])`. There is a
|
are preferred to `.text([text])`. There is a
|
||||||
[discussion](https://github.com/atom/atom-shell/issues/46) of this.
|
[discussion](https://github.com/atom/electron/issues/46) of this.
|
||||||
|
|
|
@ -8,13 +8,13 @@ forcing users to download large debugging files. The server functions like
|
||||||
[Microsoft's symbol server](http://support.microsoft.com/kb/311503) so the
|
[Microsoft's symbol server](http://support.microsoft.com/kb/311503) so the
|
||||||
documentation there can be useful.
|
documentation there can be useful.
|
||||||
|
|
||||||
Note that because released atom-shell builds are heavily optimized, debugging is
|
Note that because released Electron builds are heavily optimized, debugging is
|
||||||
not always easy. The debugger will not be able to show you the content of all
|
not always easy. The debugger will not be able to show you the content of all
|
||||||
variables and the execution path can seem strange because of inlining, tail
|
variables and the execution path can seem strange because of inlining, tail
|
||||||
calls, and other compiler optimizations. The only workaround is to build an
|
calls, and other compiler optimizations. The only workaround is to build an
|
||||||
unoptimized local build.
|
unoptimized local build.
|
||||||
|
|
||||||
The official symbol server URL for atom-shell is
|
The official symbol server URL for Electron is
|
||||||
http://54.249.141.255:8086/atom-shell/symbols.
|
http://54.249.141.255:8086/atom-shell/symbols.
|
||||||
You cannot visit this URL directly: you must add it to the symbol path of your
|
You cannot visit this URL directly: you must add it to the symbol path of your
|
||||||
debugging tool. In the examples below, a local cache directory is used to avoid
|
debugging tool. In the examples below, a local cache directory is used to avoid
|
||||||
|
@ -24,7 +24,7 @@ appropriate cache directory on your machine.
|
||||||
## Using the symbol server in Windbg
|
## Using the symbol server in Windbg
|
||||||
|
|
||||||
The Windbg symbol path is configured with a string value delimited with asterisk
|
The Windbg symbol path is configured with a string value delimited with asterisk
|
||||||
characters. To use only the atom-shell symbol server, add the following entry to
|
characters. To use only the Electron symbol server, add the following entry to
|
||||||
your symbol path (__note:__ you can replace `c:\code\symbols` with any writable
|
your symbol path (__note:__ you can replace `c:\code\symbols` with any writable
|
||||||
directory on your computer, if you'd prefer a different location for downloaded
|
directory on your computer, if you'd prefer a different location for downloaded
|
||||||
symbols):
|
symbols):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
The source code of atom-shell is separated into a few parts, and we are mostly
|
The source code of Electron is separated into a few parts, and we are mostly
|
||||||
following Chromium on the separation conventions.
|
following Chromium on the separation conventions.
|
||||||
|
|
||||||
You may need to become familiar with [Chromium's multi-process
|
You may need to become familiar with [Chromium's multi-process
|
||||||
|
@ -11,7 +11,7 @@ to understand the source code better.
|
||||||
|
|
||||||
## Structure of source code
|
## Structure of source code
|
||||||
|
|
||||||
* **atom** - Source code of atom-shell.
|
* **atom** - Source code of Electron.
|
||||||
* **app** - System entry code.
|
* **app** - System entry code.
|
||||||
* **browser** - The frontend including the main window, UI, and all of the
|
* **browser** - The frontend including the main window, UI, and all of the
|
||||||
main process things. This talks to the renderer to manage web pages.
|
main process things. This talks to the renderer to manage web pages.
|
||||||
|
@ -20,7 +20,7 @@ to understand the source code better.
|
||||||
* **cocoa** - Cocoa specific source code.
|
* **cocoa** - Cocoa specific source code.
|
||||||
* **gtk** - GTK+ specific source code.
|
* **gtk** - GTK+ specific source code.
|
||||||
* **win** - Windows GUI specific source code.
|
* **win** - Windows GUI specific source code.
|
||||||
* **default_app** - The default page to show when atom-shell is started
|
* **default_app** - The default page to show when Electron is started
|
||||||
without providing an app.
|
without providing an app.
|
||||||
* **api** - The implementation of the main process APIs.
|
* **api** - The implementation of the main process APIs.
|
||||||
* **lib** - Javascript part of the API implementation.
|
* **lib** - Javascript part of the API implementation.
|
||||||
|
@ -36,12 +36,12 @@ to understand the source code better.
|
||||||
loop into Chromium's message loop.
|
loop into Chromium's message loop.
|
||||||
* **lib** - Common Javascript initialization code.
|
* **lib** - Common Javascript initialization code.
|
||||||
* **api** - The implementation of common APIs, and foundations of
|
* **api** - The implementation of common APIs, and foundations of
|
||||||
atom-shell's built-in modules.
|
Electron's built-in modules.
|
||||||
* **lib** - Javascript part of the API implementation.
|
* **lib** - Javascript part of the API implementation.
|
||||||
* **chromium_src** - Source code that copied from Chromium.
|
* **chromium_src** - Source code that copied from Chromium.
|
||||||
* **docs** - Documentations.
|
* **docs** - Documentations.
|
||||||
* **spec** - Automatic tests.
|
* **spec** - Automatic tests.
|
||||||
* **atom.gyp** - Building rules of atom-shell.
|
* **atom.gyp** - Building rules of Electron.
|
||||||
* **common.gypi** - Compiler specific settings and building rules for other
|
* **common.gypi** - Compiler specific settings and building rules for other
|
||||||
components like `node` and `breakpad`.
|
components like `node` and `breakpad`.
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Application distribution
|
# Application distribution
|
||||||
|
|
||||||
To distribute your app with atom-shell, you should name the folder of your app
|
To distribute your app with Electron, you should name the folder of your app
|
||||||
as `app`, and put it under atom-shell's resources directory (on OS X it is
|
as `app`, and put it under Electron's resources directory (on OS X it is
|
||||||
`Atom.app/Contents/Resources/`, and on Linux and Windows it is `resources/`),
|
`Electron.app/Contents/Resources/`, and on Linux and Windows it is
|
||||||
like this:
|
`resources/`), like this:
|
||||||
|
|
||||||
On OS X:
|
On OS X:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
atom-shell/Atom.app/Contents/Resources/app/
|
electron/Electron.app/Contents/Resources/app/
|
||||||
├── package.json
|
├── package.json
|
||||||
├── main.js
|
├── main.js
|
||||||
└── index.html
|
└── index.html
|
||||||
|
@ -17,14 +17,14 @@ atom-shell/Atom.app/Contents/Resources/app/
|
||||||
On Windows and Linux:
|
On Windows and Linux:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
atom-shell/resources/app
|
electron/resources/app
|
||||||
├── package.json
|
├── package.json
|
||||||
├── main.js
|
├── main.js
|
||||||
└── index.html
|
└── index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
Then execute `Atom.app` (or `atom` on Linux, and `atom.exe` on Windows), and
|
Then execute `Electron.app` (or `electron` on Linux, `electron.exe` on Windows),
|
||||||
atom-shell will start as your app. The `atom-shell` directory would then be
|
and Electron will start as your app. The `electron` directory would then be
|
||||||
your distribution that should be delivered to final users.
|
your distribution that should be delivered to final users.
|
||||||
|
|
||||||
## Packaging your app into a file
|
## Packaging your app into a file
|
||||||
|
@ -34,20 +34,20 @@ package your app into an [asar](https://github.com/atom/asar) archive to avoid
|
||||||
exposing your app's source code to users.
|
exposing your app's source code to users.
|
||||||
|
|
||||||
To use an `asar` archive to replace the `app` folder, you need to rename the
|
To use an `asar` archive to replace the `app` folder, you need to rename the
|
||||||
archive to `app.asar`, and put it under atom-shell's resources directory like
|
archive to `app.asar`, and put it under Electron's resources directory like
|
||||||
bellow, and atom-shell will then try read the archive and start from it.
|
bellow, and Electron will then try read the archive and start from it.
|
||||||
|
|
||||||
On OS X:
|
On OS X:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
atom-shell/Atom.app/Contents/Resources/
|
electron/Electron.app/Contents/Resources/
|
||||||
└── app.asar
|
└── app.asar
|
||||||
```
|
```
|
||||||
|
|
||||||
On Windows and Linux:
|
On Windows and Linux:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
atom-shell/resources/
|
electron/resources/
|
||||||
└── app.asar
|
└── app.asar
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -55,62 +55,81 @@ More details can be found in [Application packaging](application-packaging.md).
|
||||||
|
|
||||||
## Rebranding with downloaded binaries
|
## Rebranding with downloaded binaries
|
||||||
|
|
||||||
After bundling your app into atom-shell, you will want to rebrand atom-shell
|
After bundling your app into Electron, you will want to rebrand Electron
|
||||||
before distributing it to users.
|
before distributing it to users.
|
||||||
|
|
||||||
If you don't care about the executable name on Windows or the helper process
|
|
||||||
name on OS X, you can simply rename the downloaded binaries, and there is also a
|
|
||||||
grunt task that can download prebuilt atom-shell binaries for your current
|
|
||||||
platform automatically:
|
|
||||||
[grunt-download-atom-shell](https://github.com/atom/grunt-download-atom-shell).
|
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
You can not rename the `atom.exe` otherwise native modules will not load. But
|
You can rename `electron.exe` to any name you like, and edit its icon and other
|
||||||
you can edit the executable's icon and other information with tools like
|
information with tools like [rcedit](https://github.com/atom/rcedit) or
|
||||||
[rcedit](https://github.com/atom/rcedit) or [ResEdit](http://www.resedit.net).
|
[ResEdit](http://www.resedit.net).
|
||||||
|
|
||||||
If you don't use any native Node module, it is fine to rename `atom.exe` to any
|
|
||||||
name you want.
|
|
||||||
|
|
||||||
### OS X
|
### OS X
|
||||||
|
|
||||||
You can rename `Atom.app` to whatever you want, and you also have to rename the
|
You can rename `Electron.app` to any name you want, and you also have to rename
|
||||||
`CFBundleDisplayName`, `CFBundleIdentifier` and `CFBundleName` fields in
|
the `CFBundleDisplayName`, `CFBundleIdentifier` and `CFBundleName` fields in
|
||||||
following manifest files if they have these keys:
|
following files:
|
||||||
|
|
||||||
* `Atom.app/Contents/Info.plist`
|
* `Electron.app/Contents/Info.plist`
|
||||||
* `Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist`
|
* `Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist`
|
||||||
|
|
||||||
|
You can also rename the helper app to avoid showing `Electron Helper` in the
|
||||||
|
Activity Monitor, but make sure you have renamed the helper app's executable
|
||||||
|
file's name.
|
||||||
|
|
||||||
|
The structure of a renamed app would be like:
|
||||||
|
|
||||||
|
```
|
||||||
|
MyApp.app/Contents
|
||||||
|
├── Info.plist
|
||||||
|
├── MacOS/
|
||||||
|
│ └── MyApp
|
||||||
|
└── Frameworks/
|
||||||
|
├── MyApp Helper EH.app
|
||||||
|
| ├── Info.plist
|
||||||
|
| └── MacOS/
|
||||||
|
| └── MyApp Helper EH
|
||||||
|
├── MyApp Helper NP.app
|
||||||
|
| ├── Info.plist
|
||||||
|
| └── MacOS/
|
||||||
|
| └── MyApp Helper NP
|
||||||
|
└── MyApp Helper.app
|
||||||
|
├── Info.plist
|
||||||
|
└── MacOS/
|
||||||
|
└── MyApp Helper
|
||||||
|
```
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
You can rename the `atom` executable to whatever you want.
|
You can rename the `electron` executable to any name you like.
|
||||||
|
|
||||||
## Rebranding by rebuilding atom-shell from source
|
## Rebranding by rebuilding Electron from source
|
||||||
|
|
||||||
The best way to rename atom-shell is to change the product name and then build
|
It is also possible to rebrand Electron by changing the product name and
|
||||||
from source. To do this you need to override the `GYP_DEFINES` environment
|
building it from source. To do this you need to override the `GYP_DEFINES`
|
||||||
variable and have a clean rebuild:
|
environment variable and have a clean rebuild:
|
||||||
|
|
||||||
__Windows__
|
__Windows__
|
||||||
|
|
||||||
```cmd
|
```cmd
|
||||||
> set "GYP_DEFINES=project_name=myapp product_name=MyApp"
|
> set "GYP_DEFINES=project_name=myapp product_name=MyApp"
|
||||||
|
> python script\clean.py
|
||||||
> python script\bootstrap.py
|
> python script\bootstrap.py
|
||||||
> python script\build.py -c Release -t myapp
|
> python script\build.py -c R -t myapp
|
||||||
```
|
```
|
||||||
|
|
||||||
__Bash__
|
__Bash__
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ export GYP_DEFINES="project_name=myapp product_name=MyApp"
|
$ export GYP_DEFINES="project_name=myapp product_name=MyApp"
|
||||||
|
$ script/clean.py
|
||||||
$ script/bootstrap.py
|
$ script/bootstrap.py
|
||||||
$ script/build.py -c Release -t myapp
|
$ script/build.py -c Release -t myapp
|
||||||
```
|
```
|
||||||
|
|
||||||
### grunt-build-atom-shell
|
### grunt-build-atom-shell
|
||||||
|
|
||||||
Manually checking out atom-shell's code and rebuilding could be complicated, so
|
Manually checking out Electron's code and rebuilding could be complicated, so
|
||||||
a Grunt task has been created that will handle this automatically:
|
a Grunt task has been created that will handle this automatically:
|
||||||
[grunt-build-atom-shell](https://github.com/paulcbetts/grunt-build-atom-shell).
|
[grunt-build-atom-shell](https://github.com/paulcbetts/grunt-build-atom-shell).
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ source code.
|
||||||
## Generating `asar` archive
|
## Generating `asar` archive
|
||||||
|
|
||||||
An [asar][asar] archive is a simple tar-like format that concatenates files
|
An [asar][asar] archive is a simple tar-like format that concatenates files
|
||||||
into a single file, atom-shell can read arbitrary files from it without unpacking
|
into a single file, Electron can read arbitrary files from it without unpacking
|
||||||
the whole file.
|
the whole file.
|
||||||
|
|
||||||
Following is the steps to package your app into an `asar` archive:
|
Following is the steps to package your app into an `asar` archive:
|
||||||
|
@ -26,12 +26,12 @@ $ asar pack your-app app.asar
|
||||||
|
|
||||||
## Using `asar` archives
|
## Using `asar` archives
|
||||||
|
|
||||||
In atom-shell there are two sets of APIs: Node APIs provided by Node.js, and Web
|
In Electron there are two sets of APIs: Node APIs provided by Node.js, and Web
|
||||||
APIs provided by Chromium. Both APIs support reading files from `asar` archives.
|
APIs provided by Chromium. Both APIs support reading files from `asar` archives.
|
||||||
|
|
||||||
### Node API
|
### Node API
|
||||||
|
|
||||||
With special patches in atom-shell, Node APIs like `fs.readFile` and `require`
|
With special patches in Electron, Node APIs like `fs.readFile` and `require`
|
||||||
treat `asar` archives as virtual directories, and the files in it as normal
|
treat `asar` archives as virtual directories, and the files in it as normal
|
||||||
files in the filesystem.
|
files in the filesystem.
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ also cause errors.
|
||||||
|
|
||||||
Most `fs` APIs can read file or get file's information from `asar` archives
|
Most `fs` APIs can read file or get file's information from `asar` archives
|
||||||
without unpacking, but for some APIs that rely on passing the real file path to
|
without unpacking, but for some APIs that rely on passing the real file path to
|
||||||
underlying system calls, atom-shell will extract the needed file into a
|
underlying system calls, Electron will extract the needed file into a
|
||||||
temporary file and pass the path of the temporary file to the APIs to make them
|
temporary file and pass the path of the temporary file to the APIs to make them
|
||||||
work. This adds a little overhead for those APIs.
|
work. This adds a little overhead for those APIs.
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
The devtools of browser window can only debug the renderer process scripts.
|
The devtools of browser window can only debug the renderer process scripts.
|
||||||
(I.e. the web pages.) In order to provide a way to debug the scripts of
|
(I.e. the web pages.) In order to provide a way to debug the scripts of
|
||||||
the main process, atom-shell has provided the `--debug` and `--debug-brk`
|
the main process, Electron has provided the `--debug` and `--debug-brk`
|
||||||
switches.
|
switches.
|
||||||
|
|
||||||
## Command line switches
|
## Command line switches
|
||||||
|
|
||||||
### `--debug=[port]`
|
### `--debug=[port]`
|
||||||
|
|
||||||
When this switch is used atom-shell would listen for V8 debugger protocol
|
When this switch is used Electron would listen for V8 debugger protocol
|
||||||
messages on `port`, the `port` is `5858` by default.
|
messages on `port`, the `port` is `5858` by default.
|
||||||
|
|
||||||
### `--debug-brk=[port]`
|
### `--debug-brk=[port]`
|
||||||
|
@ -18,7 +18,7 @@ Like `--debug` but pauses the script on the first line.
|
||||||
|
|
||||||
## Use node-inspector for debugging
|
## Use node-inspector for debugging
|
||||||
|
|
||||||
__Note:__ Atom Shell uses node v0.11.13, which currently doesn't work very well
|
__Note:__ Electron uses node v0.11.13, which currently doesn't work very well
|
||||||
with node-inspector, and the main process would crash if you inspect the
|
with node-inspector, and the main process would crash if you inspect the
|
||||||
`process` object under node-inspector's console.
|
`process` object under node-inspector's console.
|
||||||
|
|
||||||
|
@ -28,18 +28,18 @@ with node-inspector, and the main process would crash if you inspect the
|
||||||
$ node-inspector
|
$ node-inspector
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Enable debug mode for atom-shell
|
### 2. Enable debug mode for Electron
|
||||||
|
|
||||||
You can either start atom-shell with a debug flag like:
|
You can either start Electron with a debug flag like:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ atom-shell --debug=5858 your/app
|
$ electron --debug=5858 your/app
|
||||||
```
|
```
|
||||||
|
|
||||||
or, to pause your script on the first line:
|
or, to pause your script on the first line:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ atom-shell --debug-brk=5858 your/app
|
$ electron --debug-brk=5858 your/app
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Load the debugger UI
|
### 3. Load the debugger UI
|
||||||
|
|
|
@ -6,7 +6,7 @@ applications can put shortcuts in the JumpList of task bar, and on Mac
|
||||||
applications can put a custom menu in the dock menu.
|
applications can put a custom menu in the dock menu.
|
||||||
|
|
||||||
This guide introduces how to integrate your application into those desktop
|
This guide introduces how to integrate your application into those desktop
|
||||||
environments with atom-shell APIs.
|
environments with Electron APIs.
|
||||||
|
|
||||||
## Recent documents (Windows & OS X)
|
## Recent documents (Windows & OS X)
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ To add a file to recent documents, you can use
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var app = require('app');
|
var app = require('app');
|
||||||
app.addRecentDocument('/Users/aryastark/github/atom-shell/README.md');
|
app.addRecentDocument('/Users/USERNAME/Desktop/work.type');
|
||||||
```
|
```
|
||||||
|
|
||||||
And you can use [app.clearRecentDocuments](clearrecentdocuments) API to empty
|
And you can use [app.clearRecentDocuments](clearrecentdocuments) API to empty
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# DevTools extension
|
# DevTools extension
|
||||||
|
|
||||||
To make debugging more easy, atom-shell has added basic support for
|
To make debugging more easy, Electron has added basic support for
|
||||||
[Chrome DevTools Extension][devtools-extension].
|
[Chrome DevTools Extension][devtools-extension].
|
||||||
|
|
||||||
For most devtools extensions, you can simply download their source codes and use
|
For most devtools extensions, you can simply download their source codes and use
|
||||||
|
@ -16,7 +16,7 @@ $ cd /some-directory
|
||||||
$ git clone --recursive https://github.com/facebook/react-devtools.git
|
$ git clone --recursive https://github.com/facebook/react-devtools.git
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can load it in atom-shell by opening the devtools in arbitray window,
|
Then you can load it in Electron by opening the devtools in arbitray window,
|
||||||
and run this code in the console of devtools:
|
and run this code in the console of devtools:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
@ -33,20 +33,20 @@ require('remote').require('browser-window').removeDevToolsExtension('React Devel
|
||||||
## Format of devtools extension
|
## Format of devtools extension
|
||||||
|
|
||||||
Ideally all devtools extension written for Chrome browser can be loaded by
|
Ideally all devtools extension written for Chrome browser can be loaded by
|
||||||
atom-shell, but they have to be in a plain directory, for those packaged `crx`
|
Electron, but they have to be in a plain directory, for those packaged `crx`
|
||||||
extensions, there is no way in atom-shell to load them unless you find a way to
|
extensions, there is no way in Electron to load them unless you find a way to
|
||||||
extract them into a directory.
|
extract them into a directory.
|
||||||
|
|
||||||
## Background pages
|
## Background pages
|
||||||
|
|
||||||
Currently atom-shell doesn't support the background pages of chrome extensions,
|
Currently Electron doesn't support the background pages of chrome extensions,
|
||||||
so for some devtools extensions that rely on this feature, they may not work
|
so for some devtools extensions that rely on this feature, they may not work
|
||||||
well in atom-shell
|
well in Electron
|
||||||
|
|
||||||
## `chrome.*` APIs
|
## `chrome.*` APIs
|
||||||
|
|
||||||
Some chrome extensions use `chrome.*` APIs for some features, there is some
|
Some chrome extensions use `chrome.*` APIs for some features, there is some
|
||||||
effort to implement those APIs in atom-shell to make them work, but we have
|
effort to implement those APIs in Electron to make them work, but we have
|
||||||
only implemented few for now.
|
only implemented few for now.
|
||||||
|
|
||||||
So if the devtools extension is using APIs other than `chrome.devtools.*`, it is
|
So if the devtools extension is using APIs other than `chrome.devtools.*`, it is
|
||||||
|
|
|
@ -39,7 +39,7 @@ _online-status.html_
|
||||||
There may be instances where one wants to respond to these events in the
|
There may be instances where one wants to respond to these events in the
|
||||||
main process as well. The main process however does not have a
|
main process as well. The main process however does not have a
|
||||||
`navigator` object and thus cannot detect these events directly. Using
|
`navigator` object and thus cannot detect these events directly. Using
|
||||||
Atom-shell's inter-process communication utilities, the events can be forwarded
|
Electron's inter-process communication utilities, the events can be forwarded
|
||||||
to the main process and handled as needed, as shown in the following example.
|
to the main process and handled as needed, as shown in the following example.
|
||||||
|
|
||||||
_main.js_
|
_main.js_
|
||||||
|
|
|
@ -123,7 +123,7 @@ Finally the `index.html` is the web page you want to show:
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello World!</h1>
|
<h1>Hello World!</h1>
|
||||||
We are using node.js <script>document.write(process.version)</script>
|
We are using node.js <script>document.write(process.version)</script>
|
||||||
and atom-shell <script>document.write(process.versions['atom-shell'])</script>.
|
and atom-shell <script>document.write(process.versions['electron'])</script>.
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
```
|
```
|
||||||
|
@ -150,8 +150,8 @@ $ ./atom-shell/atom your-app/
|
||||||
On OS X:
|
On OS X:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./Atom.app/Contents/MacOS/Atom your-app/
|
$ ./Electron.app/Contents/MacOS/Atom your-app/
|
||||||
```
|
```
|
||||||
|
|
||||||
`Atom.app` here is part of the atom-shell's release package, you can download
|
`Electron.app` here is part of the atom-shell's release package, you can download
|
||||||
it from [here](https://github.com/atom/atom-shell/releases).
|
it from [here](https://github.com/atom/electron/releases).
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Using native Node modules
|
# Using native Node modules
|
||||||
|
|
||||||
The native Node modules are supported by atom-shell, but since atom-shell is
|
The native Node modules are supported by Electron, but since Electron is
|
||||||
using a different V8 version from official Node, you have to manually specify
|
using a different V8 version from official Node, you have to manually specify
|
||||||
the location of atom-shell's headers when building native modules.
|
the location of Electron's headers when building native modules.
|
||||||
|
|
||||||
## Native Node module compatibility
|
## Native Node module compatibility
|
||||||
|
|
||||||
Since Node v0.11.x there were vital changes in the V8 API. So generally all
|
Since Node v0.11.x there were vital changes in the V8 API. So generally all
|
||||||
native modules written for Node v0.10.x wouldn't work for Node v0.11.x. And
|
native modules written for Node v0.10.x wouldn't work for Node v0.11.x. And
|
||||||
because atom-shell internally uses Node v0.11.13, it carries with the same
|
because Electron internally uses Node v0.11.13, it carries with the same
|
||||||
problem.
|
problem.
|
||||||
|
|
||||||
To solve this, you should use modules that support Node v0.11.x,
|
To solve this, you should use modules that support Node v0.11.x,
|
||||||
|
@ -20,16 +20,16 @@ For old modules that only support Node v0.10.x, you should use the
|
||||||
|
|
||||||
### The node-gyp way
|
### The node-gyp way
|
||||||
|
|
||||||
To build Node modules with headers of atom-shell, you need to tell `node-gyp`
|
To build Node modules with headers of Electron, you need to tell `node-gyp`
|
||||||
where to download headers and which version to use:
|
where to download headers and which version to use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd /path-to-module/
|
$ cd /path-to-module/
|
||||||
$ HOME=~/.atom-shell-gyp node-gyp rebuild --target=0.16.0 --arch=ia32 --dist-url=https://atom.io/download/atom-shell
|
$ HOME=~/.electron-gyp node-gyp rebuild --target=0.16.0 --arch=ia32 --dist-url=https://atom.io/download/atom-shell
|
||||||
```
|
```
|
||||||
|
|
||||||
The `HOME=~/.atom-shell-gyp` changes where to find development headers. The
|
The `HOME=~/.electron-gyp` changes where to find development headers. The
|
||||||
`--target=0.16.0` is version of atom-shell. The `--dist-url=...` specifies
|
`--target=0.16.0` is version of Electron. The `--dist-url=...` specifies
|
||||||
where to download the headers. The `--arch=ia32` says the module is built for
|
where to download the headers. The `--arch=ia32` says the module is built for
|
||||||
32bit system.
|
32bit system.
|
||||||
|
|
||||||
|
@ -42,5 +42,5 @@ Node modules, except that you need to setup some environment variables:
|
||||||
export npm_config_disturl=https://atom.io/download/atom-shell
|
export npm_config_disturl=https://atom.io/download/atom-shell
|
||||||
export npm_config_target=0.23.0
|
export npm_config_target=0.23.0
|
||||||
export npm_config_arch=x64
|
export npm_config_arch=x64
|
||||||
HOME=~/.atom-shell-gyp npm install module-name
|
HOME=~/.electron-gyp npm install module-name
|
||||||
```
|
```
|
||||||
|
|
|
@ -8,14 +8,14 @@ From [ChromeDriver - WebDriver for Chrome][chrome-driver]:
|
||||||
> implements WebDriver's wire protocol for Chromium. It is being developed by
|
> implements WebDriver's wire protocol for Chromium. It is being developed by
|
||||||
> members of the Chromium and WebDriver teams.
|
> members of the Chromium and WebDriver teams.
|
||||||
|
|
||||||
In atom-shell's [releases](https://github.com/atom/atom-shell/releases) page you
|
In Electron's [releases](https://github.com/atom/electron/releases) page you
|
||||||
can find archives of `chromedriver`, there is no difference between atom-shell's
|
can find archives of `chromedriver`, there is no difference between Electron's
|
||||||
distribution of `chromedriver` and upstream ones, so in order to use
|
distribution of `chromedriver` and upstream ones, so in order to use
|
||||||
`chromedriver` together with atom-shell, you will need some special setup.
|
`chromedriver` together with Electron, you will need some special setup.
|
||||||
|
|
||||||
Also notice that only minor version update releases (e.g. `vX.X.0` releases)
|
Also notice that only minor version update releases (e.g. `vX.X.0` releases)
|
||||||
include `chromedriver` archives, because `chromedriver` doesn't change as
|
include `chromedriver` archives, because `chromedriver` doesn't change as
|
||||||
frequent as atom-shell itself.
|
frequent as Electron itself.
|
||||||
|
|
||||||
## Setting up with WebDriverJs
|
## Setting up with WebDriverJs
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ $ npm install selenium-webdriver
|
||||||
|
|
||||||
### 3. Connect to chrome driver
|
### 3. Connect to chrome driver
|
||||||
|
|
||||||
The usage of `selenium-webdriver` with atom-shell is basically the same with
|
The usage of `selenium-webdriver` with Electron is basically the same with
|
||||||
upstream, except that you have to manually specify how to connect chrome driver
|
upstream, except that you have to manually specify how to connect chrome driver
|
||||||
and where to find atom-shell's binary:
|
and where to find Electron's binary:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var webdriver = require('selenium-webdriver');
|
var webdriver = require('selenium-webdriver');
|
||||||
|
@ -53,9 +53,9 @@ var driver = new webdriver.Builder().
|
||||||
// The "9515" is the port opened by chrome driver.
|
// The "9515" is the port opened by chrome driver.
|
||||||
usingServer('http://localhost:9515').
|
usingServer('http://localhost:9515').
|
||||||
withCapabilities({chromeOptions: {
|
withCapabilities({chromeOptions: {
|
||||||
// Here is the path to your atom-shell binary.
|
// Here is the path to your Electron binary.
|
||||||
binary: '/Path-to-Your-App.app/Contents/MacOS/Atom'}}).
|
binary: '/Path-to-Your-App.app/Contents/MacOS/Atom'}}).
|
||||||
forBrowser('atom-shell').
|
forBrowser('electron').
|
||||||
build();
|
build();
|
||||||
|
|
||||||
driver.get('http://www.google.com');
|
driver.get('http://www.google.com');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "atom-shell",
|
"name": "electron",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"asar": "0.2.2",
|
"asar": "0.2.2",
|
||||||
"coffee-script": "~1.7.1",
|
"coffee-script": "~1.7.1",
|
||||||
|
|
|
@ -31,8 +31,8 @@ def main():
|
||||||
|
|
||||||
create_chrome_version_h()
|
create_chrome_version_h()
|
||||||
touch_config_gypi()
|
touch_config_gypi()
|
||||||
update_atom_shell()
|
run_update()
|
||||||
update_atom_modules('spec', args.target_arch)
|
update_electron_modules('spec', args.target_arch)
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
|
@ -92,7 +92,7 @@ def update_node_modules(dirname, env=None):
|
||||||
execute_stdout([NPM, 'install'], env)
|
execute_stdout([NPM, 'install'], env)
|
||||||
|
|
||||||
|
|
||||||
def update_atom_modules(dirname, target_arch):
|
def update_electron_modules(dirname, target_arch):
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env['npm_config_arch'] = target_arch
|
env['npm_config_arch'] = target_arch
|
||||||
env['npm_config_target'] = get_atom_shell_version()
|
env['npm_config_target'] = get_atom_shell_version()
|
||||||
|
@ -133,7 +133,7 @@ def touch_config_gypi():
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
|
|
||||||
def update_atom_shell():
|
def run_update():
|
||||||
update = os.path.join(SOURCE_ROOT, 'script', 'update.py')
|
update = os.path.join(SOURCE_ROOT, 'script', 'update.py')
|
||||||
execute_stdout([sys.executable, update])
|
execute_stdout([sys.executable, update])
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from lib.util import atom_gyp
|
||||||
|
|
||||||
|
|
||||||
CONFIGURATIONS = ['Release', 'Debug']
|
CONFIGURATIONS = ['Release', 'Debug']
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
@ -26,7 +28,7 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser(description='Build atom-shell')
|
parser = argparse.ArgumentParser(description='Build project')
|
||||||
parser.add_argument('-c', '--configuration',
|
parser.add_argument('-c', '--configuration',
|
||||||
help='Build with Release or Debug configuration',
|
help='Build with Release or Debug configuration',
|
||||||
nargs='+',
|
nargs='+',
|
||||||
|
@ -34,7 +36,7 @@ def parse_args():
|
||||||
required=False)
|
required=False)
|
||||||
parser.add_argument('-t', '--target',
|
parser.add_argument('-t', '--target',
|
||||||
help='Build specified target',
|
help='Build specified target',
|
||||||
default='atom',
|
default=atom_gyp()['project_name%'],
|
||||||
required=False)
|
required=False)
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import stat
|
||||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
|
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
|
||||||
get_target_arch
|
get_target_arch
|
||||||
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
|
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
|
||||||
execute, get_chromedriver_version
|
execute, get_chromedriver_version, atom_gyp
|
||||||
|
|
||||||
|
|
||||||
ATOM_SHELL_VERSION = get_atom_shell_version()
|
ATOM_SHELL_VERSION = get_atom_shell_version()
|
||||||
|
@ -21,11 +21,14 @@ OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
||||||
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||||
'download', 'libchromiumcontent', 'static_library')
|
'download', 'libchromiumcontent', 'static_library')
|
||||||
|
|
||||||
|
PROJECT_NAME = atom_gyp()['project_name%']
|
||||||
|
PRODUCT_NAME = atom_gyp()['product_name%']
|
||||||
|
|
||||||
TARGET_BINARIES = {
|
TARGET_BINARIES = {
|
||||||
'darwin': [
|
'darwin': [
|
||||||
],
|
],
|
||||||
'win32': [
|
'win32': [
|
||||||
'atom.exe',
|
'{0}.exe'.format(PROJECT_NAME), # 'electron.exe'
|
||||||
'content_shell.pak',
|
'content_shell.pak',
|
||||||
'd3dcompiler_47.dll',
|
'd3dcompiler_47.dll',
|
||||||
'ffmpegsumo.dll',
|
'ffmpegsumo.dll',
|
||||||
|
@ -40,7 +43,7 @@ TARGET_BINARIES = {
|
||||||
'snapshot_blob.bin',
|
'snapshot_blob.bin',
|
||||||
],
|
],
|
||||||
'linux': [
|
'linux': [
|
||||||
'atom',
|
PROJECT_NAME, # 'electron'
|
||||||
'content_shell.pak',
|
'content_shell.pak',
|
||||||
'icudtl.dat',
|
'icudtl.dat',
|
||||||
'libffmpegsumo.so',
|
'libffmpegsumo.so',
|
||||||
|
@ -51,7 +54,7 @@ TARGET_BINARIES = {
|
||||||
}
|
}
|
||||||
TARGET_DIRECTORIES = {
|
TARGET_DIRECTORIES = {
|
||||||
'darwin': [
|
'darwin': [
|
||||||
'Atom.app',
|
'{0}.app'.format(PRODUCT_NAME),
|
||||||
],
|
],
|
||||||
'win32': [
|
'win32': [
|
||||||
'resources',
|
'resources',
|
||||||
|
@ -128,7 +131,8 @@ def strip_binaries():
|
||||||
|
|
||||||
|
|
||||||
def copy_system_libraries():
|
def copy_system_libraries():
|
||||||
ldd = execute(['ldd', os.path.join(OUT_DIR, 'atom')])
|
executable_path = os.path.join(OUT_DIR, PROJECT_NAME) # our/R/electron
|
||||||
|
ldd = execute(['ldd', executable_path])
|
||||||
lib_re = re.compile('\t(.*) => (.+) \(.*\)$')
|
lib_re = re.compile('\t(.*) => (.+) \(.*\)$')
|
||||||
for line in ldd.splitlines():
|
for line in ldd.splitlines():
|
||||||
m = lib_re.match(line)
|
m = lib_re.match(line)
|
||||||
|
@ -148,13 +152,13 @@ def create_version():
|
||||||
|
|
||||||
|
|
||||||
def create_symbols():
|
def create_symbols():
|
||||||
destination = os.path.join(DIST_DIR, 'Atom-Shell.breakpad.syms')
|
destination = os.path.join(DIST_DIR, '{0}.breakpad.syms'.format(PROJECT_NAME))
|
||||||
dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py')
|
dump_symbols = os.path.join(SOURCE_ROOT, 'script', 'dump-symbols.py')
|
||||||
execute([sys.executable, dump_symbols, destination])
|
execute([sys.executable, dump_symbols, destination])
|
||||||
|
|
||||||
|
|
||||||
def create_dist_zip():
|
def create_dist_zip():
|
||||||
dist_name = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
|
dist_name = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME, ATOM_SHELL_VERSION,
|
||||||
PLATFORM, get_target_arch())
|
PLATFORM, get_target_arch())
|
||||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||||
|
|
||||||
|
@ -181,14 +185,15 @@ def create_chromedriver_zip():
|
||||||
|
|
||||||
|
|
||||||
def create_symbols_zip():
|
def create_symbols_zip():
|
||||||
dist_name = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
|
dist_name = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
|
||||||
|
ATOM_SHELL_VERSION,
|
||||||
PLATFORM,
|
PLATFORM,
|
||||||
get_target_arch())
|
get_target_arch())
|
||||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||||
|
|
||||||
with scoped_cwd(DIST_DIR):
|
with scoped_cwd(DIST_DIR):
|
||||||
files = ['LICENSE', 'version']
|
files = ['LICENSE', 'version']
|
||||||
dirs = ['Atom-Shell.breakpad.syms']
|
dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
|
||||||
make_zip(zip_file, files, dirs)
|
make_zip(zip_file, files, dirs)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,14 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from lib.util import atom_gyp
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
PROJECT_NAME = atom_gyp()['project_name%']
|
||||||
|
PRODUCT_NAME = atom_gyp()['product_name%']
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
os.chdir(SOURCE_ROOT)
|
os.chdir(SOURCE_ROOT)
|
||||||
|
@ -16,12 +21,14 @@ def main():
|
||||||
config = 'R'
|
config = 'R'
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'Atom.app',
|
atom_shell = os.path.join(SOURCE_ROOT, 'out', config,
|
||||||
'Contents', 'MacOS', 'Atom')
|
'{0}.app'.format(PRODUCT_NAME), 'Contents',
|
||||||
|
'MacOS', PRODUCT_NAME)
|
||||||
elif sys.platform == 'win32':
|
elif sys.platform == 'win32':
|
||||||
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom.exe')
|
atom_shell = os.path.join(SOURCE_ROOT, 'out', config,
|
||||||
|
'{0}.exe'.format(PROJECT_NAME))
|
||||||
else:
|
else:
|
||||||
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, 'atom')
|
atom_shell = os.path.join(SOURCE_ROOT, 'out', config, PROJECT_NAME)
|
||||||
|
|
||||||
subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:])
|
subprocess.check_call([atom_shell, 'spec'] + sys.argv[1:])
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ def download_and_unzip(framework):
|
||||||
def download_framework(framework):
|
def download_framework(framework):
|
||||||
filename = framework + '.zip'
|
filename = framework + '.zip'
|
||||||
url = FRAMEWORKS_URL + '/' + filename
|
url = FRAMEWORKS_URL + '/' + filename
|
||||||
download_dir = tempdir(prefix='atom-shell-')
|
download_dir = tempdir(prefix='electron-')
|
||||||
path = os.path.join(download_dir, filename)
|
path = os.path.join(download_dir, filename)
|
||||||
|
|
||||||
download('Download ' + framework, url, path)
|
download('Download ' + framework, url, path)
|
||||||
|
|
|
@ -45,7 +45,7 @@ def get_files_list(version):
|
||||||
|
|
||||||
|
|
||||||
def download_files(url, files):
|
def download_files(url, files):
|
||||||
directory = tempfile.mkdtemp(prefix='atom-shell-tmp')
|
directory = tempfile.mkdtemp(prefix='electron-tmp')
|
||||||
return directory, [
|
return directory, [
|
||||||
download(f, url + f, os.path.join(directory, f))
|
download(f, url + f, os.path.join(directory, f))
|
||||||
for f in files
|
for f in files
|
||||||
|
|
|
@ -4,19 +4,26 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from lib.config import PLATFORM, s3_config
|
from lib.config import PLATFORM, s3_config
|
||||||
from lib.util import execute, s3put, scoped_cwd
|
from lib.util import atom_gyp, execute, s3put, scoped_cwd
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
||||||
|
|
||||||
|
PROJECT_NAME = atom_gyp()['project_name%']
|
||||||
|
PRODUCT_NAME = atom_gyp()['product_name%']
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Upload the index.json.
|
# Upload the index.json.
|
||||||
with scoped_cwd(SOURCE_ROOT):
|
with scoped_cwd(SOURCE_ROOT):
|
||||||
atom_shell = os.path.join(OUT_DIR, 'atom')
|
if sys.platform == 'darwin':
|
||||||
if PLATFORM == 'win32':
|
atom_shell = os.path.join(OUT_DIR, '{0}.app'.format(PRODUCT_NAME),
|
||||||
atom_shell += '.exe'
|
'Contents', 'MacOS', PRODUCT_NAME)
|
||||||
|
elif sys.platform == 'win32':
|
||||||
|
atom_shell = os.path.join(OUT_DIR, '{0}.exe'.format(PROJECT_NAME))
|
||||||
|
else:
|
||||||
|
atom_shell = os.path.join(OUT_DIR, PROJECT_NAME)
|
||||||
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
|
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
|
||||||
execute([atom_shell,
|
execute([atom_shell,
|
||||||
os.path.join('tools', 'dump-version-info.js'),
|
os.path.join('tools', 'dump-version-info.js'),
|
||||||
|
|
|
@ -2,16 +2,21 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
|
import sys
|
||||||
|
|
||||||
from lib.config import s3_config
|
from lib.config import s3_config
|
||||||
from lib.util import execute, rm_rf, safe_mkdir, s3put
|
from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
SYMBOLS_DIR = 'dist\\symbols'
|
SYMBOLS_DIR = 'dist\\symbols'
|
||||||
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent'
|
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchromiumcontent'
|
||||||
|
|
||||||
|
PROJECT_NAME = atom_gyp()['project_name%']
|
||||||
|
PRODUCT_NAME = atom_gyp()['product_name%']
|
||||||
|
|
||||||
PDB_LIST = [
|
PDB_LIST = [
|
||||||
'out\\R\\atom.exe.pdb',
|
'out\\R\\{0}.exe.pdb'.format(PROJECT_NAME),
|
||||||
'out\\R\\node.dll.pdb',
|
'out\\R\\node.dll.pdb',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -22,7 +27,7 @@ def main():
|
||||||
rm_rf(SYMBOLS_DIR)
|
rm_rf(SYMBOLS_DIR)
|
||||||
safe_mkdir(SYMBOLS_DIR)
|
safe_mkdir(SYMBOLS_DIR)
|
||||||
for pdb in PDB_LIST:
|
for pdb in PDB_LIST:
|
||||||
run_symstore(pdb, SYMBOLS_DIR, 'AtomShell')
|
run_symstore(pdb, SYMBOLS_DIR, PRODUCT_NAME)
|
||||||
|
|
||||||
bucket, access_key, secret_key = s3_config()
|
bucket, access_key, secret_key = s3_config()
|
||||||
files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
|
files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
|
||||||
|
@ -40,5 +45,4 @@ def upload_symbols(bucket, access_key, secret_key, files):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
|
@ -8,22 +8,27 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from lib.config import PLATFORM, get_target_arch
|
from lib.config import PLATFORM, get_target_arch
|
||||||
from lib.util import execute, get_atom_shell_version, parse_version, \
|
from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \
|
||||||
get_chromedriver_version, scoped_cwd
|
get_chromedriver_version, scoped_cwd
|
||||||
from lib.github import GitHub
|
from lib.github import GitHub
|
||||||
|
|
||||||
|
|
||||||
ATOM_SHELL_REPO = 'atom/atom-shell'
|
ATOM_SHELL_REPO = 'atom/electron'
|
||||||
ATOM_SHELL_VERSION = get_atom_shell_version()
|
ATOM_SHELL_VERSION = get_atom_shell_version()
|
||||||
CHROMEDRIVER_VERSION = get_chromedriver_version()
|
CHROMEDRIVER_VERSION = get_chromedriver_version()
|
||||||
|
|
||||||
|
PROJECT_NAME = atom_gyp()['project_name%']
|
||||||
|
PRODUCT_NAME = atom_gyp()['product_name%']
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
||||||
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
||||||
DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
|
DIST_NAME = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME,
|
||||||
|
ATOM_SHELL_VERSION,
|
||||||
PLATFORM,
|
PLATFORM,
|
||||||
get_target_arch())
|
get_target_arch())
|
||||||
SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(ATOM_SHELL_VERSION,
|
SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
|
||||||
|
ATOM_SHELL_VERSION,
|
||||||
PLATFORM,
|
PLATFORM,
|
||||||
get_target_arch())
|
get_target_arch())
|
||||||
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
|
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(CHROMEDRIVER_VERSION,
|
||||||
|
|
|
@ -15,11 +15,11 @@ describe 'app module', ->
|
||||||
|
|
||||||
describe 'app.getName()', ->
|
describe 'app.getName()', ->
|
||||||
it 'returns the name field of package.json', ->
|
it 'returns the name field of package.json', ->
|
||||||
assert.equal app.getName(), 'Atom Shell Test App'
|
assert.equal app.getName(), 'Electron Test'
|
||||||
|
|
||||||
describe 'app.setName(name)', ->
|
describe 'app.setName(name)', ->
|
||||||
it 'overrides the name', ->
|
it 'overrides the name', ->
|
||||||
assert.equal app.getName(), 'Atom Shell Test App'
|
assert.equal app.getName(), 'Electron Test'
|
||||||
app.setName 'test-name'
|
app.setName 'test-name'
|
||||||
assert.equal app.getName(), 'test-name'
|
assert.equal app.getName(), 'test-name'
|
||||||
app.setName 'Atom Shell Test App'
|
app.setName 'Electron Test App'
|
||||||
|
|
|
@ -27,8 +27,8 @@ describe 'crash-reporter module', ->
|
||||||
process.throwDeprecation = false
|
process.throwDeprecation = false
|
||||||
form.parse req, (error, fields, files) ->
|
form.parse req, (error, fields, files) ->
|
||||||
process.throwDeprecation = true
|
process.throwDeprecation = true
|
||||||
assert.equal fields['prod'], 'Atom-Shell'
|
assert.equal fields['prod'], 'Electron'
|
||||||
assert.equal fields['ver'], process.versions['atom-shell']
|
assert.equal fields['ver'], process.versions['electron']
|
||||||
assert.equal fields['process_type'], 'renderer'
|
assert.equal fields['process_type'], 'renderer'
|
||||||
assert.equal fields['platform'], process.platform
|
assert.equal fields['platform'], process.platform
|
||||||
assert.equal fields['extra1'], 'extra1'
|
assert.equal fields['extra1'], 'extra1'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "atom-shell-specs",
|
"name": "electron-test",
|
||||||
"productName": "Atom Shell Test App",
|
"productName": "Electron Test",
|
||||||
"main": "static/main.js",
|
"main": "static/main.js",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -137,7 +137,7 @@ app.on('ready', function() {
|
||||||
require('protocol').registerProtocol('test-if-crashes', function() {});
|
require('protocol').registerProtocol('test-if-crashes', function() {});
|
||||||
|
|
||||||
window = new BrowserWindow({
|
window = new BrowserWindow({
|
||||||
title: 'atom-shell tests',
|
title: 'Electron Tests',
|
||||||
show: false,
|
show: false,
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 600,
|
||||||
|
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit da4d745446fcc63bfc205477703533712dd01e2c
|
Subproject commit 9f7ab575d78fa4c50cc5529f15646c8a37eb3258
|
Loading…
Add table
Reference in a new issue