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
edcf4a69
Commit
edcf4a69
authored
Jan 27, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1419 from devoncarew/rename_init
rename the init command to create
parents
06ef620d
76d069f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
executable.dart
packages/flutter_tools/lib/executable.dart
+7
-2
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+3
-4
create_test.dart
packages/flutter_tools/test/create_test.dart
+7
-6
No files found.
packages/flutter_tools/lib/executable.dart
View file @
edcf4a69
...
...
@@ -14,8 +14,8 @@ import 'src/commands/analyze.dart';
import
'src/commands/apk.dart'
;
import
'src/commands/build.dart'
;
import
'src/commands/cache.dart'
;
import
'src/commands/create.dart'
;
import
'src/commands/daemon.dart'
;
import
'src/commands/init.dart'
;
import
'src/commands/install.dart'
;
import
'src/commands/ios.dart'
;
import
'src/commands/list.dart'
;
...
...
@@ -60,8 +60,8 @@ Future main(List<String> args) async {
..
addCommand
(
new
ApkCommand
())
..
addCommand
(
new
BuildCommand
())
..
addCommand
(
new
CacheCommand
())
..
addCommand
(
new
CreateCommand
())
..
addCommand
(
new
DaemonCommand
())
..
addCommand
(
new
InitCommand
())
..
addCommand
(
new
InstallCommand
())
..
addCommand
(
new
IOSCommand
())
..
addCommand
(
new
ListCommand
())
...
...
@@ -75,6 +75,11 @@ Future main(List<String> args) async {
..
addCommand
(
new
UpgradeCommand
());
return
Chain
.
capture
(()
async
{
// Convert `flutter init` invocations to `flutter create` ones.
// TODO(devoncarew): Remove this after a few releases.
if
(
args
.
isNotEmpty
&&
args
[
0
]
==
'init'
)
args
[
0
]
=
'create'
;
dynamic
result
=
await
runner
.
run
(
args
);
if
(
result
is
int
)
exit
(
result
);
...
...
packages/flutter_tools/lib/src/commands/
init
.dart
→
packages/flutter_tools/lib/src/commands/
create
.dart
View file @
edcf4a69
...
...
@@ -14,11 +14,11 @@ import '../artifacts.dart';
import
'../base/logging.dart'
;
import
'../base/process.dart'
;
class
Init
Command
extends
Command
{
final
String
name
=
'
init
'
;
class
Create
Command
extends
Command
{
final
String
name
=
'
create
'
;
final
String
description
=
'Create a new Flutter project.'
;
Init
Command
()
{
Create
Command
()
{
argParser
.
addOption
(
'out'
,
abbr:
'o'
,
help:
'The output directory.'
);
argParser
.
addFlag
(
'pub'
,
defaultsTo:
true
,
...
...
@@ -46,7 +46,6 @@ class InitCommand extends Command {
return
2
;
}
// TODO: Confirm overwrite of an existing directory with the user.
Directory
out
=
new
Directory
(
argResults
[
'out'
]);
new
FlutterSimpleTemplate
().
generateInto
(
out
,
flutterPackagePath
);
...
...
packages/flutter_tools/test/
init
_test.dart
→
packages/flutter_tools/test/
create
_test.dart
View file @
edcf4a69
...
...
@@ -7,14 +7,14 @@ import 'dart:io';
import
'package:args/command_runner.dart'
;
import
'package:path/path.dart'
as
path
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/commands/
init
.dart'
;
import
'package:flutter_tools/src/commands/
create
.dart'
;
import
'package:flutter_tools/src/base/process.dart'
;
import
'package:test/test.dart'
;
main
()
=>
defineTests
();
defineTests
()
{
group
(
'
init
'
,
()
{
group
(
'
create
'
,
()
{
Directory
temp
;
setUp
(()
{
...
...
@@ -31,17 +31,18 @@ defineTests() {
// Verify that we create a project that is well-formed.
test
(
'flutter-simple'
,
()
async
{
ArtifactStore
.
flutterRoot
=
'../..'
;
InitCommand
command
=
new
Init
Command
();
CreateCommand
command
=
new
Create
Command
();
CommandRunner
runner
=
new
CommandRunner
(
'test_flutter'
,
''
)
..
addCommand
(
command
);
await
runner
.
run
([
'
init
'
,
'--out'
,
temp
.
path
])
await
runner
.
run
([
'
create
'
,
'--out'
,
temp
.
path
])
.
then
((
int
code
)
=>
expect
(
code
,
equals
(
0
)));
String
mainPath
=
path
.
join
(
temp
.
path
,
'lib'
,
'main.dart'
);
expect
(
new
File
(
mainPath
).
existsSync
(),
true
);
ProcessResult
exec
=
Process
.
runSync
(
sdkBinaryName
(
'dartanalyzer'
),
[
'--fatal-warnings'
,
mainPath
],
workingDirectory:
temp
.
path
);
sdkBinaryName
(
'dartanalyzer'
),
[
'--fatal-warnings'
,
mainPath
],
workingDirectory:
temp
.
path
);
if
(
exec
.
exitCode
!=
0
)
{
print
(
exec
.
stdout
);
print
(
exec
.
stderr
);
...
...
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