Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] adding windows platform to felt. fixing signal #15111

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions lib/web_ui/dev/browser_lock.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
chrome:
# It seems Chrome can't always release from the same build for all operating
# systems, so we specify per-OS build number.
Linux: 695653
Mac: 695656
firefox:
version: '71.0'
chrome:
# It seems Chrome can't always release from the same build for all operating
# systems, so we specify per-OS build number.
Linux: 695653
Mac: 695656
Win: 695655
firefox:
version: '71.0'
34 changes: 34 additions & 0 deletions lib/web_ui/dev/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ abstract class PlatformBinding {
_instance = _LinuxBinding();
} else if (io.Platform.isMacOS) {
_instance = _MacBinding();
} else if (io.Platform.isWindows) {
_instance = _WindowsBinding();
} else {
throw '${io.Platform.operatingSystem} is not supported';
}
Expand All @@ -54,6 +56,38 @@ abstract class PlatformBinding {
const String _kBaseDownloadUrl =
'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o';

class _WindowsBinding implements PlatformBinding {
@override
int getChromeBuild(YamlMap browserLock) {
final YamlMap chromeMap = browserLock['chrome'];
return chromeMap['Win'];
}

@override
String getChromeDownloadUrl(String version) =>
'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win%2F${version}%2Fchrome-win32.zip?alt=media';

@override
String getChromeExecutablePath(io.Directory versionDir) =>
path.join(versionDir.path, 'chrome-win32', 'chrome');

@override
String getFirefoxDownloadUrl(String version) =>
'https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/win64/en-US/firefox-${version}.exe';

@override
String getFirefoxExecutablePath(io.Directory versionDir) =>
path.join(versionDir.path, 'firefox', 'firefox');

@override
String getFirefoxLatestVersionUrl() =>
'https://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US';

@override
String getSafariSystemExecutablePath() =>
throw UnsupportedError('Safari is not supported on Windows');
}

class _LinuxBinding implements PlatformBinding {
@override
int getChromeBuild(YamlMap browserLock) {
Expand Down
12 changes: 8 additions & 4 deletions lib/web_ui/dev/felt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ void _listenToShutdownSignals() {
print('Received SIGINT. Shutting down.');
io.exit(1);
});
io.ProcessSignal.sigterm.watch().listen((_) {
print('Received SIGTERM. Shutting down.');
io.exit(1);
});
// SIGTERM signals are not generated under Windows.
// See https://docs.microsoft.com/en-us/previous-versions/xdkz3x12(v%3Dvs.140)
if (!io.Platform.isWindows) {
io.ProcessSignal.sigterm.watch().listen((_) {
print('Received SIGTERM. Shutting down.');
io.exit(1);
});
}
}