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
630284bd
Commit
630284bd
authored
Nov 21, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #544 from abarth/fix_analyzer
Fix analyzer warnings
parents
cbc79c57
99d51f5f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
25 deletions
+30
-25
update_packages.dart
dev/update_packages.dart
+6
-1
apk.dart
packages/flutter_tools/lib/src/commands/apk.dart
+2
-2
main.dart
packages/updater/lib/main.dart
+2
-2
pipe_to_file.dart
packages/updater/lib/pipe_to_file.dart
+20
-20
No files found.
dev/update_packages.dart
View file @
630284bd
...
...
@@ -10,7 +10,12 @@ update(Directory directory) {
for
(
FileSystemEntity
dir
in
directory
.
listSync
())
{
if
(
dir
is
Directory
)
{
print
(
"Updating
${dir.path}
..."
);
Process
.
runSync
(
binaryName
,
[
'get'
],
workingDirectory:
dir
.
path
);
ProcessResult
result
=
Process
.
runSync
(
binaryName
,
[
'get'
],
workingDirectory:
dir
.
path
);
if
(
result
.
exitCode
!=
0
)
{
print
(
"... failed with exit code
${result.exitCode}
."
);
print
(
result
.
stdout
);
print
(
result
.
stderr
);
}
}
}
}
...
...
packages/flutter_tools/lib/src/commands/apk.dart
View file @
630284bd
...
...
@@ -172,11 +172,11 @@ class ApkCommand extends FlutterCommand {
components
.
keystore
=
new
File
(
artifactPaths
[
3
]);
if
(!
components
.
androidSdk
.
existsSync
())
{
_logging
.
severe
(
'Can not locate Android SDK:
$
{androidSdkPath}
'
);
_logging
.
severe
(
'Can not locate Android SDK:
$
androidSdkPath
'
);
return
null
;
}
if
(!(
new
_ApkBuilder
(
components
.
androidSdk
.
path
).
checkSdkPath
()))
{
_logging
.
severe
(
'Can not locate expected Android SDK tools at
$
{androidSdkPath}
'
);
_logging
.
severe
(
'Can not locate expected Android SDK tools at
$
androidSdkPath
'
);
_logging
.
severe
(
'You must install version
$_kAndroidPlatformVersion
of the SDK platform'
);
_logging
.
severe
(
'and version
$_kBuildToolsVersion
of the build tools.'
);
return
null
;
...
...
packages/updater/lib/main.dart
View file @
630284bd
...
...
@@ -98,8 +98,8 @@ class UpdateTask {
_tempPath
=
path
.
join
(
_dataDir
,
'tmp.skyx'
);
String
bundleUrl
=
_currentManifest
[
'update-url'
]
+
'/'
+
kBundleFile
;
UrlResponse
response
=
await
fetchUrl
(
bundleUrl
);
MojoResul
t
result
=
await
PipeToFile
.
copyToFile
(
response
.
body
,
_tempPath
);
if
(
!
result
.
is
Ok
)
in
t
result
=
await
PipeToFile
.
copyToFile
(
response
.
body
,
_tempPath
);
if
(
result
!=
MojoResult
.
k
Ok
)
throw
new
UpdateFailure
(
'Failure fetching new package:
${response.statusLine}
'
);
}
...
...
packages/updater/lib/pipe_to_file.dart
View file @
630284bd
...
...
@@ -11,15 +11,15 @@ import 'package:mojo/core.dart';
// Helper class to drain the contents of a mojo data pipe to a file.
class
PipeToFile
{
MojoDataPipeConsumer
_consumer
;
MojoEventSubscription
_event
Stream
;
MojoEventSubscription
_event
s
;
IOSink
_outputStream
;
PipeToFile
(
this
.
_consumer
,
String
outputPath
)
{
_event
Stream
=
new
MojoEventSubscription
(
_consumer
.
handle
);
_event
s
=
new
MojoEventSubscription
(
_consumer
.
handle
);
_outputStream
=
new
File
(
outputPath
).
openWrite
();
}
Future
<
MojoResul
t
>
_doRead
()
async
{
Future
<
in
t
>
_doRead
()
async
{
ByteData
thisRead
=
_consumer
.
beginRead
();
if
(
thisRead
==
null
)
{
throw
'Data pipe beginRead failed:
${_consumer.status}
'
;
...
...
@@ -30,34 +30,34 @@ class PipeToFile {
return
_consumer
.
endRead
(
thisRead
.
lengthInBytes
);
}
Future
drain
()
async
{
Completer
completer
=
new
Completer
();
// TODO(mpcomplete): Is it legit to pass an async callback to
listen
?
_event
Stream
.
subscribe
((
List
<
int
>
event
)
async
{
MojoHandleSignals
mojoSignals
=
new
MojoHandleSignals
(
event
[
1
])
;
if
(
mojoSignals
.
isReadable
)
{
MojoResul
t
result
=
await
_doRead
();
if
(
!
result
.
is
Ok
)
{
_event
Stream
.
close
();
_event
Stream
=
null
;
Future
<
int
>
drain
()
{
Completer
<
int
>
completer
=
new
Completer
();
// TODO(mpcomplete): Is it legit to pass an async callback to
subscribe
?
_event
s
.
subscribe
((
List
<
int
>
event
)
async
{
int
signal
=
event
[
1
]
;
if
(
MojoHandleSignals
.
isReadable
(
signal
)
)
{
in
t
result
=
await
_doRead
();
if
(
result
!=
MojoResult
.
k
Ok
)
{
_event
s
.
close
();
_event
s
=
null
;
_outputStream
.
close
();
completer
.
complete
(
result
);
}
else
{
_event
Stream
.
enableReadEvents
();
_event
s
.
enableReadEvents
();
}
}
else
if
(
mojoSignals
.
isPeerClosed
)
{
_event
Stream
.
close
();
_event
Stream
=
null
;
}
else
if
(
MojoHandleSignals
.
isPeerClosed
(
signal
)
)
{
_event
s
.
close
();
_event
s
=
null
;
_outputStream
.
close
();
completer
.
complete
(
MojoResult
.
OK
);
completer
.
complete
(
MojoResult
.
kOk
);
}
else
{
throw
'Unexpected handle event:
$
mojoSignals
'
;
throw
'Unexpected handle event:
$
{MojoHandleSignals.string(signal)}
'
;
}
});
return
completer
.
future
;
}
static
Future
<
MojoResul
t
>
copyToFile
(
MojoDataPipeConsumer
consumer
,
String
outputPath
)
{
static
Future
<
in
t
>
copyToFile
(
MojoDataPipeConsumer
consumer
,
String
outputPath
)
{
PipeToFile
drainer
=
new
PipeToFile
(
consumer
,
outputPath
);
return
drainer
.
drain
();
}
...
...
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