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
e85fe60d
Unverified
Commit
e85fe60d
authored
Mar 22, 2021
by
Marcel Čampa
Committed by
GitHub
Mar 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Command `flutter create` respects disabled iOS and Android (#78406)
parent
47db96af
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+2
-2
config_test.dart
...utter_tools/test/commands.shard/hermetic/config_test.dart
+10
-0
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+38
-0
No files found.
packages/flutter_tools/lib/src/commands/create.dart
View file @
e85fe60d
...
...
@@ -236,8 +236,8 @@ class CreateCommand extends CreateBase {
withPluginHook:
generatePlugin
,
androidLanguage:
stringArg
(
'android-language'
),
iosLanguage:
stringArg
(
'ios-language'
),
ios:
platforms
.
contains
(
'ios'
),
android:
platforms
.
contains
(
'android'
),
ios:
featureFlags
.
isIOSEnabled
&&
platforms
.
contains
(
'ios'
),
android:
featureFlags
.
isAndroidEnabled
&&
platforms
.
contains
(
'android'
),
web:
featureFlags
.
isWebEnabled
&&
platforms
.
contains
(
'web'
),
linux:
featureFlags
.
isLinuxEnabled
&&
platforms
.
contains
(
'linux'
),
macos:
featureFlags
.
isMacOSEnabled
&&
platforms
.
contains
(
'macos'
),
...
...
packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
View file @
e85fe60d
...
...
@@ -100,12 +100,16 @@ void main() {
await
commandRunner
.
run
(<
String
>[
'config'
,
'--enable-android'
,
'--enable-ios'
,
'--enable-web'
,
'--enable-linux-desktop'
,
'--enable-windows-desktop'
,
'--enable-macos-desktop'
,
]);
expect
(
globals
.
config
.
getValue
(
'enable-android'
),
true
);
expect
(
globals
.
config
.
getValue
(
'enable-ios'
),
true
);
expect
(
globals
.
config
.
getValue
(
'enable-web'
),
true
);
expect
(
globals
.
config
.
getValue
(
'enable-linux-desktop'
),
true
);
expect
(
globals
.
config
.
getValue
(
'enable-windows-desktop'
),
true
);
...
...
@@ -115,6 +119,8 @@ void main() {
'config'
,
'--clear-features'
,
]);
expect
(
globals
.
config
.
getValue
(
'enable-android'
),
null
);
expect
(
globals
.
config
.
getValue
(
'enable-ios'
),
null
);
expect
(
globals
.
config
.
getValue
(
'enable-web'
),
null
);
expect
(
globals
.
config
.
getValue
(
'enable-linux-desktop'
),
null
);
expect
(
globals
.
config
.
getValue
(
'enable-windows-desktop'
),
null
);
...
...
@@ -122,12 +128,16 @@ void main() {
await
commandRunner
.
run
(<
String
>[
'config'
,
'--no-enable-android'
,
'--no-enable-ios'
,
'--no-enable-web'
,
'--no-enable-linux-desktop'
,
'--no-enable-windows-desktop'
,
'--no-enable-macos-desktop'
,
]);
expect
(
globals
.
config
.
getValue
(
'enable-android'
),
false
);
expect
(
globals
.
config
.
getValue
(
'enable-ios'
),
false
);
expect
(
globals
.
config
.
getValue
(
'enable-web'
),
false
);
expect
(
globals
.
config
.
getValue
(
'enable-linux-desktop'
),
false
);
expect
(
globals
.
config
.
getValue
(
'enable-windows-desktop'
),
false
);
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
e85fe60d
...
...
@@ -693,6 +693,44 @@ void main() {
Logger:
()
=>
logger
,
});
testUsingContext
(
'app supports android and ios by default'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'ios'
),
exists
);
},
overrides:
<
Type
,
Generator
>{});
testUsingContext
(
'app does not include android if disabled in config'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
isNot
(
exists
));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isAndroidEnabled:
false
),
});
testUsingContext
(
'app does not include ios if disabled in config'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'ios'
),
isNot
(
exists
));
},
overrides:
<
Type
,
Generator
>{
FeatureFlags:
()
=>
TestFeatureFlags
(
isIOSEnabled:
false
),
});
testUsingContext
(
'app does not include desktop or web by default'
,
()
async
{
Cache
.
flutterRoot
=
'../..'
;
...
...
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