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
8be1c9ef
Unverified
Commit
8be1c9ef
authored
Jul 21, 2020
by
Jonah Williams
Committed by
GitHub
Jul 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] turn off fuchsia support by default (#61634)
parent
a821bdbf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
2 deletions
+65
-2
fuchsia_attach.dart
packages/flutter_tools/bin/fuchsia_attach.dart
+30
-0
build_fuchsia.dart
packages/flutter_tools/lib/src/commands/build_fuchsia.dart
+7
-0
features.dart
packages/flutter_tools/lib/src/features.dart
+1
-1
build_fuchsia_test.dart
...ools/test/commands.shard/hermetic/build_fuchsia_test.dart
+24
-0
precache_test.dart
...ter_tools/test/commands.shard/hermetic/precache_test.dart
+2
-0
testbed.dart
packages/flutter_tools/test/src/testbed.dart
+1
-1
No files found.
packages/flutter_tools/bin/fuchsia_attach.dart
View file @
8be1c9ef
...
@@ -15,6 +15,7 @@ import 'package:flutter_tools/src/cache.dart';
...
@@ -15,6 +15,7 @@ import 'package:flutter_tools/src/cache.dart';
import
'package:flutter_tools/src/commands/attach.dart'
;
import
'package:flutter_tools/src/commands/attach.dart'
;
import
'package:flutter_tools/src/commands/doctor.dart'
;
import
'package:flutter_tools/src/commands/doctor.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_device.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_device.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_workflow.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_workflow.dart'
;
...
@@ -106,6 +107,7 @@ Future<void> main(List<String> args) async {
...
@@ -106,6 +107,7 @@ Future<void> main(List<String> args) async {
muteCommandLogging:
false
,
muteCommandLogging:
false
,
verboseHelp:
false
,
verboseHelp:
false
,
overrides:
<
Type
,
Generator
>{
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
const
_FuchsiaFeatureFlags
(),
DeviceManager:
()
=>
_FuchsiaDeviceManager
(),
DeviceManager:
()
=>
_FuchsiaDeviceManager
(),
FuchsiaArtifacts:
()
=>
FuchsiaArtifacts
(
sshConfig:
sshConfig
,
devFinder:
devFinder
),
FuchsiaArtifacts:
()
=>
FuchsiaArtifacts
(
sshConfig:
sshConfig
,
devFinder:
devFinder
),
Artifacts:
()
=>
OverrideArtifacts
(
Artifacts:
()
=>
OverrideArtifacts
(
...
@@ -171,3 +173,31 @@ class _FuchsiaAttachCommand extends AttachCommand {
...
@@ -171,3 +173,31 @@ class _FuchsiaAttachCommand extends AttachCommand {
return
super
.
runCommand
();
return
super
.
runCommand
();
}
}
}
}
class
_FuchsiaFeatureFlags
extends
FeatureFlags
{
const
_FuchsiaFeatureFlags
();
@override
bool
get
isLinuxEnabled
=>
false
;
@override
bool
get
isMacOSEnabled
=>
false
;
@override
bool
get
isWebEnabled
=>
false
;
@override
bool
get
isWindowsEnabled
=>
false
;
@override
bool
get
isAndroidEnabled
=>
false
;
@override
bool
get
isIOSEnabled
=>
false
;
@override
bool
get
isFuchsiaEnabled
=>
true
;
@override
bool
get
isSingleWidgetReloadEnabled
=>
false
;
}
packages/flutter_tools/lib/src/commands/build_fuchsia.dart
View file @
8be1c9ef
...
@@ -9,6 +9,7 @@ import 'package:meta/meta.dart';
...
@@ -9,6 +9,7 @@ import 'package:meta/meta.dart';
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../build_info.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
import
'../cache.dart'
;
import
'../features.dart'
;
import
'../fuchsia/fuchsia_build.dart'
;
import
'../fuchsia/fuchsia_build.dart'
;
import
'../fuchsia/fuchsia_pm.dart'
;
import
'../fuchsia/fuchsia_pm.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
...
@@ -59,6 +60,12 @@ class BuildFuchsiaCommand extends BuildSubCommand {
...
@@ -59,6 +60,12 @@ class BuildFuchsiaCommand extends BuildSubCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
if
(!
featureFlags
.
isFuchsiaEnabled
)
{
throwToolExit
(
'"build fuchsia" is currently disabled. See "flutter config" for more '
'information.'
);
}
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
if
(!
globals
.
platform
.
isLinux
&&
!
globals
.
platform
.
isMacOS
)
{
if
(!
globals
.
platform
.
isLinux
&&
!
globals
.
platform
.
isMacOS
)
{
...
...
packages/flutter_tools/lib/src/features.dart
View file @
8be1c9ef
...
@@ -227,7 +227,7 @@ const Feature flutterFuchsiaFeature = Feature(
...
@@ -227,7 +227,7 @@ const Feature flutterFuchsiaFeature = Feature(
environmentOverride:
'FLUTTER_FUCHSIA'
,
environmentOverride:
'FLUTTER_FUCHSIA'
,
master:
FeatureChannelSetting
(
master:
FeatureChannelSetting
(
available:
true
,
available:
true
,
enabledByDefault:
tru
e
,
enabledByDefault:
fals
e
,
),
),
);
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart
View file @
8be1c9ef
...
@@ -9,6 +9,7 @@ import 'package:flutter_tools/src/base/platform.dart';
...
@@ -9,6 +9,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_kernel_compiler.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_kernel_compiler.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_pm.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_pm.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
...
@@ -20,6 +21,7 @@ import 'package:process/process.dart';
...
@@ -20,6 +21,7 @@ import 'package:process/process.dart';
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/mocks.dart'
;
import
'../../src/mocks.dart'
;
import
'../../src/testbed.dart'
;
// Defined globally for mocks to use.
// Defined globally for mocks to use.
FileSystem
fileSystem
;
FileSystem
fileSystem
;
...
@@ -47,6 +49,23 @@ void main() {
...
@@ -47,6 +49,23 @@ void main() {
});
});
group
(
'Fuchsia build fails gracefully when'
,
()
{
group
(
'Fuchsia build fails gracefully when'
,
()
{
testUsingContext
(
'The feature is disabled'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
fileSystem
.
directory
(
'fuchsia'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'.packages'
).
createSync
();
fileSystem
.
file
(
'pubspec.yaml'
).
createSync
();
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'fuchsia'
]),
throwsToolExit
(
message:
'"build fuchsia" is currently disabled'
),
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
linuxPlatform
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
false
),
});
testUsingContext
(
'there is no Fuchsia project'
,
()
async
{
testUsingContext
(
'there is no Fuchsia project'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
final
BuildCommand
command
=
BuildCommand
();
...
@@ -58,6 +77,7 @@ void main() {
...
@@ -58,6 +77,7 @@ void main() {
Platform:
()
=>
linuxPlatform
,
Platform:
()
=>
linuxPlatform
,
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
});
testUsingContext
(
'there is no cmx file'
,
()
async
{
testUsingContext
(
'there is no cmx file'
,
()
async
{
...
@@ -74,6 +94,7 @@ void main() {
...
@@ -74,6 +94,7 @@ void main() {
Platform:
()
=>
linuxPlatform
,
Platform:
()
=>
linuxPlatform
,
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
});
testUsingContext
(
'on Windows platform'
,
()
async
{
testUsingContext
(
'on Windows platform'
,
()
async
{
...
@@ -95,6 +116,7 @@ void main() {
...
@@ -95,6 +116,7 @@ void main() {
Platform:
()
=>
windowsPlatform
,
Platform:
()
=>
windowsPlatform
,
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
});
testUsingContext
(
'there is no Fuchsia kernel compiler'
,
()
async
{
testUsingContext
(
'there is no Fuchsia kernel compiler'
,
()
async
{
...
@@ -117,6 +139,7 @@ void main() {
...
@@ -117,6 +139,7 @@ void main() {
Platform:
()
=>
linuxPlatform
,
Platform:
()
=>
linuxPlatform
,
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
});
});
});
...
@@ -145,6 +168,7 @@ void main() {
...
@@ -145,6 +168,7 @@ void main() {
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FuchsiaSdk:
()
=>
fuchsiaSdk
,
FuchsiaSdk:
()
=>
fuchsiaSdk
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isFuchsiaEnabled:
true
),
});
});
}
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/precache_test.dart
View file @
8be1c9ef
...
@@ -216,6 +216,7 @@ void main() {
...
@@ -216,6 +216,7 @@ void main() {
isLinuxEnabled:
true
,
isLinuxEnabled:
true
,
isMacOSEnabled:
true
,
isMacOSEnabled:
true
,
isWindowsEnabled:
true
,
isWindowsEnabled:
true
,
isFuchsiaEnabled:
true
,
),
),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
);
);
...
@@ -329,6 +330,7 @@ void main() {
...
@@ -329,6 +330,7 @@ void main() {
isLinuxEnabled:
true
,
isLinuxEnabled:
true
,
isMacOSEnabled:
true
,
isMacOSEnabled:
true
,
isWindowsEnabled:
true
,
isWindowsEnabled:
true
,
isFuchsiaEnabled:
true
,
),
),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}),
);
);
...
...
packages/flutter_tools/test/src/testbed.dart
View file @
8be1c9ef
...
@@ -732,7 +732,7 @@ class TestFeatureFlags implements FeatureFlags {
...
@@ -732,7 +732,7 @@ class TestFeatureFlags implements FeatureFlags {
this
.
isSingleWidgetReloadEnabled
=
false
,
this
.
isSingleWidgetReloadEnabled
=
false
,
this
.
isAndroidEnabled
=
true
,
this
.
isAndroidEnabled
=
true
,
this
.
isIOSEnabled
=
true
,
this
.
isIOSEnabled
=
true
,
this
.
isFuchsiaEnabled
=
tru
e
,
this
.
isFuchsiaEnabled
=
fals
e
,
});
});
@override
@override
...
...
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