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
f12a5ec3
Unverified
Commit
f12a5ec3
authored
Sep 02, 2019
by
Jonah Williams
Committed by
GitHub
Sep 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dont hide build commands (#39555)
parent
f5eb12cd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
5 deletions
+75
-5
build_linux.dart
packages/flutter_tools/lib/src/commands/build_linux.dart
+2
-2
build_macos.dart
packages/flutter_tools/lib/src/commands/build_macos.dart
+1
-1
build_web.dart
packages/flutter_tools/lib/src/commands/build_web.dart
+1
-1
build_windows.dart
packages/flutter_tools/lib/src/commands/build_windows.dart
+1
-1
build_linux_test.dart
...r_tools/test/general.shard/commands/build_linux_test.dart
+19
-0
build_macos_test.dart
...r_tools/test/general.shard/commands/build_macos_test.dart
+19
-0
build_web_test.dart
...ter_tools/test/general.shard/commands/build_web_test.dart
+13
-0
build_windows_test.dart
...tools/test/general.shard/commands/build_windows_test.dart
+19
-0
No files found.
packages/flutter_tools/lib/src/commands/build_linux.dart
View file @
f12a5ec3
...
...
@@ -36,7 +36,7 @@ class BuildLinuxCommand extends BuildSubCommand {
final
String
name
=
'linux'
;
@override
bool
hidden
=
true
;
bool
get
hidden
=>
!
featureFlags
.
isLinuxEnabled
||
!
platform
.
isLinux
;
@override
Future
<
Set
<
DevelopmentArtifact
>>
get
requiredArtifacts
async
=>
<
DevelopmentArtifact
>{
...
...
@@ -45,7 +45,7 @@ class BuildLinuxCommand extends BuildSubCommand {
};
@override
String
get
description
=>
'build the Linux desktop target
(Experimental)
.'
;
String
get
description
=>
'build the Linux desktop target.'
;
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
...
...
packages/flutter_tools/lib/src/commands/build_macos.dart
View file @
f12a5ec3
...
...
@@ -25,7 +25,7 @@ class BuildMacosCommand extends BuildSubCommand {
final
String
name
=
'macos'
;
@override
bool
hidden
=
true
;
bool
get
hidden
=>
!
featureFlags
.
isMacOSEnabled
||
!
platform
.
isMacOS
;
@override
Future
<
Set
<
DevelopmentArtifact
>>
get
requiredArtifacts
async
=>
<
DevelopmentArtifact
>{
...
...
packages/flutter_tools/lib/src/commands/build_web.dart
View file @
f12a5ec3
...
...
@@ -31,7 +31,7 @@ class BuildWebCommand extends BuildSubCommand {
final
String
name
=
'web'
;
@override
bool
get
hidden
=>
true
;
bool
get
hidden
=>
!
featureFlags
.
isWebEnabled
;
@override
final
String
description
=
'build a web application bundle.'
;
...
...
packages/flutter_tools/lib/src/commands/build_windows.dart
View file @
f12a5ec3
...
...
@@ -36,7 +36,7 @@ class BuildWindowsCommand extends BuildSubCommand {
final
String
name
=
'windows'
;
@override
bool
hidden
=
true
;
bool
get
hidden
=>
!
featureFlags
.
isWindowsEnabled
||
!
platform
.
isWindows
;
@override
Future
<
Set
<
DevelopmentArtifact
>>
get
requiredArtifacts
async
=>
<
DevelopmentArtifact
>{
...
...
packages/flutter_tools/test/general.shard/commands/build_linux_test.dart
View file @
f12a5ec3
...
...
@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/logger.dart';
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_linux.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/linux/makefile.dart'
;
...
...
@@ -162,6 +163,24 @@ BINARY_NAME=fizz_bar
Platform:
()
=>
linuxPlatform
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'hidden when not enabled on Linux host'
,
()
{
when
(
platform
.
isLinux
).
thenReturn
(
true
);
expect
(
BuildLinuxCommand
().
hidden
,
true
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
false
),
Platform:
()
=>
MockPlatform
(),
});
testUsingContext
(
'Not hidden when enabled and on Linux host'
,
()
{
when
(
platform
.
isLinux
).
thenReturn
(
true
);
expect
(
BuildLinuxCommand
().
hidden
,
false
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
Platform:
()
=>
MockPlatform
(),
});
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
...
...
packages/flutter_tools/test/general.shard/commands/build_macos_test.dart
View file @
f12a5ec3
...
...
@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_macos.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/ios/xcodeproj.dart'
;
import
'package:flutter_tools/src/project.dart'
;
...
...
@@ -179,6 +180,24 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
false
),
});
testUsingContext
(
'hidden when not enabled on macOS host'
,
()
{
when
(
platform
.
isMacOS
).
thenReturn
(
true
);
expect
(
BuildMacosCommand
().
hidden
,
true
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
false
),
Platform:
()
=>
MockPlatform
(),
});
testUsingContext
(
'Not hidden when enabled and on macOS host'
,
()
{
when
(
platform
.
isMacOS
).
thenReturn
(
true
);
expect
(
BuildMacosCommand
().
hidden
,
false
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isMacOSEnabled:
true
),
Platform:
()
=>
MockPlatform
(),
});
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
...
...
packages/flutter_tools/test/general.shard/commands/build_web_test.dart
View file @
f12a5ec3
...
...
@@ -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/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_web.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/project.dart'
;
...
...
@@ -95,6 +96,18 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
false
),
}));
test
(
'hidden if feature flag is not enabled'
,
()
=>
testbed
.
run
(()
async
{
expect
(
BuildWebCommand
().
hidden
,
true
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
false
),
}));
test
(
'not hidden if feature flag is enabled'
,
()
=>
testbed
.
run
(()
async
{
expect
(
BuildWebCommand
().
hidden
,
false
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWebEnabled:
true
),
}));
}
class
MockWebCompilationProxy
extends
Mock
implements
WebCompilationProxy
{}
...
...
packages/flutter_tools/test/general.shard/commands/build_windows_test.dart
View file @
f12a5ec3
...
...
@@ -10,6 +10,7 @@ import 'package:flutter_tools/src/base/logger.dart';
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:flutter_tools/src/commands/build_windows.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
;
import
'package:flutter_tools/src/windows/visual_studio.dart'
;
...
...
@@ -173,6 +174,24 @@ void main() {
VisualStudio:
()
=>
mockVisualStudio
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
true
),
});
testUsingContext
(
'hidden when not enabled on Windows host'
,
()
{
when
(
platform
.
isWindows
).
thenReturn
(
true
);
expect
(
BuildWindowsCommand
().
hidden
,
true
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
false
),
Platform:
()
=>
MockPlatform
(),
});
testUsingContext
(
'Not hidden when enabled and on Windows host'
,
()
{
when
(
platform
.
isWindows
).
thenReturn
(
true
);
expect
(
BuildWindowsCommand
().
hidden
,
false
);
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isWindowsEnabled:
true
),
Platform:
()
=>
MockPlatform
(),
});
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
...
...
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