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
a03deafa
Commit
a03deafa
authored
Aug 10, 2015
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update the sky_tools template and readme
parent
52f78d4f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
17 deletions
+28
-17
README.md
packages/flutter_tools/README.md
+3
-3
sky_tools.dart
packages/flutter_tools/bin/sky_tools.dart
+8
-1
init.dart
packages/flutter_tools/lib/src/init.dart
+15
-11
init_test.dart
packages/flutter_tools/test/init_test.dart
+2
-2
No files found.
packages/flutter_tools/README.md
View file @
a03deafa
...
@@ -20,11 +20,11 @@ dependencies:
...
@@ -20,11 +20,11 @@ dependencies:
## Running sky_tools
## Running sky_tools
Run
`sky_tools`
(or
`pub global run sky_tools`
) to see a list of available
Run
`sky_tools`
(or
`pub global run sky_tools`
) to see a list of available
commands
.
commands
:
-
*init*
:
create a new project
-
`init`
to
create a new project
Then
run a sky_tools command, like
`init`
:
Then
, run a
`sky_tools`
command
:
sky_tools init --out my_sky_project
sky_tools init --out my_sky_project
...
...
packages/flutter_tools/bin/sky_tools.dart
View file @
a03deafa
...
@@ -21,7 +21,14 @@ void main(List<String> args) {
...
@@ -21,7 +21,14 @@ void main(List<String> args) {
parser
.
addCommand
(
handler
.
name
,
handler
.
parser
);
parser
.
addCommand
(
handler
.
name
,
handler
.
parser
);
handlers
[
handler
.
name
]
=
handler
;
handlers
[
handler
.
name
]
=
handler
;
ArgResults
results
=
parser
.
parse
(
args
);
ArgResults
results
;
try
{
results
=
parser
.
parse
(
args
);
}
catch
(
e
)
{
_printUsage
(
parser
,
handlers
,
e
is
FormatException
?
e
.
message
:
'
${e}
'
);
exit
(
1
);
}
if
(
results
[
'help'
])
{
if
(
results
[
'help'
])
{
_printUsage
(
parser
,
handlers
);
_printUsage
(
parser
,
handlers
);
...
...
packages/flutter_tools/lib/src/init.dart
View file @
a03deafa
...
@@ -45,9 +45,16 @@ class InitCommandHandler extends CommandHandler {
...
@@ -45,9 +45,16 @@ class InitCommandHandler extends CommandHandler {
print
(
''
);
print
(
''
);
String
message
=
'All done! To run your application:
\n
'
String
message
=
'''All done! To run your application:
'cd
${out.path}
\n
'
'./packages/sky/sky_tool start'
;
cd
${out.path}
./packages/sky/sky_tool start
Or if the Sky APK is not already on your device, run:
./packages/sky/sky_tool start --install
'''
;
if
(
results
[
'pub'
])
{
if
(
results
[
'pub'
])
{
print
(
"Running pub get..."
);
print
(
"Running pub get..."
);
...
@@ -128,8 +135,8 @@ const _readme = r'''
...
@@ -128,8 +135,8 @@ const _readme = r'''
## Getting Started
## Getting Started
For help getting started, view our online
For help getting started
with Sky
, view our online
[
readme
](https://github.com/domokit/sky_engine/blob/master/sky/packages/sky/README.md).
[
documentation
](https://github.com/domokit/sky_engine/blob/master/sky/packages/sky/README.md).
'''
;
'''
;
const
_pubspec
=
r''
'
const
_pubspec
=
r''
'
...
@@ -137,23 +144,20 @@ name: {{projectName}}
...
@@ -137,23 +144,20 @@ name: {{projectName}}
description: {{description}}
description: {{description}}
dependencies:
dependencies:
sky: any
sky: any
sky_tools: any
'''
;
'''
;
const
_libMain
=
r''
'
const
_libMain
=
r''
'
import '
package:
sky
/
widgets
.
dart
';
import '
package:
sky
/
widgets
.
dart
';
void main() => runApp(new HelloWorldApp());
class HelloWorldApp extends App {
class HelloWorldApp extends App {
Widget build() {
Widget build() {
return new Scaffold(
return new Scaffold(
toolbar: new ToolBar(center: new Text("Demo")),
toolbar: new ToolBar(center: new Text("
Sky
Demo")),
body: new Material(child: new Center(child: new Text("Hello world!"))),
body: new Material(child: new Center(child: new Text("Hello world!"))),
floatingActionButton: new FloatingActionButton(
floatingActionButton: new FloatingActionButton(
child: new Icon(type: '
content
/
add
', size: 24)));
child: new Icon(type: '
content
/
add
', size: 24)));
}
}
}
}
void main() {
runApp(new HelloWorldApp());
}
'''
;
'''
;
packages/flutter_tools/test/init_test.dart
View file @
a03deafa
...
@@ -32,9 +32,9 @@ defineTests() {
...
@@ -32,9 +32,9 @@ defineTests() {
results
.
values
[
'out'
]
=
temp
.
path
;
results
.
values
[
'out'
]
=
temp
.
path
;
await
handler
.
processArgResults
(
results
);
await
handler
.
processArgResults
(
results
);
String
path
=
p
.
join
(
temp
.
path
,
'lib/main.dart'
);
String
path
=
p
.
join
(
temp
.
path
,
'lib/main.dart'
);
print
(
path
);
expect
(
new
File
(
path
).
existsSync
(),
true
);
expect
(
new
File
(
path
).
existsSync
(),
true
);
ProcessResult
exec
=
Process
.
runSync
(
'dartanalyzer'
,
[
path
],
ProcessResult
exec
=
Process
.
runSync
(
'dartanalyzer'
,
[
'--fatal-warnings'
,
path
],
workingDirectory:
temp
.
path
);
workingDirectory:
temp
.
path
);
expect
(
exec
.
exitCode
,
0
);
expect
(
exec
.
exitCode
,
0
);
});
});
...
...
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