mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
adding windows platform to felt. fixing signal (#15111)
This commit is contained in:
parent
4e9e69d2b3
commit
f001ea29f1
@ -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'
|
||||
|
||||
@ -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';
|
||||
}
|
||||
@ -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) {
|
||||
|
||||
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user