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