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
a2d62df3
Unverified
Commit
a2d62df3
authored
Mar 31, 2020
by
stuartmorgan
Committed by
GitHub
Mar 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use feature flags for desktop cache (#53608)
parent
aee9e94c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
7 deletions
+93
-7
cache.dart
packages/flutter_tools/lib/src/cache.dart
+3
-3
precache_test.dart
...ter_tools/test/commands.shard/hermetic/precache_test.dart
+87
-1
cache_test.dart
packages/flutter_tools/test/general.shard/cache_test.dart
+3
-3
No files found.
packages/flutter_tools/lib/src/cache.dart
View file @
a2d62df3
...
...
@@ -47,13 +47,13 @@ class DevelopmentArtifact {
static
const
DevelopmentArtifact
web
=
DevelopmentArtifact
.
_
(
'web'
,
feature:
flutterWebFeature
);
/// Artifacts required for desktop macOS.
static
const
DevelopmentArtifact
macOS
=
DevelopmentArtifact
.
_
(
'macos'
,
unstable:
tru
e
);
static
const
DevelopmentArtifact
macOS
=
DevelopmentArtifact
.
_
(
'macos'
,
feature:
flutterMacOSDesktopFeatur
e
);
/// Artifacts required for desktop Windows.
static
const
DevelopmentArtifact
windows
=
DevelopmentArtifact
.
_
(
'windows'
,
unstable:
tru
e
);
static
const
DevelopmentArtifact
windows
=
DevelopmentArtifact
.
_
(
'windows'
,
feature:
flutterWindowsDesktopFeatur
e
);
/// Artifacts required for desktop Linux.
static
const
DevelopmentArtifact
linux
=
DevelopmentArtifact
.
_
(
'linux'
,
unstable:
tru
e
);
static
const
DevelopmentArtifact
linux
=
DevelopmentArtifact
.
_
(
'linux'
,
feature:
flutterLinuxDesktopFeatur
e
);
/// Artifacts required for Fuchsia.
static
const
DevelopmentArtifact
fuchsia
=
DevelopmentArtifact
.
_
(
'fuchsia'
,
unstable:
true
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/precache_test.dart
View file @
a2d62df3
...
...
@@ -63,6 +63,87 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
false
),
});
testUsingContext
(
'precache downloads macOS artifacts on dev branch when macOS is enabled.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--macos'
,
'--no-android'
,
'--no-ios'
]);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
DevelopmentArtifact
.
macOS
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
true
),
});
testUsingContext
(
'precache does not download macOS artifacts on dev branch when feature is enabled.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--macos'
,
'--no-android'
,
'--no-ios'
]);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
false
),
});
testUsingContext
(
'precache downloads Windows artifacts on dev branch when feature is enabled.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--windows'
,
'--no-android'
,
'--no-ios'
]);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
DevelopmentArtifact
.
windows
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
true
),
});
testUsingContext
(
'precache does not download Windows artifacts on dev branch when feature is enabled.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--windows'
,
'--no-android'
,
'--no-ios'
]);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
false
),
});
testUsingContext
(
'precache downloads Linux artifacts on dev branch when feature is enabled.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--linux'
,
'--no-android'
,
'--no-ios'
]);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
DevelopmentArtifact
.
linux
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'precache does not download Linux artifacts on dev branch when feature is enabled.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'precache'
,
'--linux'
,
'--no-android'
,
'--no-ios'
]);
expect
(
artifacts
,
unorderedEquals
(<
DevelopmentArtifact
>{
DevelopmentArtifact
.
universal
,
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
false
),
});
testUsingContext
(
'precache exits if requesting mismatched artifacts.'
,
()
async
{
final
PrecacheCommand
command
=
PrecacheCommand
();
applyMocksToCommand
(
command
);
...
...
@@ -107,7 +188,12 @@ void main() {
}));
},
overrides:
<
Type
,
Generator
>{
Cache:
()
=>
cache
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
true
),
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
true
,
isLinuxEnabled:
true
,
isMacOSEnabled:
true
,
isWindowsEnabled:
true
,
),
FlutterVersion:
()
=>
masterFlutterVersion
,
});
...
...
packages/flutter_tools/test/general.shard/cache_test.dart
View file @
a2d62df3
...
...
@@ -264,9 +264,9 @@ void main() {
test
(
'Unstable artifacts'
,
()
{
expect
(
DevelopmentArtifact
.
web
.
unstable
,
false
);
expect
(
DevelopmentArtifact
.
linux
.
unstable
,
tru
e
);
expect
(
DevelopmentArtifact
.
macOS
.
unstable
,
tru
e
);
expect
(
DevelopmentArtifact
.
windows
.
unstable
,
tru
e
);
expect
(
DevelopmentArtifact
.
linux
.
unstable
,
fals
e
);
expect
(
DevelopmentArtifact
.
macOS
.
unstable
,
fals
e
);
expect
(
DevelopmentArtifact
.
windows
.
unstable
,
fals
e
);
expect
(
DevelopmentArtifact
.
fuchsia
.
unstable
,
true
);
expect
(
DevelopmentArtifact
.
flutterRunner
.
unstable
,
true
);
});
...
...
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