allow command line option "--project-name" in flutter create (#22022)
Simple convenience function if users create flutter projects in custom folder structures and but want to specify a custom project name.
This commit is contained in:
committed by
Greg Spencer
parent
4f8acd8462
commit
b95b67a66b
@@ -298,6 +298,31 @@ void main() {
|
||||
);
|
||||
}, timeout: allowForCreateFlutterProject);
|
||||
|
||||
testUsingContext('plugin project with valid custom project name', () async {
|
||||
return _createProject(
|
||||
projectDir,
|
||||
<String>['--no-pub', '--template=plugin', '--project-name', 'xyz'],
|
||||
<String>[
|
||||
'android/src/main/java/com/example/xyz/XyzPlugin.java',
|
||||
'example/android/app/src/main/java/com/example/xyzexample/MainActivity.java',
|
||||
],
|
||||
unexpectedPaths: <String>[
|
||||
'android/src/main/java/com/example/flutterproject/FlutterProjectPlugin.java',
|
||||
'example/android/app/src/main/java/com/example/flutterprojectexample/MainActivity.java',
|
||||
],
|
||||
);
|
||||
}, timeout: allowForCreateFlutterProject);
|
||||
|
||||
testUsingContext('plugin project with invalid custom project name', () async {
|
||||
expect(
|
||||
() => _createProject(projectDir,
|
||||
<String>['--no-pub', '--template=plugin', '--project-name', 'xyz.xyz'],
|
||||
<String>[],
|
||||
),
|
||||
throwsToolExit(message: '"xyz.xyz" is not a valid Dart package name.'),
|
||||
);
|
||||
}, timeout: allowForCreateFlutterProject);
|
||||
|
||||
testUsingContext('legacy app project with-driver-test', () async {
|
||||
return _createAndAnalyzeProject(
|
||||
projectDir,
|
||||
|
||||
Reference in New Issue
Block a user