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
a320e712
Commit
a320e712
authored
Sep 19, 2015
by
James Robinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review feedback from pull request #30
parent
7f8319fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+15
-8
No files found.
packages/flutter_tools/lib/src/artifacts.dart
View file @
a320e712
...
...
@@ -7,6 +7,10 @@ library sky_tools.artifacts;
import
'dart:async'
;
import
'dart:io'
;
import
'package:logging/logging.dart'
;
final
Logger
_logging
=
new
Logger
(
'sky_tools.device'
);
enum
Artifact
{
FlutterCompiler
,
}
...
...
@@ -15,13 +19,16 @@ class _ArtifactStore {
_ArtifactStore
.
_
();
Future
_downloadFile
(
String
url
,
File
file
)
async
{
HttpClient
httpClient
=
new
HttpClient
();
HttpClientRequest
request
=
await
httpClient
.
getUrl
(
Uri
.
parse
(
url
));
HttpClientResponse
response
=
await
request
.
close
();
if
(
response
.
statusCode
!=
200
)
throw
new
Exception
(
response
.
reasonPhrase
);
IOSink
sink
=
file
.
openWrite
();
await
sink
.
addStream
(
response
);
await
sink
.
close
();
_logging
.
fine
(
'Downloading
$url
to
${file.path}
'
);
HttpClient
httpClient
=
new
HttpClient
();
HttpClientRequest
request
=
await
httpClient
.
getUrl
(
Uri
.
parse
(
url
));
HttpClientResponse
response
=
await
request
.
close
();
_logging
.
fine
(
'Received response'
);
if
(
response
.
statusCode
!=
200
)
throw
new
Exception
(
response
.
reasonPhrase
);
IOSink
sink
=
file
.
openWrite
();
await
sink
.
addStream
(
response
);
await
sink
.
close
();
_logging
.
fine
(
'Wrote file'
);
}
Future
<
String
>
_getEngineRevision
(
String
packageRoot
)
{
...
...
@@ -44,7 +51,7 @@ class _ArtifactStore {
if
(
artifact
==
Artifact
.
FlutterCompiler
)
{
File
skySnapshotFile
=
new
File
(
cacheDir
.
path
+
'sky_snapshot'
);
if
(!
await
skySnapshotFile
.
exists
())
{
print
(
'Downloading sky_snapshot from the cloud, one moment please...'
);
_logging
.
info
(
'Downloading sky_snapshot from the cloud, one moment please...'
);
String
googleStorageUrl
=
'https://storage.googleapis.com/mojo/sky/shell/linux-x64/
${engineRevision}
/sky_snapshot'
;
await
_downloadFile
(
googleStorageUrl
,
skySnapshotFile
);
ProcessResult
result
=
await
Process
.
run
(
'chmod'
,
[
'u+x'
,
skySnapshotFile
.
path
]);
...
...
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