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
5f727126
Unverified
Commit
5f727126
authored
Mar 20, 2019
by
Jonah Williams
Committed by
GitHub
Mar 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Download secondary SDK (#29633)
parent
c72f18fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
cache.dart
packages/flutter_tools/lib/src/cache.dart
+35
-0
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
5f727126
...
@@ -24,6 +24,7 @@ class Cache {
...
@@ -24,6 +24,7 @@ class Cache {
_artifacts
.
add
(
MaterialFonts
(
this
));
_artifacts
.
add
(
MaterialFonts
(
this
));
_artifacts
.
add
(
FlutterEngine
(
this
));
_artifacts
.
add
(
FlutterEngine
(
this
));
_artifacts
.
add
(
GradleWrapper
(
this
));
_artifacts
.
add
(
GradleWrapper
(
this
));
_artifacts
.
add
(
FlutterWebSdk
(
this
));
}
else
{
}
else
{
_artifacts
.
addAll
(
artifacts
);
_artifacts
.
addAll
(
artifacts
);
}
}
...
@@ -162,6 +163,12 @@ class Cache {
...
@@ -162,6 +163,12 @@ class Cache {
return
getCacheArtifacts
().
childDirectory
(
name
);
return
getCacheArtifacts
().
childDirectory
(
name
);
}
}
/// The web sdk has to be co-located with the dart-sdk so that they can share source
/// code.
Directory
getWebSdkDirectory
()
{
return
getRoot
().
childDirectory
(
'flutter_web_sdk'
);
}
String
getVersionFor
(
String
artifactName
)
{
String
getVersionFor
(
String
artifactName
)
{
final
File
versionFile
=
fs
.
file
(
fs
.
path
.
join
(
_rootOverride
?.
path
??
flutterRoot
,
'bin'
,
'internal'
,
'
$artifactName
.version'
));
final
File
versionFile
=
fs
.
file
(
fs
.
path
.
join
(
_rootOverride
?.
path
??
flutterRoot
,
'bin'
,
'internal'
,
'
$artifactName
.version'
));
return
versionFile
.
existsSync
()
?
versionFile
.
readAsStringSync
().
trim
()
:
null
;
return
versionFile
.
existsSync
()
?
versionFile
.
readAsStringSync
().
trim
()
:
null
;
...
@@ -357,6 +364,34 @@ class MaterialFonts extends CachedArtifact {
...
@@ -357,6 +364,34 @@ class MaterialFonts extends CachedArtifact {
}
}
}
}
/// A cached artifact containing the web dart:ui sources, platform dill files,
/// and libraries.json.
///
/// This SDK references code within the regular Dart sdk to reduce download size.
class
FlutterWebSdk
extends
CachedArtifact
{
FlutterWebSdk
(
Cache
cache
)
:
super
(
'flutter_web_sdk'
,
cache
);
@override
Directory
get
location
=>
cache
.
getWebSdkDirectory
();
@override
String
get
version
=>
cache
.
getVersionFor
(
'engine'
);
@override
Future
<
void
>
updateInner
()
{
String
platformName
=
'flutter-web-sdk-'
;
if
(
platform
.
isMacOS
)
{
platformName
+=
'darwin-x64'
;
}
else
if
(
platform
.
isLinux
)
{
platformName
+=
'linux-x64'
;
}
else
if
(
platform
.
isWindows
)
{
platformName
+=
'windows-x64'
;
}
final
Uri
url
=
Uri
.
parse
(
'
$_storageBaseUrl
/flutter_infra/flutter/
$version
/
$platformName
.zip'
);
return
_downloadZipArchive
(
'Downloading Web SDK...'
,
url
,
location
);
}
}
/// A cached artifact containing the Flutter engine binaries.
/// A cached artifact containing the Flutter engine binaries.
class
FlutterEngine
extends
CachedArtifact
{
class
FlutterEngine
extends
CachedArtifact
{
FlutterEngine
(
Cache
cache
)
:
super
(
'engine'
,
cache
);
FlutterEngine
(
Cache
cache
)
:
super
(
'engine'
,
cache
);
...
...
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