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
cd65b790
Commit
cd65b790
authored
Oct 11, 2016
by
Dan Rubel
Committed by
GitHub
Oct 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch to package:mustache (#6273)
parent
6ec68c47
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
11 deletions
+10
-11
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+1
-2
template.dart
packages/flutter_tools/lib/src/template.dart
+2
-2
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+1
-1
main.dart.tmpl
packages/flutter_tools/templates/create/lib/main.dart.tmpl
+4
-4
pubspec.yaml.tmpl
packages/flutter_tools/templates/create/pubspec.yaml.tmpl
+2
-2
No files found.
packages/flutter_tools/lib/src/commands/create.dart
View file @
cd65b790
...
@@ -162,8 +162,7 @@ All done! In order to run your application, type:
...
@@ -162,8 +162,7 @@ All done! In order to run your application, type:
int
fileCount
=
0
;
int
fileCount
=
0
;
if
(
renderDriverTest
)
templateContext
[
'withDriverTest'
]
=
renderDriverTest
;
templateContext
[
'withDriverTest?'
]
=
<
String
,
dynamic
>{};
Template
createTemplate
=
new
Template
.
fromName
(
'create'
);
Template
createTemplate
=
new
Template
.
fromName
(
'create'
);
fileCount
+=
createTemplate
.
render
(
new
Directory
(
dirPath
),
templateContext
,
fileCount
+=
createTemplate
.
render
(
new
Directory
(
dirPath
),
templateContext
,
...
...
packages/flutter_tools/lib/src/template.dart
View file @
cd65b790
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
'dart:io'
;
import
'dart:io'
;
import
'package:mustache
4dart/mustache4dart
.dart'
as
mustache
;
import
'package:mustache
/mustache
.dart'
as
mustache
;
import
'package:path/path.dart'
as
path
;
import
'package:path/path.dart'
as
path
;
import
'cache.dart'
;
import
'cache.dart'
;
...
@@ -109,7 +109,7 @@ class Template {
...
@@ -109,7 +109,7 @@ class Template {
if
(
sourceFile
.
path
.
endsWith
(
_kTemplateExtension
))
{
if
(
sourceFile
.
path
.
endsWith
(
_kTemplateExtension
))
{
String
templateContents
=
sourceFile
.
readAsStringSync
();
String
templateContents
=
sourceFile
.
readAsStringSync
();
String
renderedContents
=
mustache
.
render
(
templateContents
,
context
);
String
renderedContents
=
new
mustache
.
Template
(
templateContents
).
renderString
(
context
);
finalDestinationFile
.
writeAsStringSync
(
renderedContents
);
finalDestinationFile
.
writeAsStringSync
(
renderedContents
);
...
...
packages/flutter_tools/pubspec.yaml
View file @
cd65b790
...
@@ -23,7 +23,7 @@ dependencies:
...
@@ -23,7 +23,7 @@ dependencies:
linter
:
^0.1.21
linter
:
^0.1.21
meta
:
^1.0.3
meta
:
^1.0.3
mustache
4dart
:
^1.0.0
mustache
:
^0.2.5
package_config
:
'
>=0.1.5
<2.0.0'
package_config
:
'
>=0.1.5
<2.0.0'
path
:
^1.3.0
path
:
^1.3.0
pub_semver
:
^1.0.0
pub_semver
:
^1.0.0
...
...
packages/flutter_tools/templates/create/lib/main.dart.tmpl
View file @
cd65b790
import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
{{#withDriverTest
?
}}
{{#withDriverTest}}
import 'package:flutter_driver/driver_extension.dart';
import 'package:flutter_driver/driver_extension.dart';
{{/withDriverTest
?
}}
{{/withDriverTest}}
void main() {
void main() {
{{#withDriverTest
?
}}
{{#withDriverTest}}
// Starts the app with Flutter Driver extension enabled to allow Flutter Driver
// Starts the app with Flutter Driver extension enabled to allow Flutter Driver
// to test the app.
// to test the app.
enableFlutterDriverExtension();
enableFlutterDriverExtension();
{{/withDriverTest
?
}}
{{/withDriverTest}}
runApp(
runApp(
new MaterialApp(
new MaterialApp(
title: 'Flutter Demo',
title: 'Flutter Demo',
...
...
packages/flutter_tools/templates/create/pubspec.yaml.tmpl
View file @
cd65b790
...
@@ -3,8 +3,8 @@ description: {{description}}
...
@@ -3,8 +3,8 @@ description: {{description}}
dependencies:
dependencies:
flutter:
flutter:
sdk: flutter
sdk: flutter
{{#withDriverTest
?
}}
{{#withDriverTest}}
dev_dependencies:
dev_dependencies:
flutter_driver:
flutter_driver:
sdk: flutter
sdk: flutter
{{/withDriverTest
?
}}
{{/withDriverTest}}
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