Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
15ba3956
Unverified
Commit
15ba3956
authored
Apr 24, 2019
by
Jonah Williams
Committed by
GitHub
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace no-op log reader with real implementation (#31526)
parent
fee1d3db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
57 deletions
+41
-57
desktop.dart
packages/flutter_tools/lib/src/desktop.dart
+22
-0
linux_device.dart
packages/flutter_tools/lib/src/linux/linux_device.dart
+6
-19
macos_device.dart
packages/flutter_tools/lib/src/macos/macos_device.dart
+6
-19
windows_device.dart
packages/flutter_tools/lib/src/windows/windows_device.dart
+7
-19
No files found.
packages/flutter_tools/lib/src/desktop.dart
View file @
15ba3956
...
...
@@ -2,9 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'base/io.dart'
;
import
'base/platform.dart'
;
import
'base/process_manager.dart'
;
import
'convert.dart'
;
import
'device.dart'
;
import
'version.dart'
;
// Only launch or display desktop embedding devices if
...
...
@@ -47,3 +51,21 @@ Future<bool> killProcess(String executable) async {
}
return
succeeded
;
}
class
DesktopLogReader
extends
DeviceLogReader
{
final
StreamController
<
String
>
_inputController
=
StreamController
<
String
>.
broadcast
();
void
initializeProcess
(
Process
process
)
{
_inputController
.
addStream
(
process
.
stdout
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
()));
}
@override
Stream
<
String
>
get
logLines
{
return
_inputController
.
stream
;
}
@override
String
get
name
=>
'desktop'
;
}
packages/flutter_tools/lib/src/linux/linux_device.dart
View file @
15ba3956
...
...
@@ -8,7 +8,6 @@ import '../base/os.dart';
import
'../base/platform.dart'
;
import
'../base/process_manager.dart'
;
import
'../build_info.dart'
;
import
'../convert.dart'
;
import
'../desktop.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
;
...
...
@@ -26,7 +25,10 @@ class LinuxDevice extends Device {
void
clearLogs
()
{
}
@override
DeviceLogReader
getLogReader
({
ApplicationPackage
app
})
=>
NoOpDeviceLogReader
(
'linux'
);
DeviceLogReader
getLogReader
({
ApplicationPackage
app
})
{
return
_logReader
;
}
final
DesktopLogReader
_logReader
=
DesktopLogReader
();
// Since the host and target devices are the same, no work needs to be done
// to install the application.
...
...
@@ -79,8 +81,8 @@ class LinuxDevice extends Device {
if
(
debuggingOptions
?.
buildInfo
?.
isRelease
==
true
)
{
return
LaunchResult
.
succeeded
();
}
final
LinuxLogReader
logReader
=
LinuxLogReader
(
package
,
process
);
final
ProtocolDiscovery
observatoryDiscovery
=
ProtocolDiscovery
.
observatory
(
logReader
);
_logReader
.
initializeProcess
(
process
);
final
ProtocolDiscovery
observatoryDiscovery
=
ProtocolDiscovery
.
observatory
(
_
logReader
);
try
{
final
Uri
observatoryUri
=
await
observatoryDiscovery
.
uri
;
return
LaunchResult
.
succeeded
(
observatoryUri:
observatoryUri
);
...
...
@@ -129,18 +131,3 @@ class LinuxDevices extends PollingDeviceDiscovery {
@override
Future
<
List
<
String
>>
getDiagnostics
()
async
=>
const
<
String
>[];
}
class
LinuxLogReader
extends
DeviceLogReader
{
LinuxLogReader
(
this
.
linuxApp
,
this
.
process
);
final
LinuxApp
linuxApp
;
final
Process
process
;
@override
Stream
<
String
>
get
logLines
{
return
process
.
stdout
.
transform
(
utf8
.
decoder
);
}
@override
String
get
name
=>
linuxApp
.
displayName
;
}
packages/flutter_tools/lib/src/macos/macos_device.dart
View file @
15ba3956
...
...
@@ -9,7 +9,6 @@ import '../base/platform.dart';
import
'../base/process_manager.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../convert.dart'
;
import
'../desktop.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
;
...
...
@@ -27,7 +26,10 @@ class MacOSDevice extends Device {
void
clearLogs
()
{
}
@override
DeviceLogReader
getLogReader
({
ApplicationPackage
app
})
=>
NoOpDeviceLogReader
(
'macos'
);
DeviceLogReader
getLogReader
({
ApplicationPackage
app
})
{
return
_deviceLogReader
;
}
final
DesktopLogReader
_deviceLogReader
=
DesktopLogReader
();
// Since the host and target devices are the same, no work needs to be done
// to install the application.
...
...
@@ -83,8 +85,8 @@ class MacOSDevice extends Device {
if
(
debuggingOptions
?.
buildInfo
?.
isRelease
==
true
)
{
return
LaunchResult
.
succeeded
();
}
final
MacOSLogReader
logReader
=
MacOSLogReader
(
package
,
process
);
final
ProtocolDiscovery
observatoryDiscovery
=
ProtocolDiscovery
.
observatory
(
l
ogReader
);
_deviceLogReader
.
initializeProcess
(
process
);
final
ProtocolDiscovery
observatoryDiscovery
=
ProtocolDiscovery
.
observatory
(
_deviceL
ogReader
);
try
{
final
Uri
observatoryUri
=
await
observatoryDiscovery
.
uri
;
// Bring app to foreground.
...
...
@@ -139,18 +141,3 @@ class MacOSDevices extends PollingDeviceDiscovery {
@override
Future
<
List
<
String
>>
getDiagnostics
()
async
=>
const
<
String
>[];
}
class
MacOSLogReader
extends
DeviceLogReader
{
MacOSLogReader
(
this
.
macOSApp
,
this
.
process
);
final
MacOSApp
macOSApp
;
final
Process
process
;
@override
Stream
<
String
>
get
logLines
{
return
process
.
stdout
.
transform
(
utf8
.
decoder
);
}
@override
String
get
name
=>
macOSApp
.
displayName
;
}
packages/flutter_tools/lib/src/windows/windows_device.dart
View file @
15ba3956
...
...
@@ -10,7 +10,7 @@ import '../base/os.dart';
import
'../base/platform.dart'
;
import
'../base/process_manager.dart'
;
import
'../build_info.dart'
;
import
'../
convert
.dart'
;
import
'../
desktop
.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
;
import
'../project.dart'
;
...
...
@@ -27,7 +27,10 @@ class WindowsDevice extends Device {
void
clearLogs
()
{
}
@override
DeviceLogReader
getLogReader
({
ApplicationPackage
app
})
=>
NoOpDeviceLogReader
(
'windows'
);
DeviceLogReader
getLogReader
({
ApplicationPackage
app
})
{
return
_logReader
;
}
final
DesktopLogReader
_logReader
=
DesktopLogReader
();
// Since the host and target devices are the same, no work needs to be done
// to install the application.
...
...
@@ -80,8 +83,8 @@ class WindowsDevice extends Device {
if
(
debuggingOptions
?.
buildInfo
?.
isRelease
==
true
)
{
return
LaunchResult
.
succeeded
();
}
final
WindowsLogReader
logReader
=
WindowsLogReader
(
package
,
process
);
final
ProtocolDiscovery
observatoryDiscovery
=
ProtocolDiscovery
.
observatory
(
logReader
);
_logReader
.
initializeProcess
(
process
);
final
ProtocolDiscovery
observatoryDiscovery
=
ProtocolDiscovery
.
observatory
(
_
logReader
);
try
{
final
Uri
observatoryUri
=
await
observatoryDiscovery
.
uri
;
return
LaunchResult
.
succeeded
(
observatoryUri:
observatoryUri
);
...
...
@@ -162,18 +165,3 @@ List<String> runningProcess(String processName) {
}
return
null
;
}
class
WindowsLogReader
extends
DeviceLogReader
{
WindowsLogReader
(
this
.
windowsApp
,
this
.
process
);
final
WindowsApp
windowsApp
;
final
Process
process
;
@override
Stream
<
String
>
get
logLines
{
return
process
.
stdout
.
transform
(
utf8
.
decoder
);
}
@override
String
get
name
=>
windowsApp
.
displayName
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment