mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
33 Commits
v7.0.0-bet
...
v2.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c5ba35d63 | ||
|
|
0f143fdba0 | ||
|
|
99ae56b782 | ||
|
|
5471bc313f | ||
|
|
b0077241ee | ||
|
|
bb40bc4aca | ||
|
|
76fb7ee87c | ||
|
|
bfc0e3f266 | ||
|
|
48e068997b | ||
|
|
f443974f3d | ||
|
|
36505ae00e | ||
|
|
b330ff8004 | ||
|
|
6cda9460ea | ||
|
|
2cac654974 | ||
|
|
5a210f3d7a | ||
|
|
4bb10c10e4 | ||
|
|
c0076d9c52 | ||
|
|
95539c5b63 | ||
|
|
4f8ca2f03a | ||
|
|
c9b92aebd3 | ||
|
|
6d3f60374e | ||
|
|
8703298e9d | ||
|
|
a42057aabd | ||
|
|
bd2ab27c25 | ||
|
|
1e6d7295cf | ||
|
|
1918da7c2e | ||
|
|
38345c7267 | ||
|
|
c4742df1ee | ||
|
|
5fc485043b | ||
|
|
967dcd3471 | ||
|
|
96f800552c | ||
|
|
afcbb589b6 | ||
|
|
4159103467 |
@@ -58,6 +58,29 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo 'Skipping upload distribution because build is not for release'
|
echo 'Skipping upload distribution because build is not for release'
|
||||||
fi
|
fi
|
||||||
|
- run:
|
||||||
|
name: Optionally finish release
|
||||||
|
shell: /bin/sh
|
||||||
|
command: |
|
||||||
|
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
|
||||||
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
nvm install 8
|
||||||
|
nvm use 8
|
||||||
|
node script/release.js --automaticRelease
|
||||||
|
releaseExitCode=$?
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo 'Release successful, now publishing to npm'
|
||||||
|
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
|
||||||
|
nvm use system
|
||||||
|
npm run publish
|
||||||
|
else
|
||||||
|
echo 'Release is not complete, skipping publish for now.'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo 'Skipping release check'
|
||||||
|
fi
|
||||||
- run:
|
- run:
|
||||||
name: Zip out directory
|
name: Zip out directory
|
||||||
command: |
|
command: |
|
||||||
|
|||||||
63
Dockerfile.arm64v8
Normal file
63
Dockerfile.arm64v8
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
FROM arm64v8/ubuntu:16.04
|
||||||
|
|
||||||
|
RUN groupadd --gid 1000 builduser \
|
||||||
|
&& useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
|
||||||
|
|
||||||
|
RUN groupadd --gid 114 jenkins \
|
||||||
|
&& useradd --uid 110 --gid jenkins --shell /bin/bash --create-home jenkins
|
||||||
|
|
||||||
|
# Set up TEMP directory
|
||||||
|
ENV TEMP=/tmp
|
||||||
|
RUN chmod a+rwx /tmp
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y\
|
||||||
|
bison \
|
||||||
|
build-essential \
|
||||||
|
clang \
|
||||||
|
curl \
|
||||||
|
gperf \
|
||||||
|
git \
|
||||||
|
libasound2 \
|
||||||
|
libasound2-dev \
|
||||||
|
libcap-dev \
|
||||||
|
libcups2-dev \
|
||||||
|
libdbus-1-dev \
|
||||||
|
libgconf-2-4 \
|
||||||
|
libgconf2-dev \
|
||||||
|
libgnome-keyring-dev \
|
||||||
|
libgtk2.0-0 \
|
||||||
|
libgtk2.0-dev \
|
||||||
|
libgtk-3-0 \
|
||||||
|
libgtk-3-dev \
|
||||||
|
libnotify-dev \
|
||||||
|
libnss3 \
|
||||||
|
libnss3-dev \
|
||||||
|
libx11-xcb-dev \
|
||||||
|
libxss1 \
|
||||||
|
libxtst-dev \
|
||||||
|
libxtst6 \
|
||||||
|
lsb-release \
|
||||||
|
locales \
|
||||||
|
ninja \
|
||||||
|
python-setuptools \
|
||||||
|
python-pip \
|
||||||
|
python-dbusmock \
|
||||||
|
wget \
|
||||||
|
xvfb
|
||||||
|
|
||||||
|
# Install node.js
|
||||||
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
||||||
|
RUN apt-get update && apt-get install -y nodejs
|
||||||
|
|
||||||
|
# Install crcmod
|
||||||
|
RUN pip install -U crcmod
|
||||||
|
|
||||||
|
ADD tools/xvfb-init.sh /etc/init.d/xvfb
|
||||||
|
RUN chmod a+x /etc/init.d/xvfb
|
||||||
|
|
||||||
|
# Install ninja in /usr/local
|
||||||
|
RUN cd /usr/local && git clone https://github.com/martine/ninja.git -b v1.5.3
|
||||||
|
RUN cd /usr/local/ninja && ./configure.py --bootstrap
|
||||||
|
|
||||||
|
USER builduser
|
||||||
|
WORKDIR /home/builduser
|
||||||
36
Jenkinsfile.arm64
Normal file
36
Jenkinsfile.arm64
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'electronbuilds/arm64v8:0.0.1'
|
||||||
|
args '--privileged'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
TARGET_ARCH='arm64'
|
||||||
|
DISPLAY=':99.0'
|
||||||
|
MOCHA_TIMEOUT='60000'
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Bootstrap') {
|
||||||
|
steps {
|
||||||
|
sh 'script/bootstrap.py -v --dev --target_arch=$TARGET_ARCH'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'script/build.py -c D --ninja-path /usr/local/ninja/ninja'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
sh '/etc/init.d/xvfb start'
|
||||||
|
sh 'script/test.py --ci'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
cleanWs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,20 +23,16 @@ MenuViews::MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
|
|||||||
|
|
||||||
void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item,
|
void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item,
|
||||||
const base::Closure& callback) {
|
const base::Closure& callback) {
|
||||||
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
|
auto* native_window = static_cast<NativeWindowViews*>(window->window());
|
||||||
if (!native_window)
|
if (!native_window)
|
||||||
return;
|
return;
|
||||||
auto* web_contents = native_window->inspectable_web_contents();
|
|
||||||
if (!web_contents)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// (-1, -1) means showing on mouse location.
|
// (-1, -1) means showing on mouse location.
|
||||||
gfx::Point location;
|
gfx::Point location;
|
||||||
if (x == -1 || y == -1) {
|
if (x == -1 || y == -1) {
|
||||||
location = display::Screen::GetScreen()->GetCursorScreenPoint();
|
location = display::Screen::GetScreen()->GetCursorScreenPoint();
|
||||||
} else {
|
} else {
|
||||||
auto* view = web_contents->GetView()->GetWebView();
|
gfx::Point origin = native_window->GetContentBounds().origin();
|
||||||
gfx::Point origin = view->bounds().origin();
|
|
||||||
location = gfx::Point(origin.x() + x, origin.y() + y);
|
location = gfx::Point(origin.x() + x, origin.y() + y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +48,7 @@ void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item,
|
|||||||
menu_runners_[window_id] = std::unique_ptr<MenuRunner>(new MenuRunner(
|
menu_runners_[window_id] = std::unique_ptr<MenuRunner>(new MenuRunner(
|
||||||
model(), flags, close_callback));
|
model(), flags, close_callback));
|
||||||
menu_runners_[window_id]->RunMenuAt(
|
menu_runners_[window_id]->RunMenuAt(
|
||||||
static_cast<NativeWindowViews*>(window->window())->widget(),
|
native_window->widget(),
|
||||||
NULL,
|
NULL,
|
||||||
gfx::Rect(location, gfx::Size()),
|
gfx::Rect(location, gfx::Size()),
|
||||||
views::MENU_ANCHOR_TOPLEFT,
|
views::MENU_ANCHOR_TOPLEFT,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace atom {
|
|||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
|
//TODO(codebytere): deprecated; remove in 3.0
|
||||||
int Screen::getMenuBarHeight() {
|
int Screen::getMenuBarHeight() {
|
||||||
return [[NSApp mainMenu] menuBarHeight];
|
return [[NSApp mainMenu] menuBarHeight];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -441,14 +441,15 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetDevToolsNetworkEmulationClientIdInIO(
|
void SetDevToolsNetworkEmulationClientIdInIO(
|
||||||
brightray::URLRequestContextGetter* context_getter,
|
brightray::URLRequestContextGetter* url_request_context_getter,
|
||||||
const std::string& client_id) {
|
const std::string& client_id) {
|
||||||
if (!context_getter)
|
if (!url_request_context_getter)
|
||||||
return;
|
return;
|
||||||
auto network_delegate =
|
net::URLRequestContext* context =
|
||||||
static_cast<AtomNetworkDelegate*>(context_getter->network_delegate());
|
url_request_context_getter->GetURLRequestContext();
|
||||||
if (network_delegate)
|
AtomNetworkDelegate* network_delegate =
|
||||||
network_delegate->SetDevToolsNetworkEmulationClientId(client_id);
|
static_cast<AtomNetworkDelegate*>(context->network_delegate());
|
||||||
|
network_delegate->SetDevToolsNetworkEmulationClientId(client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -37,6 +37,26 @@ namespace atom {
|
|||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
template<typename Method, typename Event, typename Listener>
|
||||||
|
void CallNetworkDelegateMethod(
|
||||||
|
brightray::URLRequestContextGetter* url_request_context_getter,
|
||||||
|
Method method,
|
||||||
|
Event type,
|
||||||
|
URLPatterns patterns,
|
||||||
|
Listener listener) {
|
||||||
|
// Force creating network delegate.
|
||||||
|
net::URLRequestContext* context =
|
||||||
|
url_request_context_getter->GetURLRequestContext();
|
||||||
|
// Then call the method.
|
||||||
|
AtomNetworkDelegate* network_delegate =
|
||||||
|
static_cast<AtomNetworkDelegate*>(context->network_delegate());
|
||||||
|
(network_delegate->*method)(type, std::move(patterns), std::move(listener));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
WebRequest::WebRequest(v8::Isolate* isolate,
|
WebRequest::WebRequest(v8::Isolate* isolate,
|
||||||
AtomBrowserContext* browser_context)
|
AtomBrowserContext* browser_context)
|
||||||
: browser_context_(browser_context) {
|
: browser_context_(browser_context) {
|
||||||
@@ -74,16 +94,15 @@ void WebRequest::SetListener(Method method, Event type, mate::Arguments* args) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto url_request_context_getter =
|
brightray::URLRequestContextGetter* url_request_context_getter =
|
||||||
browser_context_->url_request_context_getter();
|
browser_context_->url_request_context_getter();
|
||||||
if (!url_request_context_getter)
|
if (!url_request_context_getter)
|
||||||
return;
|
return;
|
||||||
BrowserThread::PostTask(
|
BrowserThread::PostTask(
|
||||||
BrowserThread::IO, FROM_HERE,
|
BrowserThread::IO, FROM_HERE,
|
||||||
base::Bind(method,
|
base::Bind(&CallNetworkDelegateMethod<Method, Event, Listener>,
|
||||||
base::Unretained(static_cast<AtomNetworkDelegate*>(
|
base::RetainedRef(url_request_context_getter),
|
||||||
url_request_context_getter->network_delegate())),
|
method, type, std::move(patterns), std::move(listener)));
|
||||||
type, patterns, listener));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|||||||
@@ -952,8 +952,11 @@ void Window::ToggleTabBar() {
|
|||||||
window_->ToggleTabBar();
|
window_->ToggleTabBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::AddTabbedWindow(NativeWindow* window) {
|
void Window::AddTabbedWindow(NativeWindow* window,
|
||||||
window_->AddTabbedWindow(window);
|
mate::Arguments* args) {
|
||||||
|
const bool windowAdded = window_->AddTabbedWindow(window);
|
||||||
|
if (!windowAdded)
|
||||||
|
args->ThrowError("AddTabbedWindow cannot be called by a window on itself.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::SetVibrancy(mate::Arguments* args) {
|
void Window::SetVibrancy(mate::Arguments* args) {
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ class Window : public mate::TrackableObject<Window>,
|
|||||||
void MergeAllWindows();
|
void MergeAllWindows();
|
||||||
void MoveTabToNewWindow();
|
void MoveTabToNewWindow();
|
||||||
void ToggleTabBar();
|
void ToggleTabBar();
|
||||||
void AddTabbedWindow(NativeWindow* window);
|
void AddTabbedWindow(NativeWindow* window, mate::Arguments* args);
|
||||||
|
|
||||||
void SetVibrancy(mate::Arguments* args);
|
void SetVibrancy(mate::Arguments* args);
|
||||||
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
|
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
|
||||||
|
|||||||
@@ -362,7 +362,8 @@ void NativeWindow::MoveTabToNewWindow() {
|
|||||||
void NativeWindow::ToggleTabBar() {
|
void NativeWindow::ToggleTabBar() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindow::AddTabbedWindow(NativeWindow* window) {
|
bool NativeWindow::AddTabbedWindow(NativeWindow* window) {
|
||||||
|
return true; // for non-Mac platforms
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindow::SetVibrancy(const std::string& filename) {
|
void NativeWindow::SetVibrancy(const std::string& filename) {
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||||||
virtual void MergeAllWindows();
|
virtual void MergeAllWindows();
|
||||||
virtual void MoveTabToNewWindow();
|
virtual void MoveTabToNewWindow();
|
||||||
virtual void ToggleTabBar();
|
virtual void ToggleTabBar();
|
||||||
virtual void AddTabbedWindow(NativeWindow* window);
|
virtual bool AddTabbedWindow(NativeWindow* window);
|
||||||
|
|
||||||
// Webview APIs.
|
// Webview APIs.
|
||||||
virtual void FocusOnWebView();
|
virtual void FocusOnWebView();
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class NativeWindowMac : public NativeWindow,
|
|||||||
void MergeAllWindows() override;
|
void MergeAllWindows() override;
|
||||||
void MoveTabToNewWindow() override;
|
void MoveTabToNewWindow() override;
|
||||||
void ToggleTabBar() override;
|
void ToggleTabBar() override;
|
||||||
void AddTabbedWindow(NativeWindow* window) override;
|
bool AddTabbedWindow(NativeWindow* window) override;
|
||||||
|
|
||||||
void SetVibrancy(const std::string& type) override;
|
void SetVibrancy(const std::string& type) override;
|
||||||
void SetTouchBar(
|
void SetTouchBar(
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "skia/ext/skia_utils_mac.h"
|
#include "skia/ext/skia_utils_mac.h"
|
||||||
#include "third_party/skia/include/core/SkRegion.h"
|
#include "third_party/skia/include/core/SkRegion.h"
|
||||||
#include "ui/gfx/skia_util.h"
|
#include "ui/gfx/skia_util.h"
|
||||||
|
#include "ui/gl/gpu_switching_manager.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -1677,10 +1678,14 @@ void NativeWindowMac::ToggleTabBar() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
|
bool NativeWindowMac::AddTabbedWindow(NativeWindow* window) {
|
||||||
if ([window_ respondsToSelector:@selector(addTabbedWindow:ordered:)]) {
|
if (window_.get() == window->GetNativeWindow()) {
|
||||||
[window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove];
|
return false;
|
||||||
|
} else {
|
||||||
|
if ([window_ respondsToSelector:@selector(addTabbedWindow:ordered:)])
|
||||||
|
[window_ addTabbedWindow:window->GetNativeWindow() ordered:NSWindowAbove];
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::SetRenderWidgetHostOpaque(bool opaque) {
|
void NativeWindowMac::SetRenderWidgetHostOpaque(bool opaque) {
|
||||||
@@ -1712,6 +1717,7 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
|
|||||||
|
|
||||||
[vibrant_view removeFromSuperview];
|
[vibrant_view removeFromSuperview];
|
||||||
[window_ setVibrantView:nil];
|
[window_ setVibrantView:nil];
|
||||||
|
ui::GpuSwitchingManager::SetTransparent(transparent());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1719,9 +1725,12 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
|
|||||||
SetRenderWidgetHostOpaque(false);
|
SetRenderWidgetHostOpaque(false);
|
||||||
background_color_before_vibrancy_.reset([window_ backgroundColor]);
|
background_color_before_vibrancy_.reset([window_ backgroundColor]);
|
||||||
transparency_before_vibrancy_ = [window_ titlebarAppearsTransparent];
|
transparency_before_vibrancy_ = [window_ titlebarAppearsTransparent];
|
||||||
|
ui::GpuSwitchingManager::SetTransparent(true);
|
||||||
|
|
||||||
[window_ setTitlebarAppearsTransparent:YES];
|
if (title_bar_style_ != NORMAL) {
|
||||||
[window_ setBackgroundColor:[NSColor clearColor]];
|
[window_ setTitlebarAppearsTransparent:YES];
|
||||||
|
[window_ setBackgroundColor:[NSColor clearColor]];
|
||||||
|
}
|
||||||
|
|
||||||
NSVisualEffectView* effect_view = (NSVisualEffectView*)vibrant_view;
|
NSVisualEffectView* effect_view = (NSVisualEffectView*)vibrant_view;
|
||||||
if (effect_view == nil) {
|
if (effect_view == nil) {
|
||||||
|
|||||||
@@ -227,22 +227,22 @@ AtomNetworkDelegate::~AtomNetworkDelegate() {
|
|||||||
|
|
||||||
void AtomNetworkDelegate::SetSimpleListenerInIO(
|
void AtomNetworkDelegate::SetSimpleListenerInIO(
|
||||||
SimpleEvent type,
|
SimpleEvent type,
|
||||||
const URLPatterns& patterns,
|
URLPatterns patterns,
|
||||||
const SimpleListener& callback) {
|
SimpleListener callback) {
|
||||||
if (callback.is_null())
|
if (callback.is_null())
|
||||||
simple_listeners_.erase(type);
|
simple_listeners_.erase(type);
|
||||||
else
|
else
|
||||||
simple_listeners_[type] = { patterns, callback };
|
simple_listeners_[type] = { std::move(patterns), std::move(callback) };
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomNetworkDelegate::SetResponseListenerInIO(
|
void AtomNetworkDelegate::SetResponseListenerInIO(
|
||||||
ResponseEvent type,
|
ResponseEvent type,
|
||||||
const URLPatterns& patterns,
|
URLPatterns patterns,
|
||||||
const ResponseListener& callback) {
|
ResponseListener callback) {
|
||||||
if (callback.is_null())
|
if (callback.is_null())
|
||||||
response_listeners_.erase(type);
|
response_listeners_.erase(type);
|
||||||
else
|
else
|
||||||
response_listeners_[type] = { patterns, callback };
|
response_listeners_[type] = { std::move(patterns), std::move(callback) };
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomNetworkDelegate::SetDevToolsNetworkEmulationClientId(
|
void AtomNetworkDelegate::SetDevToolsNetworkEmulationClientId(
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ class AtomNetworkDelegate : public brightray::NetworkDelegate {
|
|||||||
~AtomNetworkDelegate() override;
|
~AtomNetworkDelegate() override;
|
||||||
|
|
||||||
void SetSimpleListenerInIO(SimpleEvent type,
|
void SetSimpleListenerInIO(SimpleEvent type,
|
||||||
const URLPatterns& patterns,
|
URLPatterns patterns,
|
||||||
const SimpleListener& callback);
|
SimpleListener callback);
|
||||||
void SetResponseListenerInIO(ResponseEvent type,
|
void SetResponseListenerInIO(ResponseEvent type,
|
||||||
const URLPatterns& patterns,
|
URLPatterns patterns,
|
||||||
const ResponseListener& callback);
|
ResponseListener callback);
|
||||||
|
|
||||||
void SetDevToolsNetworkEmulationClientId(const std::string& client_id);
|
void SetDevToolsNetworkEmulationClientId(const std::string& client_id);
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>electron.icns</string>
|
<string>electron.icns</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.8.2</string>
|
<string>2.0.0</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.8.2</string>
|
<string>2.0.0</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.developer-tools</string>
|
<string>public.app-category.developer-tools</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ END
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,8,2,2
|
FILEVERSION 2,0,0,3
|
||||||
PRODUCTVERSION 1,8,2,2
|
PRODUCTVERSION 2,0,0,3
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@@ -74,12 +74,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "GitHub, Inc."
|
VALUE "CompanyName", "GitHub, Inc."
|
||||||
VALUE "FileDescription", "Electron"
|
VALUE "FileDescription", "Electron"
|
||||||
VALUE "FileVersion", "1.8.2"
|
VALUE "FileVersion", "2.0.0"
|
||||||
VALUE "InternalName", "electron.exe"
|
VALUE "InternalName", "electron.exe"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
|
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
|
||||||
VALUE "OriginalFilename", "electron.exe"
|
VALUE "OriginalFilename", "electron.exe"
|
||||||
VALUE "ProductName", "Electron"
|
VALUE "ProductName", "Electron"
|
||||||
VALUE "ProductVersion", "1.8.2"
|
VALUE "ProductVersion", "2.0.0"
|
||||||
VALUE "SquirrelAwareVersion", "1"
|
VALUE "SquirrelAwareVersion", "1"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|||||||
@@ -9,12 +9,15 @@
|
|||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "ui/base/accelerators/accelerator.h"
|
#include "ui/base/accelerators/accelerator.h"
|
||||||
#include "ui/base/accelerators/platform_accelerator_cocoa.h"
|
#include "ui/base/accelerators/platform_accelerator_cocoa.h"
|
||||||
#include "ui/base/l10n/l10n_util_mac.h"
|
#include "ui/base/l10n/l10n_util_mac.h"
|
||||||
#include "ui/events/cocoa/cocoa_event_utils.h"
|
#include "ui/events/cocoa/cocoa_event_utils.h"
|
||||||
#include "ui/gfx/image/image.h"
|
#include "ui/gfx/image/image.h"
|
||||||
|
|
||||||
|
using content::BrowserThread;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct Role {
|
struct Role {
|
||||||
@@ -335,7 +338,11 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
|
|||||||
if (isMenuOpen_) {
|
if (isMenuOpen_) {
|
||||||
isMenuOpen_ = NO;
|
isMenuOpen_ = NO;
|
||||||
model_->MenuWillClose();
|
model_->MenuWillClose();
|
||||||
closeCallback.Run();
|
// Post async task so that itemSelected runs before the close callback
|
||||||
|
// deletes the controller from the map which deallocates it
|
||||||
|
if (!closeCallback.is_null()) {
|
||||||
|
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, closeCallback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#ifndef ATOM_COMMON_ATOM_VERSION_H_
|
#ifndef ATOM_COMMON_ATOM_VERSION_H_
|
||||||
#define ATOM_COMMON_ATOM_VERSION_H_
|
#define ATOM_COMMON_ATOM_VERSION_H_
|
||||||
|
|
||||||
#define ATOM_MAJOR_VERSION 1
|
#define ATOM_MAJOR_VERSION 2
|
||||||
#define ATOM_MINOR_VERSION 8
|
#define ATOM_MINOR_VERSION 0
|
||||||
#define ATOM_PATCH_VERSION 2
|
#define ATOM_PATCH_VERSION 0
|
||||||
#define ATOM_PRE_RELEASE_VERSION -beta.2
|
#define ATOM_PRE_RELEASE_VERSION -beta.3
|
||||||
|
|
||||||
#ifndef ATOM_STRINGIFY
|
#ifndef ATOM_STRINGIFY
|
||||||
#define ATOM_STRINGIFY(n) ATOM_STRINGIFY_HELPER(n)
|
#define ATOM_STRINGIFY(n) ATOM_STRINGIFY_HELPER(n)
|
||||||
|
|||||||
@@ -157,7 +157,6 @@
|
|||||||
'-ldl',
|
'-ldl',
|
||||||
'-lresolv',
|
'-lresolv',
|
||||||
'-lfontconfig',
|
'-lfontconfig',
|
||||||
'-lfreetype',
|
|
||||||
'-lexpat',
|
'-lexpat',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -169,14 +168,6 @@
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
# On ARM64 libchromiumcontent always links to system libfreetype
|
|
||||||
['target_arch=="arm64"', {
|
|
||||||
'link_settings': {
|
|
||||||
'libraries': [
|
|
||||||
'-lfreetype',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}],
|
|
||||||
],
|
],
|
||||||
}], # OS=="linux"
|
}], # OS=="linux"
|
||||||
['OS=="mac"', {
|
['OS=="mac"', {
|
||||||
|
|||||||
@@ -80,11 +80,6 @@ class URLRequestContextGetter : public net::URLRequestContextGetter {
|
|||||||
|
|
||||||
net::HostResolver* host_resolver();
|
net::HostResolver* host_resolver();
|
||||||
net::URLRequestJobFactory* job_factory() const { return job_factory_; }
|
net::URLRequestJobFactory* job_factory() const { return job_factory_; }
|
||||||
net::NetworkDelegate* network_delegate() const {
|
|
||||||
if (url_request_context_)
|
|
||||||
return url_request_context_->network_delegate();
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Delegate* delegate_;
|
Delegate* delegate_;
|
||||||
|
|||||||
@@ -235,7 +235,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
|||||||
window shadow and window animations. Default is `true`.
|
window shadow and window animations. Default is `true`.
|
||||||
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
|
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
|
||||||
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
|
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
|
||||||
`menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`.
|
`menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. Please note that
|
||||||
|
using `frame: false` in combination with a vibrancy value requires that you use a
|
||||||
|
non-default `titleBarStyle` as well.
|
||||||
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
|
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
|
||||||
option-clicking the green stoplight button on the toolbar or by clicking the
|
option-clicking the green stoplight button on the toolbar or by clicking the
|
||||||
Window > Zoom menu item. If `true`, the window will grow to the preferred
|
Window > Zoom menu item. If `true`, the window will grow to the preferred
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
The following list includes the APIs that will be removed in Electron 2.0.
|
The following list includes the APIs that will be removed in Electron 2.0.
|
||||||
|
|
||||||
There is no timetable for when this release will occur but deprecation
|
There is no timetable for when this release will occur but deprecation
|
||||||
warnings will be added at least 90 days beforehand.
|
warnings will be added at least [one major version](electron-versioning.md#semver) beforehand.
|
||||||
|
|
||||||
## `app`
|
## `app`
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
'product_name%': 'Electron',
|
'product_name%': 'Electron',
|
||||||
'company_name%': 'GitHub, Inc',
|
'company_name%': 'GitHub, Inc',
|
||||||
'company_abbr%': 'github',
|
'company_abbr%': 'github',
|
||||||
'version%': '1.8.2-beta.2',
|
'version%': '2.0.0-beta.3',
|
||||||
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
|
'js2c_input_dir': '<(SHARED_INTERMEDIATE_DIR)/js2c',
|
||||||
},
|
},
|
||||||
'includes': [
|
'includes': [
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const electron = require('electron')
|
|||||||
const {deprecate, Menu} = electron
|
const {deprecate, Menu} = electron
|
||||||
const {EventEmitter} = require('events')
|
const {EventEmitter} = require('events')
|
||||||
|
|
||||||
|
let dockMenu = null
|
||||||
|
|
||||||
// App is an EventEmitter.
|
// App is an EventEmitter.
|
||||||
Object.setPrototypeOf(App.prototype, EventEmitter.prototype)
|
Object.setPrototypeOf(App.prototype, EventEmitter.prototype)
|
||||||
EventEmitter.call(app)
|
EventEmitter.call(app)
|
||||||
@@ -49,7 +51,13 @@ if (process.platform === 'darwin') {
|
|||||||
hide: bindings.dockHide,
|
hide: bindings.dockHide,
|
||||||
show: bindings.dockShow,
|
show: bindings.dockShow,
|
||||||
isVisible: bindings.dockIsVisible,
|
isVisible: bindings.dockIsVisible,
|
||||||
setMenu: bindings.dockSetMenu,
|
setMenu (menu) {
|
||||||
|
dockMenu = menu
|
||||||
|
bindings.dockSetMenu(menu)
|
||||||
|
},
|
||||||
|
getMenu () {
|
||||||
|
return dockMenu
|
||||||
|
},
|
||||||
setIcon: bindings.dockSetIcon
|
setIcon: bindings.dockSetIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
const {EventEmitter} = require('events')
|
const {EventEmitter} = require('events')
|
||||||
|
const {deprecate} = require('electron')
|
||||||
const {screen, Screen} = process.atomBinding('screen')
|
const {screen, Screen} = process.atomBinding('screen')
|
||||||
|
|
||||||
// Screen is an EventEmitter.
|
// Screen is an EventEmitter.
|
||||||
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
||||||
EventEmitter.call(screen)
|
EventEmitter.call(screen)
|
||||||
|
|
||||||
|
const nativeFn = screen.getMenuBarHeight
|
||||||
|
screen.getMenuBarHeight = function () {
|
||||||
|
if (!process.noDeprecations) {
|
||||||
|
deprecate.warn('screen.getMenuBarHeight', 'screen.getPrimaryDisplay().workArea')
|
||||||
|
}
|
||||||
|
return nativeFn.call(this)
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = screen
|
module.exports = screen
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "electron",
|
"name": "electron",
|
||||||
"version": "1.8.2-beta.2",
|
"version": "2.0.0-beta.3",
|
||||||
"repository": "https://github.com/electron/electron",
|
"repository": "https://github.com/electron/electron",
|
||||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ def main():
|
|||||||
ninja += '.exe'
|
ninja += '.exe'
|
||||||
|
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
if args.ninja_path:
|
||||||
|
ninja = args.ninja_path
|
||||||
if args.libcc:
|
if args.libcc:
|
||||||
if ('D' not in args.configuration
|
if ('D' not in args.configuration
|
||||||
or not os.path.exists(GCLIENT_DONE)
|
or not os.path.exists(GCLIENT_DONE)
|
||||||
@@ -67,6 +69,9 @@ def parse_args():
|
|||||||
'-d --debug_libchromiumcontent.'
|
'-d --debug_libchromiumcontent.'
|
||||||
),
|
),
|
||||||
action='store_true', default=False)
|
action='store_true', default=False)
|
||||||
|
parser.add_argument('--ninja-path',
|
||||||
|
help='Path of ninja command to use.',
|
||||||
|
required=False)
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ const circleCIJobs = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const jenkinsJobs = [
|
const jenkinsJobs = [
|
||||||
'electron-mas-x64-release',
|
'electron-release'
|
||||||
'electron-osx-x64-release'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
async function makeRequest (requestOptions, parseResponse) {
|
async function makeRequest (requestOptions, parseResponse) {
|
||||||
@@ -38,7 +37,7 @@ async function makeRequest (requestOptions, parseResponse) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function circleCIcall (buildUrl, targetBranch, job, ghRelease) {
|
async function circleCIcall (buildUrl, targetBranch, job, options) {
|
||||||
assert(process.env.CIRCLE_TOKEN, 'CIRCLE_TOKEN not found in environment')
|
assert(process.env.CIRCLE_TOKEN, 'CIRCLE_TOKEN not found in environment')
|
||||||
console.log(`Triggering CircleCI to run build job: ${job} on branch: ${targetBranch} with release flag.`)
|
console.log(`Triggering CircleCI to run build job: ${job} on branch: ${targetBranch} with release flag.`)
|
||||||
let buildRequest = {
|
let buildRequest = {
|
||||||
@@ -47,12 +46,16 @@ async function circleCIcall (buildUrl, targetBranch, job, ghRelease) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ghRelease) {
|
if (options.ghRelease) {
|
||||||
buildRequest.build_parameters.ELECTRON_RELEASE = 1
|
buildRequest.build_parameters.ELECTRON_RELEASE = 1
|
||||||
} else {
|
} else {
|
||||||
buildRequest.build_parameters.RUN_RELEASE_BUILD = 'true'
|
buildRequest.build_parameters.RUN_RELEASE_BUILD = 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.automaticRelease) {
|
||||||
|
buildRequest.build_parameters.AUTO_RELEASE = 'true'
|
||||||
|
}
|
||||||
|
|
||||||
let circleResponse = await makeRequest({
|
let circleResponse = await makeRequest({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: buildUrl,
|
url: buildUrl,
|
||||||
@@ -67,17 +70,21 @@ async function circleCIcall (buildUrl, targetBranch, job, ghRelease) {
|
|||||||
console.log(`Check ${circleResponse.build_url} for status. (${job})`)
|
console.log(`Check ${circleResponse.build_url} for status. (${job})`)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function buildAppVeyor (targetBranch, ghRelease) {
|
async function buildAppVeyor (targetBranch, options) {
|
||||||
console.log(`Triggering AppVeyor to run build on branch: ${targetBranch} with release flag.`)
|
console.log(`Triggering AppVeyor to run build on branch: ${targetBranch} with release flag.`)
|
||||||
assert(process.env.APPVEYOR_TOKEN, 'APPVEYOR_TOKEN not found in environment')
|
assert(process.env.APPVEYOR_TOKEN, 'APPVEYOR_TOKEN not found in environment')
|
||||||
let environmentVariables = {}
|
let environmentVariables = {}
|
||||||
|
|
||||||
if (ghRelease) {
|
if (options.ghRelease) {
|
||||||
environmentVariables.ELECTRON_RELEASE = 1
|
environmentVariables.ELECTRON_RELEASE = 1
|
||||||
} else {
|
} else {
|
||||||
environmentVariables.RUN_RELEASE_BUILD = 'true'
|
environmentVariables.RUN_RELEASE_BUILD = 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.automaticRelease) {
|
||||||
|
environmentVariables.AUTO_RELEASE = 'true'
|
||||||
|
}
|
||||||
|
|
||||||
const requestOpts = {
|
const requestOpts = {
|
||||||
url: buildAppVeyorURL,
|
url: buildAppVeyorURL,
|
||||||
auth: {
|
auth: {
|
||||||
@@ -101,27 +108,27 @@ async function buildAppVeyor (targetBranch, ghRelease) {
|
|||||||
console.log(`AppVeyor release build request successful. Check build status at ${buildUrl}`)
|
console.log(`AppVeyor release build request successful. Check build status at ${buildUrl}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildCircleCI (targetBranch, ghRelease, job) {
|
function buildCircleCI (targetBranch, options) {
|
||||||
const circleBuildUrl = `https://circleci.com/api/v1.1/project/github/electron/electron/tree/${targetBranch}?circle-token=${process.env.CIRCLE_TOKEN}`
|
const circleBuildUrl = `https://circleci.com/api/v1.1/project/github/electron/electron/tree/${targetBranch}?circle-token=${process.env.CIRCLE_TOKEN}`
|
||||||
if (job) {
|
if (options.job) {
|
||||||
assert(circleCIJobs.includes(job), `Unknown CI job name: ${job}.`)
|
assert(circleCIJobs.includes(options.job), `Unknown CI job name: ${options.job}.`)
|
||||||
circleCIcall(circleBuildUrl, targetBranch, job, ghRelease)
|
circleCIcall(circleBuildUrl, targetBranch, options.job, options)
|
||||||
} else {
|
} else {
|
||||||
circleCIJobs.forEach((job) => circleCIcall(circleBuildUrl, targetBranch, job, ghRelease))
|
circleCIJobs.forEach((job) => circleCIcall(circleBuildUrl, targetBranch, job, options))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function buildJenkins (targetBranch, ghRelease, job) {
|
async function buildJenkins (targetBranch, options) {
|
||||||
assert(process.env.JENKINS_AUTH_TOKEN, 'JENKINS_AUTH_TOKEN not found in environment')
|
assert(process.env.JENKINS_AUTH_TOKEN, 'JENKINS_AUTH_TOKEN not found in environment')
|
||||||
assert(process.env.JENKINS_BUILD_TOKEN, 'JENKINS_BUILD_TOKEN not found in environment')
|
assert(process.env.JENKINS_BUILD_TOKEN, 'JENKINS_BUILD_TOKEN not found in environment')
|
||||||
let jenkinsCrumb = await getJenkinsCrumb()
|
let jenkinsCrumb = await getJenkinsCrumb()
|
||||||
|
|
||||||
if (job) {
|
if (options.job) {
|
||||||
assert(jenkinsJobs.includes(job), `Unknown CI job name: ${job}.`)
|
assert(jenkinsJobs.includes(options.job), `Unknown CI job name: ${options.job}.`)
|
||||||
callJenkinsBuild(job, jenkinsCrumb, targetBranch, ghRelease)
|
callJenkinsBuild(options.job, jenkinsCrumb, targetBranch, options)
|
||||||
} else {
|
} else {
|
||||||
jenkinsJobs.forEach((job) => {
|
jenkinsJobs.forEach((job) => {
|
||||||
callJenkinsBuild(job, jenkinsCrumb, targetBranch, ghRelease)
|
callJenkinsBuild(job, jenkinsCrumb, targetBranch, options)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,15 +151,18 @@ async function callJenkins (path, requestParameters, requestHeaders) {
|
|||||||
return jenkinsResponse
|
return jenkinsResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
async function callJenkinsBuild (job, jenkinsCrumb, targetBranch, ghRelease) {
|
async function callJenkinsBuild (job, jenkinsCrumb, targetBranch, options) {
|
||||||
console.log(`Triggering Jenkins to run build job: ${job} on branch: ${targetBranch} with release flag.`)
|
console.log(`Triggering Jenkins to run build job: ${job} on branch: ${targetBranch} with release flag.`)
|
||||||
let jenkinsParams = {
|
let jenkinsParams = {
|
||||||
token: process.env.JENKINS_BUILD_TOKEN,
|
token: process.env.JENKINS_BUILD_TOKEN,
|
||||||
BRANCH: targetBranch
|
BRANCH: targetBranch
|
||||||
}
|
}
|
||||||
if (!ghRelease) {
|
if (!options.ghRelease) {
|
||||||
jenkinsParams.RUN_RELEASE_BUILD = 1
|
jenkinsParams.RUN_RELEASE_BUILD = 1
|
||||||
}
|
}
|
||||||
|
if (options.automaticRelease) {
|
||||||
|
jenkinsParams.AUTO_RELEASE = 'true'
|
||||||
|
}
|
||||||
await callJenkins(`job/${job}/buildWithParameters`, jenkinsParams, jenkinsCrumb)
|
await callJenkins(`job/${job}/buildWithParameters`, jenkinsParams, jenkinsCrumb)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log(`Error calling Jenkins build`, err)
|
console.log(`Error calling Jenkins build`, err)
|
||||||
@@ -177,33 +187,35 @@ function runRelease (targetBranch, options) {
|
|||||||
if (options.ci) {
|
if (options.ci) {
|
||||||
switch (options.ci) {
|
switch (options.ci) {
|
||||||
case 'CircleCI': {
|
case 'CircleCI': {
|
||||||
buildCircleCI(targetBranch, options.ghRelease, options.job)
|
buildCircleCI(targetBranch, options)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'AppVeyor': {
|
case 'AppVeyor': {
|
||||||
buildAppVeyor(targetBranch, options.ghRelease)
|
buildAppVeyor(targetBranch, options)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 'Jenkins': {
|
case 'Jenkins': {
|
||||||
buildJenkins(targetBranch, options.ghRelease, options.job)
|
buildJenkins(targetBranch, options)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
buildCircleCI(targetBranch, options.ghRelease, options.job)
|
buildCircleCI(targetBranch, options)
|
||||||
buildAppVeyor(targetBranch, options.ghRelease)
|
buildAppVeyor(targetBranch, options)
|
||||||
buildJenkins(targetBranch, options.ghRelease, options.job)
|
buildJenkins(targetBranch, options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = runRelease
|
module.exports = runRelease
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
const args = require('minimist')(process.argv.slice(2), { boolean: 'ghRelease' })
|
const args = require('minimist')(process.argv.slice(2), {
|
||||||
|
boolean: ['ghRelease', 'automaticRelease']
|
||||||
|
})
|
||||||
const targetBranch = args._[0]
|
const targetBranch = args._[0]
|
||||||
if (args._.length < 1) {
|
if (args._.length < 1) {
|
||||||
console.log(`Trigger CI to build release builds of electron.
|
console.log(`Trigger CI to build release builds of electron.
|
||||||
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--ci=CircleCI|AppVeyor|Jenkins] [--ghRelease] TARGET_BRANCH
|
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--ci=CircleCI|AppVeyor|Jenkins] [--ghRelease] [--automaticRelease] TARGET_BRANCH
|
||||||
`)
|
`)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
require('colors')
|
require('colors')
|
||||||
const args = require('minimist')(process.argv.slice(2))
|
const args = require('minimist')(process.argv.slice(2), {
|
||||||
|
boolean: ['automaticRelease', 'notesOnly', 'stable']
|
||||||
|
})
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const ciReleaseBuild = require('./ci-release-build')
|
const ciReleaseBuild = require('./ci-release-build')
|
||||||
const { execSync } = require('child_process')
|
const { execSync } = require('child_process')
|
||||||
@@ -20,7 +22,7 @@ const versionType = args._[0]
|
|||||||
assert(process.env.ELECTRON_GITHUB_TOKEN, 'ELECTRON_GITHUB_TOKEN not found in environment')
|
assert(process.env.ELECTRON_GITHUB_TOKEN, 'ELECTRON_GITHUB_TOKEN not found in environment')
|
||||||
if (!versionType && !args.notesOnly) {
|
if (!versionType && !args.notesOnly) {
|
||||||
console.log(`Usage: prepare-release versionType [major | minor | patch | beta]` +
|
console.log(`Usage: prepare-release versionType [major | minor | patch | beta]` +
|
||||||
` (--stable) (--notesOnly)`)
|
` (--stable) (--notesOnly) (--automaticRelease)`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +78,10 @@ async function getReleaseNotes (currentBranch) {
|
|||||||
base: `v${pkg.version}`,
|
base: `v${pkg.version}`,
|
||||||
head: currentBranch
|
head: currentBranch
|
||||||
}
|
}
|
||||||
let releaseNotes = '(placeholder)\n'
|
let releaseNotes = ''
|
||||||
|
if (!args.automaticRelease) {
|
||||||
|
releaseNotes = '(placeholder)\n'
|
||||||
|
}
|
||||||
console.log(`Checking for commits from ${pkg.version} to ${currentBranch}`)
|
console.log(`Checking for commits from ${pkg.version} to ${currentBranch}`)
|
||||||
let commitComparison = await github.repos.compareCommits(githubOpts)
|
let commitComparison = await github.repos.compareCommits(githubOpts)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@@ -85,10 +90,21 @@ async function getReleaseNotes (currentBranch) {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (commitComparison.data.commits.length === 0) {
|
||||||
|
console.log(`${pass} There are no commits from ${pkg.version} to ` +
|
||||||
|
`${currentBranch}, skipping release.`)
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
commitComparison.data.commits.forEach(commitEntry => {
|
commitComparison.data.commits.forEach(commitEntry => {
|
||||||
let commitMessage = commitEntry.commit.message
|
let commitMessage = commitEntry.commit.message
|
||||||
if (commitMessage.toLowerCase().indexOf('merge') > -1) {
|
if (commitMessage.toLowerCase().indexOf('merge') > -1) {
|
||||||
releaseNotes += `${commitMessage} \n`
|
let mergeRE = /Merge pull request (#\d+) from .*\n/
|
||||||
|
let prMatch = commitMessage.match(mergeRE)
|
||||||
|
commitMessage = commitMessage.replace(mergeRE, '').replace('\n', '')
|
||||||
|
if (commitMessage.substr(commitMessage.length - 1, commitMessage.length) !== '.') {
|
||||||
|
commitMessage += '.'
|
||||||
|
}
|
||||||
|
releaseNotes += `${commitMessage} ${prMatch[1]} \n\n`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(`${pass} Done generating release notes for ${currentBranch}.`)
|
console.log(`${pass} Done generating release notes for ${currentBranch}.`)
|
||||||
@@ -152,7 +168,8 @@ async function pushRelease () {
|
|||||||
|
|
||||||
async function runReleaseBuilds (branch) {
|
async function runReleaseBuilds (branch) {
|
||||||
await ciReleaseBuild(branch, {
|
await ciReleaseBuild(branch, {
|
||||||
ghRelease: true
|
ghRelease: true,
|
||||||
|
automaticRelease: args.automaticRelease
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +210,11 @@ async function promptForVersion (version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function prepareRelease (isBeta, notesOnly) {
|
async function prepareRelease (isBeta, notesOnly) {
|
||||||
|
if (args.automaticRelease && (pkg.version.indexOf('beta') === -1 ||
|
||||||
|
versionType !== 'beta')) {
|
||||||
|
console.log(`${fail} Automatic release is only supported for beta releases`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
let currentBranch = await getCurrentBranch(gitDir)
|
let currentBranch = await getCurrentBranch(gitDir)
|
||||||
if (notesOnly) {
|
if (notesOnly) {
|
||||||
let releaseNotes = await getReleaseNotes(currentBranch)
|
let releaseNotes = await getReleaseNotes(currentBranch)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ const assert = require('assert')
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const { execSync } = require('child_process')
|
const { execSync } = require('child_process')
|
||||||
const GitHub = require('github')
|
const GitHub = require('github')
|
||||||
const { GitProcess } = require('dugite')
|
|
||||||
const nugget = require('nugget')
|
const nugget = require('nugget')
|
||||||
const pkg = require('../package.json')
|
const pkg = require('../package.json')
|
||||||
const pkgVersion = `v${pkg.version}`
|
const pkgVersion = `v${pkg.version}`
|
||||||
@@ -24,7 +23,6 @@ const github = new GitHub({
|
|||||||
followRedirects: false
|
followRedirects: false
|
||||||
})
|
})
|
||||||
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
|
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
|
||||||
const gitDir = path.resolve(__dirname, '..')
|
|
||||||
|
|
||||||
async function getDraftRelease (version, skipValidation) {
|
async function getDraftRelease (version, skipValidation) {
|
||||||
let releaseInfo = await github.repos.getReleases({owner: 'electron', repo: 'electron'})
|
let releaseInfo = await github.repos.getReleases({owner: 'electron', repo: 'electron'})
|
||||||
@@ -62,16 +60,18 @@ async function validateReleaseAssets (release, validatingRelease) {
|
|||||||
})
|
})
|
||||||
check((failureCount === 0), `All required GitHub assets exist for release`, true)
|
check((failureCount === 0), `All required GitHub assets exist for release`, true)
|
||||||
|
|
||||||
if (release.draft) {
|
if (!validatingRelease || !release.draft) {
|
||||||
await verifyAssets(release)
|
if (release.draft) {
|
||||||
} else {
|
await verifyAssets(release)
|
||||||
await verifyShasums(downloadUrls)
|
} else {
|
||||||
.catch(err => {
|
await verifyShasums(downloadUrls)
|
||||||
console.log(`${fail} error verifyingShasums`, err)
|
.catch(err => {
|
||||||
})
|
console.log(`${fail} error verifyingShasums`, err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const s3Urls = s3UrlsForVersion(release.tag_name)
|
||||||
|
await verifyShasums(s3Urls, true)
|
||||||
}
|
}
|
||||||
const s3Urls = s3UrlsForVersion(release.tag_name)
|
|
||||||
await verifyShasums(s3Urls, true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function check (condition, statement, exitIfFail = false) {
|
function check (condition, statement, exitIfFail = false) {
|
||||||
@@ -148,7 +148,11 @@ function s3UrlsForVersion (version) {
|
|||||||
function checkVersion () {
|
function checkVersion () {
|
||||||
console.log(`Verifying that app version matches package version ${pkgVersion}.`)
|
console.log(`Verifying that app version matches package version ${pkgVersion}.`)
|
||||||
let startScript = path.join(__dirname, 'start.py')
|
let startScript = path.join(__dirname, 'start.py')
|
||||||
let appVersion = runScript(startScript, ['--version']).trim()
|
let scriptArgs = ['--version']
|
||||||
|
if (args.automaticRelease) {
|
||||||
|
scriptArgs.unshift('-R')
|
||||||
|
}
|
||||||
|
let appVersion = runScript(startScript, scriptArgs).trim()
|
||||||
check((pkgVersion.indexOf(appVersion) === 0), `App version ${appVersion} matches ` +
|
check((pkgVersion.indexOf(appVersion) === 0), `App version ${appVersion} matches ` +
|
||||||
`package version ${pkgVersion}.`, true)
|
`package version ${pkgVersion}.`, true)
|
||||||
}
|
}
|
||||||
@@ -276,7 +280,6 @@ async function makeRelease (releaseToValidate) {
|
|||||||
draftRelease = await getDraftRelease(pkgVersion, true)
|
draftRelease = await getDraftRelease(pkgVersion, true)
|
||||||
await validateReleaseAssets(draftRelease)
|
await validateReleaseAssets(draftRelease)
|
||||||
await publishRelease(draftRelease)
|
await publishRelease(draftRelease)
|
||||||
await cleanupReleaseBranch()
|
|
||||||
console.log(`${pass} SUCCESS!!! Release has been published. Please run ` +
|
console.log(`${pass} SUCCESS!!! Release has been published. Please run ` +
|
||||||
`"npm run publish-to-npm" to publish release to npm.`)
|
`"npm run publish-to-npm" to publish release to npm.`)
|
||||||
}
|
}
|
||||||
@@ -444,25 +447,4 @@ async function validateChecksums (validationArgs) {
|
|||||||
`shasums defined in ${validationArgs.shaSumFile}.`)
|
`shasums defined in ${validationArgs.shaSumFile}.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function cleanupReleaseBranch () {
|
|
||||||
console.log(`Cleaning up release branch.`)
|
|
||||||
let errorMessage = `Could not delete local release branch.`
|
|
||||||
let successMessage = `Successfully deleted local release branch.`
|
|
||||||
await callGit(['branch', '-D', 'release'], errorMessage, successMessage)
|
|
||||||
errorMessage = `Could not delete remote release branch.`
|
|
||||||
successMessage = `Successfully deleted remote release branch.`
|
|
||||||
return callGit(['push', 'origin', ':release'], errorMessage, successMessage)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function callGit (args, errorMessage, successMessage) {
|
|
||||||
let gitResult = await GitProcess.exec(args, gitDir)
|
|
||||||
if (gitResult.exitCode === 0) {
|
|
||||||
console.log(`${pass} ${successMessage}`)
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
console.log(`${fail} ${errorMessage} ${gitResult.stderr}`)
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
makeRelease(args.validateRelease)
|
makeRelease(args.validateRelease)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ STAMP_FILE="${LLVM_DIR}/../llvm-build/cr_build_revision"
|
|||||||
LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project}
|
LLVM_REPO_URL=${LLVM_URL:-https://llvm.org/svn/llvm-project}
|
||||||
|
|
||||||
CDS_URL=https://commondatastorage.googleapis.com/chromium-browser-clang
|
CDS_URL=https://commondatastorage.googleapis.com/chromium-browser-clang
|
||||||
|
S3_URL=https://s3.amazonaws.com/gh-contractor-zcbenz/clang
|
||||||
|
|
||||||
|
|
||||||
# Die if any command dies, error on undefined variable expansions.
|
# Die if any command dies, error on undefined variable expansions.
|
||||||
@@ -49,7 +50,12 @@ CDS_FILE="clang-${PACKAGE_VERSION}.tgz"
|
|||||||
CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX)
|
CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX)
|
||||||
CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}"
|
CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}"
|
||||||
if [ "${OS}" = "Linux" ]; then
|
if [ "${OS}" = "Linux" ]; then
|
||||||
CDS_FULL_URL="${CDS_URL}/Linux_x64/${CDS_FILE}"
|
ARCH="$(uname -m)"
|
||||||
|
if [ "${ARCH}" = "aarch64" ]; then
|
||||||
|
CDS_FULL_URL="${S3_URL}/arm64/${CDS_FILE}"
|
||||||
|
else
|
||||||
|
CDS_FULL_URL="${CDS_URL}/Linux_x64/${CDS_FILE}"
|
||||||
|
fi
|
||||||
elif [ "${OS}" = "Darwin" ]; then
|
elif [ "${OS}" = "Darwin" ]; then
|
||||||
CDS_FULL_URL="${CDS_URL}/Mac/${CDS_FILE}"
|
CDS_FULL_URL="${CDS_URL}/Mac/${CDS_FILE}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const path = require('path')
|
|||||||
const {ipcRenderer, remote} = require('electron')
|
const {ipcRenderer, remote} = require('electron')
|
||||||
const {closeWindow} = require('./window-helpers')
|
const {closeWindow} = require('./window-helpers')
|
||||||
|
|
||||||
const {app, BrowserWindow, ipcMain} = remote
|
const {app, BrowserWindow, Menu, ipcMain} = remote
|
||||||
|
|
||||||
const isCI = remote.getGlobal('isCi')
|
const isCI = remote.getGlobal('isCi')
|
||||||
|
|
||||||
@@ -158,21 +158,23 @@ describe('app module', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('exits gracefully on macos', function (done) {
|
it('exits gracefully', function (done) {
|
||||||
if (process.platform !== 'darwin') {
|
if (!['darwin', 'linux'].includes(process.platform)) {
|
||||||
this.skip()
|
this.skip()
|
||||||
}
|
}
|
||||||
const appPath = path.join(__dirname, 'fixtures', 'api', 'singleton')
|
|
||||||
const electronPath = remote.getGlobal('process').execPath
|
const electronPath = remote.getGlobal('process').execPath
|
||||||
|
const appPath = path.join(__dirname, 'fixtures', 'api', 'singleton')
|
||||||
appProcess = ChildProcess.spawn(electronPath, [appPath])
|
appProcess = ChildProcess.spawn(electronPath, [appPath])
|
||||||
appProcess.stdout.once('data', () => {
|
|
||||||
// The apple script will try to terminate the app
|
// Singleton will send us greeting data to let us know it's running.
|
||||||
// If there's an error terminating the app, then it will print to stderr
|
// After that, ask it to exit gracefully and confirm that it does.
|
||||||
ChildProcess.exec('osascript -e \'quit app "Electron"\'', (err, stdout, stderr) => {
|
appProcess.stdout.on('data', (data) => appProcess.kill())
|
||||||
assert(!err)
|
appProcess.on('exit', (code, sig) => {
|
||||||
assert(!stderr.trim())
|
let message = ['code:', code, 'sig:', sig].join('\n')
|
||||||
done()
|
assert.equal(code, 0, message)
|
||||||
})
|
assert.equal(sig, null, message)
|
||||||
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -881,4 +883,18 @@ describe('app module', () => {
|
|||||||
}, /before app is ready/)
|
}, /before app is ready/)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('dock.setMenu', () => {
|
||||||
|
before(function () {
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
this.skip()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
it('keeps references to the menu', () => {
|
||||||
|
app.dock.setMenu(new Menu())
|
||||||
|
const v8Util = process.atomBinding('v8_util')
|
||||||
|
v8Util.requestGarbageCollectionForTesting()
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -733,6 +733,12 @@ describe('BrowserWindow module', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('throws when called on itself', () => {
|
||||||
|
assert.throws(() => {
|
||||||
|
w.addTabbedWindow(w)
|
||||||
|
}, /AddTabbedWindow cannot be called by a window on itself./)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('BrowserWindow.setVibrancy(type)', () => {
|
describe('BrowserWindow.setVibrancy(type)', () => {
|
||||||
|
|||||||
@@ -18,17 +18,4 @@ describe('screen module', () => {
|
|||||||
assert(display.size.height > 0)
|
assert(display.size.height > 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('screen.getMenuBarHeight()', () => {
|
|
||||||
before(function () {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
this.skip()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
it('returns an integer', () => {
|
|
||||||
const screenHeight = screen.getMenuBarHeight()
|
|
||||||
assert.equal(typeof screenHeight, 'number')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
4
spec/fixtures/api/singleton/main.js
vendored
4
spec/fixtures/api/singleton/main.js
vendored
@@ -1,6 +1,8 @@
|
|||||||
const {app} = require('electron')
|
const {app} = require('electron')
|
||||||
|
|
||||||
console.log('started') // ping parent
|
app.once('ready', () => {
|
||||||
|
console.log('started') // ping parent
|
||||||
|
})
|
||||||
|
|
||||||
const shouldExit = app.makeSingleInstance(() => {
|
const shouldExit = app.makeSingleInstance(() => {
|
||||||
process.nextTick(() => app.exit(0))
|
process.nextTick(() => app.exit(0))
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ describe('modules support', () => {
|
|||||||
|
|
||||||
describe('ffi', () => {
|
describe('ffi', () => {
|
||||||
before(function () {
|
before(function () {
|
||||||
if (!nativeModulesEnabled || process.platform === 'win32') {
|
if (!nativeModulesEnabled || process.platform === 'win32' ||
|
||||||
|
process.arch === 'arm64') {
|
||||||
this.skip()
|
this.skip()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -51,7 +51,11 @@
|
|||||||
if (!process.env.MOCHA_REPORTER) {
|
if (!process.env.MOCHA_REPORTER) {
|
||||||
mocha.ui('bdd').reporter(isCi ? 'tap' : 'html')
|
mocha.ui('bdd').reporter(isCi ? 'tap' : 'html')
|
||||||
}
|
}
|
||||||
mocha.timeout(isCi ? 30000 : 10000)
|
if (process.env.MOCHA_TIMEOUT && process.env.MOCHA_TIMEOUT > 0) {
|
||||||
|
mocha.timeout(process.env.MOCHA_TIMEOUT)
|
||||||
|
} else {
|
||||||
|
mocha.timeout(isCi ? 30000 : 10000)
|
||||||
|
}
|
||||||
|
|
||||||
const query = Mocha.utils.parseQuery(window.location.search || '')
|
const query = Mocha.utils.parseQuery(window.location.search || '')
|
||||||
if (query.grep) mocha.grep(query.grep)
|
if (query.grep) mocha.grep(query.grep)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function getDate () {
|
|||||||
|
|
||||||
function getInfoForCurrentVersion () {
|
function getInfoForCurrentVersion () {
|
||||||
var json = {}
|
var json = {}
|
||||||
json.version = process.versions['atom-shell']
|
json.version = process.versions.electron
|
||||||
json.date = getDate()
|
json.date = getDate()
|
||||||
|
|
||||||
var names = ['node', 'v8', 'uv', 'zlib', 'openssl', 'modules', 'chrome']
|
var names = ['node', 'v8', 'uv', 'zlib', 'openssl', 'modules', 'chrome']
|
||||||
|
|||||||
2
vendor/libchromiumcontent
vendored
2
vendor/libchromiumcontent
vendored
Submodule vendor/libchromiumcontent updated: db1b314c01...5a77d6578a
Reference in New Issue
Block a user