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
9764d861
Unverified
Commit
9764d861
authored
Aug 12, 2021
by
Jenn Magder
Committed by
GitHub
Aug 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support flutter create --platform singular flag (#88076)
parent
9b1ed463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
46 deletions
+47
-46
create_base.dart
packages/flutter_tools/lib/src/commands/create_base.dart
+1
-0
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+46
-46
No files found.
packages/flutter_tools/lib/src/commands/create_base.dart
View file @
9764d861
...
...
@@ -151,6 +151,7 @@ abstract class CreateBase extends FlutterCommand {
void
addPlatformsOptions
({
String
customHelp
})
{
argParser
.
addMultiOption
(
'platforms'
,
help:
customHelp
??
_kDefaultPlatformArgumentHelp
,
aliases:
<
String
>[
'platform'
],
defaultsTo:
<
String
>[
...
_kAvailablePlatforms
,
if
(
featureFlags
.
isWindowsUwpEnabled
)
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
9764d861
...
...
@@ -517,7 +517,7 @@ void main() {
testUsingContext
(
'plugin project supports web'
,
()
async
{
await
_createAndAnalyzeProject
(
projectDir
,
<
String
>[
'--template=plugin'
,
'--platform
s
=web'
],
<
String
>[
'--template=plugin'
,
'--platform=web'
],
<
String
>[
'lib/flutter_project.dart'
,
'lib/flutter_project_web.dart'
,
...
...
@@ -606,7 +606,7 @@ void main() {
'--org'
,
'com.bar.foo'
,
'-i'
,
'objc'
,
'-a'
,
'java'
,
'--platform
s
'
,
'android'
,
'--platform'
,
'android'
,
],
<
String
>[
'android/src/main/java/com/bar/foo/flutter_project/FlutterProjectPlugin.java'
,
'example/android/app/src/main/java/com/bar/foo/flutter_project_example/MainActivity.java'
,
...
...
@@ -733,7 +733,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
'
,
'android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform'
,
'android'
,
projectDir
.
path
]);
void
expectExists
(
String
relPath
)
{
expect
(
globals
.
fs
.
isFileSync
(
'
${projectDir.path}
/
$relPath
'
),
true
);
...
...
@@ -752,7 +752,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
'
,
'android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform'
,
'android'
,
projectDir
.
path
]);
final
String
androidManifest
=
await
globals
.
fs
.
file
(
'
${projectDir.path}
/android/app/src/main/AndroidManifest.xml'
...
...
@@ -859,7 +859,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
=winuwp'
,
'--platform=winuwp'
,
projectDir
.
path
,
]);
...
...
@@ -885,7 +885,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
=linux'
,
'--platform=linux'
,
projectDir
.
path
,
]);
...
...
@@ -908,7 +908,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=linux'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=linux'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'linux'
).
childFile
(
'CMakeLists.txt'
),
exists
);
...
...
@@ -946,7 +946,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
=macos'
,
'--platform=macos'
,
projectDir
.
path
,
]);
...
...
@@ -970,7 +970,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=macos'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=macos'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'macos'
).
childFile
(
'flutter_project.podspec'
),
exists
);
...
...
@@ -1005,7 +1005,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
=windows'
,
'--platform=windows'
,
projectDir
.
path
,
]);
...
...
@@ -1045,7 +1045,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=windows'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=windows'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'windows'
).
childFile
(
'CMakeLists.txt'
),
exists
);
...
...
@@ -1091,7 +1091,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
=web'
,
'--platform=web'
,
projectDir
.
path
,
]);
...
...
@@ -1118,7 +1118,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--platform
s
=web'
,
'--platform=web'
,
projectDir
.
path
,
]);
...
...
@@ -1941,7 +1941,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'ios'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'ios'
),
exists
);
...
...
@@ -1961,7 +1961,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
exists
);
expect
(
...
...
@@ -1983,7 +1983,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=web'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=web'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'lib'
).
childFile
(
'flutter_project_web.dart'
),
exists
);
...
...
@@ -2005,7 +2005,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=web'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=web'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'lib'
).
childFile
(
'flutter_project_web.dart'
),
isNot
(
exists
));
...
...
@@ -2025,7 +2025,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'ios'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'ios'
),
exists
);
...
...
@@ -2039,7 +2039,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
exists
);
expect
(
...
...
@@ -2054,7 +2054,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=linux'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=linux'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'linux'
),
exists
);
expect
(
...
...
@@ -2069,7 +2069,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=macos'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=macos'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'macos'
),
exists
);
expect
(
...
...
@@ -2084,7 +2084,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=windows'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=windows'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'windows'
),
exists
);
expect
(
...
...
@@ -2099,7 +2099,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=web'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=web'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'lib'
).
childFile
(
'flutter_project_web.dart'
),
...
...
@@ -2113,7 +2113,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'ios'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'ios'
),
exists
);
validatePubspecForPlugin
(
projectDir:
projectDir
.
absolute
.
path
,
expectedPlatforms:
const
<
String
>[
...
...
@@ -2121,7 +2121,7 @@ void main() {
],
pluginClass:
'FlutterProjectPlugin'
,
unexpectedPlatforms:
<
String
>[
'some_platform'
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=macos'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=macos'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'macos'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'macos'
),
exists
);
...
...
@@ -2158,7 +2158,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
expectLater
(
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=module'
,
'--platform
s
=ios'
,
projectDir
.
path
])
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=module'
,
'--platform=ios'
,
projectDir
.
path
])
,
throwsToolExit
(
message:
'The "--platforms" argument is not supported'
,
exitCode:
2
));
});
...
...
@@ -2168,7 +2168,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
expectLater
(
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=package'
,
'--platform
s
=ios'
,
projectDir
.
path
])
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=package'
,
'--platform=ios'
,
projectDir
.
path
])
,
throwsToolExit
(
message:
'The "--platforms" argument is not supported'
,
exitCode:
2
));
});
...
...
@@ -2177,7 +2177,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'android'
),
exists
);
...
...
@@ -2200,7 +2200,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
exists
);
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'android'
),
exists
);
...
...
@@ -2211,7 +2211,7 @@ void main() {
expect
(
projectDir
.
childDirectory
(
'example'
).
childDirectory
(
'android'
),
isNot
(
exists
));
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=windows'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=windows'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
exists
);
expect
(
...
...
@@ -2228,7 +2228,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'android'
),
isNot
(
exists
));
...
...
@@ -2240,7 +2240,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'windows'
),
isNot
(
exists
));
...
...
@@ -2254,7 +2254,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'linux'
),
isNot
(
exists
));
...
...
@@ -2268,7 +2268,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'lib'
).
childFile
(
'flutter_project_web.dart'
),
isNot
(
exists
));
...
...
@@ -2281,7 +2281,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
projectDir
.
childDirectory
(
'macos'
),
isNot
(
exists
));
...
...
@@ -2299,9 +2299,9 @@ void main() {
final
String
relativePluginPath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
relative
(
projectDirPath
));
final
String
relativeExamplePath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
join
(
relativePluginPath
,
'example/lib/main.dart'
));
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--org=com.example'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--org=com.example'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
expect
(
logger
.
statusText
,
contains
(
'Your example app code is in
$relativeExamplePath
.
\n
'
));
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--org=com.example'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--org=com.example'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
expect
(
logger
.
statusText
,
contains
(
'Your example app code is in
$relativeExamplePath
.
\n
'
));
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
projectDir
.
path
]);
expect
(
logger
.
statusText
,
contains
(
'Your example app code is in
$relativeExamplePath
.
\n
'
));
...
...
@@ -2314,7 +2314,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
final
String
projectDirPath
=
globals
.
fs
.
path
.
normalize
(
projectDir
.
absolute
.
path
);
final
String
relativePluginPath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
relative
(
projectDirPath
));
expect
(
logger
.
statusText
,
isNot
(
contains
(
'You need to update
$relativePluginPath
/pubspec.yaml to support android.
\n
'
)));
...
...
@@ -2329,9 +2329,9 @@ void main() {
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
final
String
projectDirPath
=
globals
.
fs
.
path
.
normalize
(
projectDir
.
absolute
.
path
);
final
String
relativePluginPath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
relative
(
projectDirPath
));
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
expect
(
logger
.
statusText
,
isNot
(
contains
(
'You need to update
$relativePluginPath
/pubspec.yaml to support ios.
\n
'
)));
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=android'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=android'
,
projectDir
.
path
]);
expect
(
logger
.
statusText
,
contains
(
'You need to update
$relativePluginPath
/pubspec.yaml to support android.
\n
'
));
},
overrides:
<
Type
,
Generator
>
{
Logger:
()
=>
logger
,
...
...
@@ -2374,7 +2374,7 @@ void main() {
const
String
projectName
=
'foo_BarBaz'
;
final
Directory
projectDir
=
tempDir
.
childDirectory
(
projectName
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=linux'
,
'--skip-name-checks'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=linux'
,
'--skip-name-checks'
,
projectDir
.
path
]);
final
Directory
platformDir
=
projectDir
.
childDirectory
(
'linux'
);
const
String
classFilenameBase
=
'foo_bar_baz_plugin'
;
...
...
@@ -2405,7 +2405,7 @@ void main() {
const
String
projectName
=
'foo_BarBaz'
;
final
Directory
projectDir
=
tempDir
.
childDirectory
(
projectName
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=windows'
,
'--skip-name-checks'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=windows'
,
'--skip-name-checks'
,
projectDir
.
path
]);
final
Directory
platformDir
=
projectDir
.
childDirectory
(
'windows'
);
const
String
classFilenameBase
=
'foo_bar_baz_plugin'
;
...
...
@@ -2437,7 +2437,7 @@ void main() {
const
String
projectName
=
'foo_bar_plugin'
;
final
Directory
projectDir
=
tempDir
.
childDirectory
(
projectName
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=linux'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=linux'
,
projectDir
.
path
]);
final
Directory
platformDir
=
projectDir
.
childDirectory
(
'linux'
);
// If the project already ends in _plugin, it shouldn't be added again.
...
...
@@ -2473,7 +2473,7 @@ void main() {
const
String
projectName
=
'foo_bar_plugin'
;
final
Directory
projectDir
=
tempDir
.
childDirectory
(
projectName
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=windows'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=windows'
,
projectDir
.
path
]);
final
Directory
platformDir
=
projectDir
.
childDirectory
(
'windows'
);
// If the project already ends in _plugin, it shouldn't be added again.
...
...
@@ -2523,7 +2523,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=ios'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
expect
(
logger
.
errorText
,
isNot
(
contains
(
_kNoPlatformsMessage
)));
...
...
@@ -2583,7 +2583,7 @@ void main() {
final
CreateCommand
command
=
CreateCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform
s
=windows'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
'--platform=windows'
,
projectDir
.
path
]);
await
runner
.
run
(<
String
>[
'create'
,
'--no-pub'
,
'--template=plugin'
,
projectDir
.
path
]);
expect
(
logger
.
statusText
,
isNot
(
contains
(
_kDisabledPlatformRequestedMessage
)));
...
...
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