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
3d276cc6
Unverified
Commit
3d276cc6
authored
May 02, 2019
by
Zachary Anderson
Committed by
GitHub
May 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Pull the right Fuchsia SDK for the platform (#31998)
parent
a40e5c90
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
28 deletions
+47
-28
fuchsia-linux.version
bin/internal/fuchsia-linux.version
+1
-0
fuchsia-mac.version
bin/internal/fuchsia-mac.version
+1
-0
fuchsia.version
bin/internal/fuchsia.version
+0
-1
cache.dart
packages/flutter_tools/lib/src/cache.dart
+45
-27
No files found.
bin/internal/fuchsia-linux.version
0 → 100644
View file @
3d276cc6
-F-MfCBXXKddVWXabbdfQ1im71SzFu9dqYMTJs7TmqoC
bin/internal/fuchsia-mac.version
0 → 100644
View file @
3d276cc6
Hc4DxFUkoHicT-ytOLaxzkT4QYS5uiMXXcZO6s9C1qcC
bin/internal/fuchsia.version
deleted
100644 → 0
View file @
a40e5c90
mfXzGfxNWcf6BHsv083b56vQcj96yCo0exBFBdjE4gMC
packages/flutter_tools/lib/src/cache.dart
View file @
3d276cc6
...
...
@@ -81,7 +81,8 @@ class Cache {
_artifacts
.
add
(
WindowsEngineArtifacts
(
this
));
_artifacts
.
add
(
MacOSEngineArtifacts
(
this
));
_artifacts
.
add
(
LinuxEngineArtifacts
(
this
));
_artifacts
.
add
(
FuchsiaCacheArtifacts
(
this
));
_artifacts
.
add
(
LinuxFuchsiaSDKArtifacts
(
this
));
_artifacts
.
add
(
MacOSFuchsiaSDKArtifacts
(
this
));
}
else
{
_artifacts
.
addAll
(
artifacts
);
}
...
...
@@ -190,13 +191,6 @@ class Cache {
}
String
_engineRevision
;
/// The current version of the Fuchsia SDK the flutter tool will download.
String
get
fuchsiaRevision
{
_fuchsiaRevision
??=
getVersionFor
(
'fuchsia'
);
return
_fuchsiaRevision
;
}
String
_fuchsiaRevision
;
static
Cache
get
instance
=>
context
.
get
<
Cache
>();
/// Return the top-level directory in the cache; this is `bin/cache`.
...
...
@@ -234,7 +228,9 @@ class Cache {
}
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
;
}
...
...
@@ -851,30 +847,52 @@ class GradleWrapper extends CachedArtifact {
}
}
/// The Fuchsia core SDK.
class
FuchsiaCacheArtifacts
extends
CachedArtifact
{
FuchsiaCacheArtifacts
(
Cache
cache
)
:
super
(
'fuchsia'
,
cache
,
const
<
DevelopmentArtifact
>
{
/// Common functionality for pulling Fuchsia SDKs.
abstract
class
_FuchsiaSDKArtifacts
extends
CachedArtifact
{
_FuchsiaSDKArtifacts
(
Cache
cache
,
String
platform
)
:
_path
=
'fuchsia/sdk/core/
$platform
-amd64'
,
super
(
'fuchsia-
$platform
'
,
cache
,
const
<
DevelopmentArtifact
>
{
DevelopmentArtifact
.
fuchsia
,
});
static
const
String
_cipdBaseUrl
=
'https://chrome-infra-packages.appspot.com/dl'
;
static
const
String
_macOSSdk
=
'fuchsia/sdk/core/mac-amd64'
;
static
const
String
_linuxSdk
=
'fuchsia/sdk/core/linux-amd64'
;
static
const
String
_cipdBaseUrl
=
'https://chrome-infra-packages.appspot.com/dl'
;
final
String
_path
;
@override
@override
Directory
get
location
=>
cache
.
getArtifactDirectory
(
'fuchsia'
);
Future
<
void
>
_doUpdate
()
{
final
String
url
=
'
$_cipdBaseUrl
/
$_path
/+/
$version
'
;
return
_downloadZipArchive
(
'Downloading package fuchsia SDK...'
,
Uri
.
parse
(
url
),
location
);
}
}
/// The Fuchsia core SDK for Linux.
class
LinuxFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
LinuxFuchsiaSDKArtifacts
(
Cache
cache
)
:
super
(
cache
,
'linux'
);
@override
Future
<
void
>
updateInner
()
{
if
(!
platform
.
isLinux
)
{
return
Future
<
void
>.
value
();
}
return
_doUpdate
();
}
}
/// The Fuchsia core SDK for MacOS.
class
MacOSFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
MacOSFuchsiaSDKArtifacts
(
Cache
cache
)
:
super
(
cache
,
'mac'
);
@override
Future
<
void
>
updateInner
()
async
{
// Step 1: Determine variant of Fuchsia SDK to download.
String
packageName
;
if
(
platform
.
isLinux
)
{
packageName
=
_linuxSdk
;
}
else
if
(
platform
.
isMacOS
)
{
packageName
=
_macOSSdk
;
}
else
{
// Unsupported.
return
;
if
(!
platform
.
isMacOS
)
{
return
Future
<
void
>.
value
();
}
final
String
url
=
'
$_cipdBaseUrl
/
$packageName
/+/
$version
'
;
await
_downloadZipArchive
(
'Downloading package fuchsia SDK...'
,
Uri
.
parse
(
url
),
location
);
return
_doUpdate
();
}
}
...
...
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