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
c589a0c3
Unverified
Commit
c589a0c3
authored
Jul 08, 2021
by
Zachary Anderson
Committed by
GitHub
Jul 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "[flutter_tools] show only supported sub commands (#85125)" (#86131)
This reverts commit
84e57678
.
parent
456fe1ab
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
22 additions
and
53 deletions
+22
-53
build.dart
packages/flutter_tools/lib/src/commands/build.dart
+13
-21
build_fuchsia.dart
packages/flutter_tools/lib/src/commands/build_fuchsia.dart
+1
-4
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+1
-4
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+1
-4
build_macos.dart
packages/flutter_tools/lib/src/commands/build_macos.dart
+1
-4
build_fuchsia_test.dart
...ools/test/commands.shard/hermetic/build_fuchsia_test.dart
+1
-2
build_ios_test.dart
...er_tools/test/commands.shard/hermetic/build_ios_test.dart
+1
-2
build_ipa_test.dart
...er_tools/test/commands.shard/hermetic/build_ipa_test.dart
+1
-2
build_macos_test.dart
..._tools/test/commands.shard/hermetic/build_macos_test.dart
+2
-2
build_test.dart
...flutter_tools/test/general.shard/commands/build_test.dart
+0
-8
No files found.
packages/flutter_tools/lib/src/commands/build.dart
View file @
c589a0c3
...
...
@@ -24,31 +24,25 @@ import 'build_winuwp.dart';
class
BuildCommand
extends
FlutterCommand
{
BuildCommand
({
bool
verboseHelp
=
false
})
{
_
addSubcommand
(
BuildAarCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildApkCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildAppBundleCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildIOSCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildIOSFrameworkCommand
(
addSubcommand
(
BuildAarCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildApkCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildAppBundleCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildIOSCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildIOSFrameworkCommand
(
buildSystem:
globals
.
buildSystem
,
verboseHelp:
verboseHelp
,
));
_
addSubcommand
(
BuildIOSArchiveCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildBundleCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildWebCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildMacosCommand
(
verboseHelp:
verboseHelp
));
_
addSubcommand
(
BuildLinuxCommand
(
addSubcommand
(
BuildIOSArchiveCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildBundleCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildWebCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildMacosCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildLinuxCommand
(
operatingSystemUtils:
globals
.
os
,
verboseHelp:
verboseHelp
));
_addSubcommand
(
BuildWindowsCommand
(
verboseHelp:
verboseHelp
));
_addSubcommand
(
BuildWindowsUwpCommand
(
verboseHelp:
verboseHelp
));
_addSubcommand
(
BuildFuchsiaCommand
(
verboseHelp:
verboseHelp
));
}
void
_addSubcommand
(
BuildSubCommand
command
)
{
if
(
command
.
supported
)
{
addSubcommand
(
command
);
}
addSubcommand
(
BuildWindowsCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildWindowsUwpCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildFuchsiaCommand
(
verboseHelp:
verboseHelp
));
}
@override
...
...
@@ -69,8 +63,6 @@ abstract class BuildSubCommand extends FlutterCommand {
@override
bool
get
reportNullSafety
=>
true
;
bool
get
supported
=>
true
;
/// Display a message describing the current null safety runtime mode
/// that was selected.
///
...
...
packages/flutter_tools/lib/src/commands/build_fuchsia.dart
View file @
c589a0c3
...
...
@@ -58,9 +58,6 @@ class BuildFuchsiaCommand extends BuildSubCommand {
@override
String
get
description
=>
'Build the Fuchsia target (Experimental).'
;
@override
bool
get
supported
=>
globals
.
platform
.
isLinux
||
globals
.
platform
.
isMacOS
;
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
if
(!
featureFlags
.
isFuchsiaEnabled
)
{
...
...
@@ -71,7 +68,7 @@ class BuildFuchsiaCommand extends BuildSubCommand {
}
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
if
(!
supported
)
{
if
(!
globals
.
platform
.
isLinux
&&
!
globals
.
platform
.
isMacOS
)
{
throwToolExit
(
'"build fuchsia" is only supported on Linux and MacOS hosts.'
);
}
if
(!
flutterProject
.
fuchsia
.
existsSync
())
{
...
...
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
c589a0c3
...
...
@@ -224,15 +224,12 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
Directory
_outputAppDirectory
(
String
xcodeResultOutput
);
@override
bool
get
supported
=>
globals
.
platform
.
isMacOS
;
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
defaultBuildMode
=
forSimulator
?
BuildMode
.
debug
:
BuildMode
.
release
;
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
if
(!
supported
)
{
if
(!
globals
.
platform
.
isMacOS
)
{
throwToolExit
(
'Building for iOS is only supported on macOS.'
);
}
if
(
forSimulator
&&
!
buildInfo
.
supportsSimulator
)
{
...
...
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
c589a0c3
...
...
@@ -141,14 +141,11 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
return
buildInfos
;
}
@override
bool
get
supported
=>
_platform
.
isMacOS
;
@override
Future
<
void
>
validateCommand
()
async
{
await
super
.
validateCommand
();
_project
=
FlutterProject
.
current
();
if
(!
supported
)
{
if
(!
_platform
.
isMacOS
)
{
throwToolExit
(
'Building frameworks for iOS is only supported on the Mac.'
);
}
...
...
packages/flutter_tools/lib/src/commands/build_macos.dart
View file @
c589a0c3
...
...
@@ -39,9 +39,6 @@ class BuildMacosCommand extends BuildSubCommand {
@override
String
get
description
=>
'Build a macOS desktop application.'
;
@override
bool
get
supported
=>
globals
.
platform
.
isMacOS
;
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
...
...
@@ -49,7 +46,7 @@ class BuildMacosCommand extends BuildSubCommand {
if
(!
featureFlags
.
isMacOSEnabled
)
{
throwToolExit
(
'"build macos" is not currently supported. To enable, run "flutter config --enable-macos-desktop".'
);
}
if
(!
supported
)
{
if
(!
globals
.
platform
.
isMacOS
)
{
throwToolExit
(
'"build macos" only supported on macOS hosts.'
);
}
displayNullSafetyMode
(
buildInfo
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart
View file @
c589a0c3
...
...
@@ -4,7 +4,6 @@
// @dart = 2.8
import
'package:args/command_runner.dart'
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
...
...
@@ -112,7 +111,7 @@ void main() {
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'fuchsia'
]),
throws
A
(
isA
<
UsageException
>()
),
throws
ToolExit
(
),
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
windowsPlatform
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart
View file @
c589a0c3
...
...
@@ -4,7 +4,6 @@
// @dart = 2.8
import
'package:args/command_runner.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
...
...
@@ -163,7 +162,7 @@ void main() {
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'ios'
,
'--no-pub'
]
),
throws
A
(
isA
<
UsageException
>()
));
),
throws
ToolExit
(
));
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
notMacosPlatform
,
FileSystem:
()
=>
fileSystem
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart
View file @
c589a0c3
...
...
@@ -4,7 +4,6 @@
// @dart = 2.8
import
'package:args/command_runner.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
...
@@ -158,7 +157,7 @@ void main() {
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'ipa'
,
'--no-pub'
]
),
throws
A
(
isA
<
UsageException
>()
));
),
throws
ToolExit
(
));
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
notMacosPlatform
,
FileSystem:
()
=>
fileSystem
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart
View file @
c589a0c3
...
...
@@ -149,7 +149,7 @@ void main() {
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'macos'
,
'--no-pub'
]
),
throws
A
(
isA
<
UsageException
>()
));
),
throws
ToolExit
(
message:
'"build macos" only supported on macOS hosts.'
));
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
notMacosPlatform
,
FileSystem:
()
=>
fileSystem
,
...
...
@@ -391,7 +391,7 @@ void main() {
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
BuildCommand
());
expect
(()
=>
runner
.
run
(<
String
>[
'build'
,
'macos'
,
'--no-pub'
]),
throws
A
(
isA
<
UsageException
>()
));
throws
ToolExit
(
));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
false
),
});
...
...
packages/flutter_tools/test/general.shard/commands/build_test.dart
View file @
c589a0c3
...
...
@@ -5,7 +5,6 @@
// @dart = 2.8
import
'package:args/args.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/commands/attach.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
...
...
@@ -76,13 +75,6 @@ void main() {
FakeBuildSubCommand
().
test
(
sound
);
expect
(
testLogger
.
statusText
,
contains
(
'💪 Building with sound null safety 💪'
));
});
testUsingContext
(
'Include only supported sub commands'
,
()
{
final
BuildCommand
command
=
BuildCommand
();
for
(
final
Command
<
void
>
x
in
command
.
subcommands
.
values
)
{
expect
((
x
as
BuildSubCommand
).
supported
,
isTrue
);
}
});
}
class
FakeBuildSubCommand
extends
BuildSubCommand
{
...
...
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