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
c9a5f943
Unverified
Commit
c9a5f943
authored
Jul 29, 2019
by
Jonah Williams
Committed by
GitHub
Jul 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include flutter_runner in precache artifacts. (#36318)
parent
9f083162
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
5 deletions
+46
-5
cache.dart
packages/flutter_tools/lib/src/cache.dart
+32
-3
precache.dart
packages/flutter_tools/lib/src/commands/precache.dart
+2
-0
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+9
-0
precache_test.dart
...tter_tools/test/general.shard/commands/precache_test.dart
+3
-2
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
c9a5f943
...
...
@@ -50,6 +50,9 @@ class DevelopmentArtifact {
/// Artifacts required for Fuchsia.
static
const
DevelopmentArtifact
fuchsia
=
DevelopmentArtifact
.
_
(
'fuchsia'
,
unstable:
true
);
/// Artifacts required for the Flutter Runner.
static
const
DevelopmentArtifact
flutterRunner
=
DevelopmentArtifact
.
_
(
'flutter_runner'
,
unstable:
true
);
/// Artifacts required for any development platform.
static
const
DevelopmentArtifact
universal
=
DevelopmentArtifact
.
_
(
'universal'
);
...
...
@@ -63,6 +66,7 @@ class DevelopmentArtifact {
linux
,
fuchsia
,
universal
,
flutterRunner
,
];
}
...
...
@@ -83,6 +87,7 @@ class Cache {
_artifacts
.
add
(
LinuxEngineArtifacts
(
this
));
_artifacts
.
add
(
LinuxFuchsiaSDKArtifacts
(
this
));
_artifacts
.
add
(
MacOSFuchsiaSDKArtifacts
(
this
));
_artifacts
.
add
(
FlutterRunnerSDKArtifacts
(
this
));
for
(
String
artifactName
in
IosUsbArtifacts
.
artifactNames
)
{
_artifacts
.
add
(
IosUsbArtifacts
(
artifactName
,
this
));
}
...
...
@@ -870,6 +875,9 @@ class GradleWrapper extends CachedArtifact {
}
}
const
String
_cipdBaseUrl
=
'https://chrome-infra-packages.appspot.com/dl'
;
/// Common functionality for pulling Fuchsia SDKs.
abstract
class
_FuchsiaSDKArtifacts
extends
CachedArtifact
{
_FuchsiaSDKArtifacts
(
Cache
cache
,
String
platform
)
...
...
@@ -878,9 +886,6 @@ abstract class _FuchsiaSDKArtifacts extends CachedArtifact {
DevelopmentArtifact
.
fuchsia
,
});
static
const
String
_cipdBaseUrl
=
'https://chrome-infra-packages.appspot.com/dl'
;
final
String
_path
;
@override
...
...
@@ -893,6 +898,30 @@ abstract class _FuchsiaSDKArtifacts extends CachedArtifact {
}
}
/// The pre-built flutter runner for Fuchsia development.
class
FlutterRunnerSDKArtifacts
extends
CachedArtifact
{
FlutterRunnerSDKArtifacts
(
Cache
cache
)
:
super
(
'flutter_runner'
,
cache
,
const
<
DevelopmentArtifact
>{
DevelopmentArtifact
.
flutterRunner
,
});
@override
Directory
get
location
=>
cache
.
getArtifactDirectory
(
'flutter_runner'
);
@override
String
get
version
=>
cache
.
getVersionFor
(
'engine'
);
@override
Future
<
void
>
updateInner
()
async
{
if
(!
platform
.
isLinux
&&
!
platform
.
isMacOS
)
{
return
Future
<
void
>.
value
();
}
final
String
url
=
'
$_cipdBaseUrl
/flutter/fuchsia/+/git_revision:
$version
'
;
await
_downloadZipArchive
(
'Downloading package flutter runner...'
,
Uri
.
parse
(
url
),
location
);
}
}
/// The Fuchsia core SDK for Linux.
class
LinuxFuchsiaSDKArtifacts
extends
_FuchsiaSDKArtifacts
{
LinuxFuchsiaSDKArtifacts
(
Cache
cache
)
:
super
(
cache
,
'linux'
);
...
...
packages/flutter_tools/lib/src/commands/precache.dart
View file @
c9a5f943
...
...
@@ -31,6 +31,8 @@ class PrecacheCommand extends FlutterCommand {
help:
'Precache artifacts for Fuchsia development.'
);
argParser
.
addFlag
(
'universal'
,
negatable:
true
,
defaultsTo:
true
,
help:
'Precache artifacts required for any development platform.'
);
argParser
.
addFlag
(
'flutter_runner'
,
negatable:
true
,
defaultsTo:
false
,
help:
'Precache the flutter runner artifacts.'
,
hide:
true
);
}
@override
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
c9a5f943
...
...
@@ -169,6 +169,15 @@ void main() {
FileSystem:
()
=>
MockFileSystem
(),
});
test
(
'Unstable artifacts'
,
()
{
expect
(
DevelopmentArtifact
.
web
.
unstable
,
true
);
expect
(
DevelopmentArtifact
.
linux
.
unstable
,
true
);
expect
(
DevelopmentArtifact
.
macOS
.
unstable
,
true
);
expect
(
DevelopmentArtifact
.
windows
.
unstable
,
true
);
expect
(
DevelopmentArtifact
.
fuchsia
.
unstable
,
true
);
expect
(
DevelopmentArtifact
.
flutterRunner
.
unstable
,
true
);
});
group
(
'EngineCachedArtifact'
,
()
{
FakeHttpClient
fakeHttpClient
;
FakePlatform
fakePlatform
;
...
...
packages/flutter_tools/test/general.shard/commands/precache_test.dart
View file @
c9a5f943
...
...
@@ -27,7 +27,7 @@ void main() {
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--ios'
,
'--android'
,
'--web'
,
'--macos'
,
'--linux'
,
'--windows'
,
'--fuchsia'
]
const
<
String
>[
'precache'
,
'--ios'
,
'--android'
,
'--web'
,
'--macos'
,
'--linux'
,
'--windows'
,
'--fuchsia'
,
'--flutter_runner'
]
);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
...
...
@@ -38,6 +38,7 @@ void main() {
DevelopmentArtifact
.
linux
,
DevelopmentArtifact
.
windows
,
DevelopmentArtifact
.
fuchsia
,
DevelopmentArtifact
.
flutterRunner
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
...
...
@@ -52,7 +53,7 @@ void main() {
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--ios'
,
'--android'
,
'--web'
,
'--macos'
,
'--linux'
,
'--windows'
,
'--fuchsia'
]
const
<
String
>[
'precache'
,
'--ios'
,
'--android'
,
'--web'
,
'--macos'
,
'--linux'
,
'--windows'
,
'--fuchsia'
,
'--flutter_runner'
]
);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
...
...
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