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
1bdf3518
Commit
1bdf3518
authored
Jan 24, 2017
by
Ian Hickson
Committed by
GitHub
Jan 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pubspec.yaml and flutter.yaml. (#7605)
parent
ba4d78ac
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
268 additions
and
176 deletions
+268
-176
flutter.yaml
dev/automated_tests/flutter.yaml
+0
-1
pubspec.yaml
dev/automated_tests/pubspec.yaml
+2
-0
flutter.yaml
dev/benchmarks/complex_layout/flutter.yaml
+0
-6
pubspec.yaml
dev/benchmarks/complex_layout/pubspec.yaml
+8
-1
flutter.yaml
dev/benchmarks/microbenchmarks/flutter.yaml
+0
-2
pubspec.yaml
dev/benchmarks/microbenchmarks/pubspec.yaml
+3
-1
flutter.yaml
dev/manual_tests/flutter.yaml
+0
-1
pubspec.yaml
dev/manual_tests/pubspec.yaml
+2
-2
flutter.yaml
examples/flutter_gallery/flutter.yaml
+0
-86
pubspec.yaml
examples/flutter_gallery/pubspec.yaml
+87
-0
flutter.yaml
examples/hello_world/flutter.yaml
+0
-2
pubspec.yaml
examples/hello_world/pubspec.yaml
+3
-0
flutter.yaml
examples/layers/flutter.yaml
+0
-3
pubspec.yaml
examples/layers/pubspec.yaml
+4
-0
flutter.yaml
examples/stocks/flutter.yaml
+0
-2
pubspec.yaml
examples/stocks/pubspec.yaml
+3
-0
icon.dart
packages/flutter/lib/src/material/icon.dart
+9
-2
asset_bundle.dart
packages/flutter/lib/src/services/asset_bundle.dart
+24
-4
asset.dart
packages/flutter_tools/lib/src/asset.dart
+15
-14
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+1
-1
flx.dart
packages/flutter_tools/lib/src/flx.dart
+1
-1
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+21
-2
services.dart
packages/flutter_tools/lib/src/services.dart
+4
-3
flutter_yaml.json
packages/flutter_tools/schema/flutter_yaml.json
+0
-40
pubspec_yaml.json
packages/flutter_tools/schema/pubspec_yaml.json
+46
-0
flutter.yaml.tmpl
packages/flutter_tools/templates/create/flutter.yaml.tmpl
+0
-2
pubspec.yaml.tmpl
packages/flutter_tools/templates/create/pubspec.yaml.tmpl
+35
-0
No files found.
dev/automated_tests/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
uses-material-design
:
true
dev/automated_tests/pubspec.yaml
View file @
1bdf3518
...
...
@@ -4,3 +4,5 @@ dependencies:
sdk
:
flutter
flutter_test
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
dev/benchmarks/complex_layout/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
name
:
complex_layout
uses-material-design
:
true
assets
:
-
packages/flutter_gallery_assets/ali_connors.png
-
packages/flutter_gallery_assets/ali_connors_sml.png
-
packages/flutter_gallery_assets/top_10_australian_beaches.png
dev/benchmarks/complex_layout/pubspec.yaml
View file @
1bdf3518
name
:
complex_layout
description
:
A
new flutter projec
t.
description
:
A
benchmark of a relatively complex layou
t.
dependencies
:
flutter
:
...
...
@@ -16,3 +16,10 @@ dependencies:
dev_dependencies
:
flutter_test
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
assets
:
-
packages/flutter_gallery_assets/ali_connors.png
-
packages/flutter_gallery_assets/ali_connors_sml.png
-
packages/flutter_gallery_assets/top_10_australian_beaches.png
dev/benchmarks/microbenchmarks/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
name
:
microbenchmarks
uses-material-design
:
true
dev/benchmarks/microbenchmarks/pubspec.yaml
View file @
1bdf3518
name
:
microbenchmarks
description
:
A new flutter project
.
description
:
Small benchmarks for very specific parts of the Flutter framework
.
dependencies
:
meta
:
^1.0.3
flutter
:
...
...
@@ -8,3 +8,5 @@ dependencies:
sdk
:
flutter
stocks
:
path
:
../../../examples/stocks
flutter
:
uses-material-design
:
true
dev/manual_tests/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
uses-material-design
:
true
dev/manual_tests/pubspec.yaml
View file @
1bdf3518
name
:
flutter_manual_tests
dependencies
:
flutter
:
sdk
:
flutter
dev_dependencies
:
flutter_test
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
examples/flutter_gallery/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
name
:
flutter_gallery
uses-material-design
:
true
assets
:
-
lib/gallery/example_code.dart
-
packages/flutter_gallery_assets/appbar_background.jpg
-
packages/flutter_gallery_assets/appbar/appbar_background_layer0.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer1.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer2.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer3.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer4.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer5.png
-
packages/flutter_gallery_assets/pesto/avatar.jpg
-
packages/flutter_gallery_assets/pesto/image10.jpg
-
packages/flutter_gallery_assets/pesto/image11.jpg
-
packages/flutter_gallery_assets/pesto/image12.jpg
-
packages/flutter_gallery_assets/pesto/image13.jpg
-
packages/flutter_gallery_assets/pesto/image1.jpg
-
packages/flutter_gallery_assets/pesto/image2.jpg
-
packages/flutter_gallery_assets/pesto/image3.jpg
-
packages/flutter_gallery_assets/pesto/image4.jpg
-
packages/flutter_gallery_assets/pesto/image5.jpg
-
packages/flutter_gallery_assets/pesto/image6.jpg
-
packages/flutter_gallery_assets/pesto/image7.jpg
-
packages/flutter_gallery_assets/pesto/image8.jpg
-
packages/flutter_gallery_assets/pesto/image9.jpg
-
packages/flutter_gallery_assets/pesto/logo_small.png
-
packages/flutter_gallery_assets/pesto/logo_medium.png
-
packages/flutter_gallery_assets/pesto/fish.png
-
packages/flutter_gallery_assets/pesto/healthy.png
-
packages/flutter_gallery_assets/pesto/main.png
-
packages/flutter_gallery_assets/pesto/meat.png
-
packages/flutter_gallery_assets/pesto/quick.png
-
packages/flutter_gallery_assets/pesto/spicy.png
-
packages/flutter_gallery_assets/pesto/veggie.png
-
packages/flutter_gallery_assets/about_logo.png
-
packages/flutter_gallery_assets/ali_connors.jpg
-
packages/flutter_gallery_assets/drawer_logo.png
-
packages/flutter_gallery_assets/kangaroo_valley_safari.jpg
-
packages/flutter_gallery_assets/top_10_australian_beaches.jpg
-
packages/flutter_gallery_assets/landscape_0.jpg
-
packages/flutter_gallery_assets/landscape_1.jpg
-
packages/flutter_gallery_assets/landscape_2.jpg
-
packages/flutter_gallery_assets/landscape_3.jpg
-
packages/flutter_gallery_assets/landscape_4.jpg
-
packages/flutter_gallery_assets/landscape_5.jpg
-
packages/flutter_gallery_assets/landscape_6.jpg
-
packages/flutter_gallery_assets/landscape_7.jpg
-
packages/flutter_gallery_assets/landscape_8.jpg
-
packages/flutter_gallery_assets/landscape_9.jpg
-
packages/flutter_gallery_assets/landscape_10.jpg
-
packages/flutter_gallery_assets/landscape_11.jpg
-
packages/flutter_gallery_assets/shrine/products/backpack.png
-
packages/flutter_gallery_assets/shrine/products/beachball.png
-
packages/flutter_gallery_assets/shrine/products/binoculars.png
-
packages/flutter_gallery_assets/shrine/products/brush.png
-
packages/flutter_gallery_assets/shrine/products/chair.png
-
packages/flutter_gallery_assets/shrine/products/chucks.png
-
packages/flutter_gallery_assets/shrine/products/clock.png
-
packages/flutter_gallery_assets/shrine/products/fish_bowl.png
-
packages/flutter_gallery_assets/shrine/products/flippers.png
-
packages/flutter_gallery_assets/shrine/products/green-shoes.png
-
packages/flutter_gallery_assets/shrine/products/heels.png
-
packages/flutter_gallery_assets/shrine/products/helmet.png
-
packages/flutter_gallery_assets/shrine/products/lawn_chair.png
-
packages/flutter_gallery_assets/shrine/products/lipstick.png
-
packages/flutter_gallery_assets/shrine/products/popsicle.png
-
packages/flutter_gallery_assets/shrine/products/radio.png
-
packages/flutter_gallery_assets/shrine/products/sunnies.png
-
packages/flutter_gallery_assets/shrine/products/surfboard.png
-
packages/flutter_gallery_assets/shrine/products/teapot.png
-
packages/flutter_gallery_assets/shrine/vendors/16c477b.jpg
-
packages/flutter_gallery_assets/shrine/vendors/ali-connors.png
-
packages/flutter_gallery_assets/shrine/vendors/peter-carlsson.png
-
packages/flutter_gallery_assets/shrine/vendors/sandra-adams.jpg
-
packages/flutter_gallery_assets/shrine/vendors/zach.jpg
fonts
:
-
family
:
Raleway
fonts
:
-
asset
:
packages/flutter_gallery_assets/pesto/fonts/Raleway-Regular.ttf
-
asset
:
packages/flutter_gallery_assets/pesto/fonts/Raleway-Medium.ttf
weight
:
500
-
asset
:
packages/flutter_gallery_assets/pesto/fonts/Raleway-SemiBold.ttf
weight
:
600
-
family
:
AbrilFatface
fonts
:
-
asset
:
packages/flutter_gallery_assets/shrine/fonts/abrilfatface/AbrilFatface-Regular.ttf
examples/flutter_gallery/pubspec.yaml
View file @
1bdf3518
...
...
@@ -18,3 +18,90 @@ dev_dependencies:
sdk
:
flutter
flutter_driver
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
assets
:
-
lib/gallery/example_code.dart
-
packages/flutter_gallery_assets/appbar_background.jpg
-
packages/flutter_gallery_assets/appbar/appbar_background_layer0.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer1.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer2.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer3.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer4.png
-
packages/flutter_gallery_assets/appbar/appbar_background_layer5.png
-
packages/flutter_gallery_assets/pesto/avatar.jpg
-
packages/flutter_gallery_assets/pesto/image10.jpg
-
packages/flutter_gallery_assets/pesto/image11.jpg
-
packages/flutter_gallery_assets/pesto/image12.jpg
-
packages/flutter_gallery_assets/pesto/image13.jpg
-
packages/flutter_gallery_assets/pesto/image1.jpg
-
packages/flutter_gallery_assets/pesto/image2.jpg
-
packages/flutter_gallery_assets/pesto/image3.jpg
-
packages/flutter_gallery_assets/pesto/image4.jpg
-
packages/flutter_gallery_assets/pesto/image5.jpg
-
packages/flutter_gallery_assets/pesto/image6.jpg
-
packages/flutter_gallery_assets/pesto/image7.jpg
-
packages/flutter_gallery_assets/pesto/image8.jpg
-
packages/flutter_gallery_assets/pesto/image9.jpg
-
packages/flutter_gallery_assets/pesto/logo_small.png
-
packages/flutter_gallery_assets/pesto/logo_medium.png
-
packages/flutter_gallery_assets/pesto/fish.png
-
packages/flutter_gallery_assets/pesto/healthy.png
-
packages/flutter_gallery_assets/pesto/main.png
-
packages/flutter_gallery_assets/pesto/meat.png
-
packages/flutter_gallery_assets/pesto/quick.png
-
packages/flutter_gallery_assets/pesto/spicy.png
-
packages/flutter_gallery_assets/pesto/veggie.png
-
packages/flutter_gallery_assets/about_logo.png
-
packages/flutter_gallery_assets/ali_connors.jpg
-
packages/flutter_gallery_assets/drawer_logo.png
-
packages/flutter_gallery_assets/kangaroo_valley_safari.jpg
-
packages/flutter_gallery_assets/top_10_australian_beaches.jpg
-
packages/flutter_gallery_assets/landscape_0.jpg
-
packages/flutter_gallery_assets/landscape_1.jpg
-
packages/flutter_gallery_assets/landscape_2.jpg
-
packages/flutter_gallery_assets/landscape_3.jpg
-
packages/flutter_gallery_assets/landscape_4.jpg
-
packages/flutter_gallery_assets/landscape_5.jpg
-
packages/flutter_gallery_assets/landscape_6.jpg
-
packages/flutter_gallery_assets/landscape_7.jpg
-
packages/flutter_gallery_assets/landscape_8.jpg
-
packages/flutter_gallery_assets/landscape_9.jpg
-
packages/flutter_gallery_assets/landscape_10.jpg
-
packages/flutter_gallery_assets/landscape_11.jpg
-
packages/flutter_gallery_assets/shrine/products/backpack.png
-
packages/flutter_gallery_assets/shrine/products/beachball.png
-
packages/flutter_gallery_assets/shrine/products/binoculars.png
-
packages/flutter_gallery_assets/shrine/products/brush.png
-
packages/flutter_gallery_assets/shrine/products/chair.png
-
packages/flutter_gallery_assets/shrine/products/chucks.png
-
packages/flutter_gallery_assets/shrine/products/clock.png
-
packages/flutter_gallery_assets/shrine/products/fish_bowl.png
-
packages/flutter_gallery_assets/shrine/products/flippers.png
-
packages/flutter_gallery_assets/shrine/products/green-shoes.png
-
packages/flutter_gallery_assets/shrine/products/heels.png
-
packages/flutter_gallery_assets/shrine/products/helmet.png
-
packages/flutter_gallery_assets/shrine/products/lawn_chair.png
-
packages/flutter_gallery_assets/shrine/products/lipstick.png
-
packages/flutter_gallery_assets/shrine/products/popsicle.png
-
packages/flutter_gallery_assets/shrine/products/radio.png
-
packages/flutter_gallery_assets/shrine/products/sunnies.png
-
packages/flutter_gallery_assets/shrine/products/surfboard.png
-
packages/flutter_gallery_assets/shrine/products/teapot.png
-
packages/flutter_gallery_assets/shrine/vendors/16c477b.jpg
-
packages/flutter_gallery_assets/shrine/vendors/ali-connors.png
-
packages/flutter_gallery_assets/shrine/vendors/peter-carlsson.png
-
packages/flutter_gallery_assets/shrine/vendors/sandra-adams.jpg
-
packages/flutter_gallery_assets/shrine/vendors/zach.jpg
fonts
:
-
family
:
Raleway
fonts
:
-
asset
:
packages/flutter_gallery_assets/pesto/fonts/Raleway-Regular.ttf
-
asset
:
packages/flutter_gallery_assets/pesto/fonts/Raleway-Medium.ttf
weight
:
500
-
asset
:
packages/flutter_gallery_assets/pesto/fonts/Raleway-SemiBold.ttf
weight
:
600
-
family
:
AbrilFatface
fonts
:
-
asset
:
packages/flutter_gallery_assets/shrine/fonts/abrilfatface/AbrilFatface-Regular.ttf
examples/hello_world/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
name
:
hello_world
uses-material-design
:
true
examples/hello_world/pubspec.yaml
View file @
1bdf3518
...
...
@@ -7,3 +7,6 @@ dependencies:
dev_dependencies
:
flutter_test
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
examples/layers/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
name
:
layers-examples
assets
:
-
services/data.json
examples/layers/pubspec.yaml
View file @
1bdf3518
...
...
@@ -6,3 +6,7 @@ dependencies:
dev_dependencies
:
flutter_test
:
sdk
:
flutter
flutter
:
assets
:
-
services/data.json
examples/stocks/flutter.yaml
deleted
100644 → 0
View file @
ba4d78ac
name
:
stocks
uses-material-design
:
true
examples/stocks/pubspec.yaml
View file @
1bdf3518
...
...
@@ -9,3 +9,6 @@ dev_dependencies:
sdk
:
flutter
flutter_driver
:
sdk
:
flutter
flutter
:
uses-material-design
:
true
packages/flutter/lib/src/material/icon.dart
View file @
1bdf3518
...
...
@@ -21,8 +21,15 @@ import 'theme.dart';
/// Available icons are shown on this page: <https://design.google.com/icons/>
///
/// To use this class, make sure you set `uses-material-design: true` in your
/// project's `flutter.yaml` file. This ensures that the MaterialIcons font is
/// included in your application. This font is used to display the icons.
/// project's `pubspec.yaml` file in the `flutter` section. This ensures that
/// the MaterialIcons font is included in your application. This font is used to
/// display the icons. For example:
///
/// ```yaml
/// name: my_awesome_application
/// flutter:
/// uses-material-design: true
/// ```
///
/// See also:
///
...
...
packages/flutter/lib/src/services/asset_bundle.dart
View file @
1bdf3518
...
...
@@ -21,8 +21,18 @@ import 'platform_messages.dart';
///
/// Applications have a [rootBundle], which contains the resources that were
/// packaged with the application when it was built. To add resources to the
/// [rootBundle] for your application, add them to the `assets` section of your
/// `flutter.yaml` manifest.
/// [rootBundle] for your application, add them to the `assets` subsection of
/// the `flutter` section of your application's `pubspec.yaml` manifest.
///
/// For example:
///
/// ```yaml
/// name: my_awesome_application
/// flutter:
/// assets:
/// - images/hamilton.jpeg
/// - images/lafayette.jpeg
/// ```
///
/// Rather than accessing the [rootBundle] global static directly, consider
/// obtaining the [AssetBundle] for the current [BuildContext] using
...
...
@@ -202,8 +212,18 @@ AssetBundle _initRootBundle() {
///
/// The [rootBundle] contains the resources that were packaged with the
/// application when it was built. To add resources to the [rootBundle] for your
/// application, add them to the `assets` section of your `flutter.yaml`
/// manifest.
/// application, add them to the `assets` subsection of the `flutter` section of
/// your application's `pubspec.yaml` manifest.
///
/// For example:
///
/// ```yaml
/// name: my_awesome_application
/// flutter:
/// assets:
/// - images/hamilton.jpeg
/// - images/lafayette.jpeg
/// ```
///
/// Rather than using [rootBundle] directly, consider obtaining the
/// [AssetBundle] for the current [BuildContext] using [DefaultAssetBundle.of].
...
...
packages/flutter_tools/lib/src/asset.dart
View file @
1bdf3518
...
...
@@ -20,7 +20,7 @@ import 'globals.dart';
class
AssetBundle
{
final
Map
<
String
,
DevFSContent
>
entries
=
<
String
,
DevFSContent
>{};
static
const
String
defaultManifestPath
=
'
flutter
.yaml'
;
static
const
String
defaultManifestPath
=
'
pubspec
.yaml'
;
static
const
String
_kAssetManifestJson
=
'AssetManifest.json'
;
static
const
String
_kFontManifestJson
=
'FontManifest.json'
;
static
const
String
_kFontSetMaterial
=
'material'
;
...
...
@@ -31,7 +31,7 @@ class AssetBundle {
DateTime
_lastBuildTimestamp
;
/// Constructs an [AssetBundle] that gathers the set of assets from the
///
flutter
.yaml manifest.
///
pubspec
.yaml manifest.
AssetBundle
();
/// Constructs an [AssetBundle] with a fixed set of assets.
...
...
@@ -77,9 +77,9 @@ class AssetBundle {
packagesPath
??=
path
.
absolute
(
PackageMap
.
globalPackagesPath
);
Object
manifest
;
try
{
manifest
=
_loadFlutter
Yaml
Manifest
(
manifestPath
);
manifest
=
_loadFlutterManifest
(
manifestPath
);
}
catch
(
e
)
{
printStatus
(
'Error detected in
flutter
.yaml:'
,
emphasis:
true
);
printStatus
(
'Error detected in
pubspec
.yaml:'
,
emphasis:
true
);
printError
(
e
);
return
1
;
}
...
...
@@ -89,12 +89,12 @@ class AssetBundle {
return
0
;
}
if
(
manifest
!=
null
)
{
int
result
=
await
_validateFlutter
Yaml
Manifest
(
manifest
);
int
result
=
await
_validateFlutterManifest
(
manifest
);
if
(
result
!=
0
)
return
result
;
}
Map
<
String
,
dynamic
>
manifestDescriptor
=
manifest
;
assert
(
manifestDescriptor
!=
null
)
;
manifestDescriptor
=
manifestDescriptor
[
'flutter'
]
??
<
String
,
dynamic
>{}
;
String
assetBasePath
=
path
.
dirname
(
path
.
absolute
(
manifestPath
));
_lastBuildTimestamp
=
new
DateTime
.
now
();
...
...
@@ -112,6 +112,7 @@ class AssetBundle {
return
1
;
final
bool
usesMaterialDesign
=
(
manifestDescriptor
!=
null
)
&&
manifestDescriptor
.
containsKey
(
'uses-material-design'
)
&&
manifestDescriptor
[
'uses-material-design'
];
for
(
_Asset
asset
in
assetVariants
.
keys
)
{
...
...
@@ -321,8 +322,8 @@ DevFSContent _createFontManifest(Map<String, dynamic> manifestDescriptor,
return
new
DevFSStringContent
(
JSON
.
encode
(
fonts
));
}
/// Given an assetBase location and a
flutter.yaml manifest, return a map of
/// assets to asset variants.
/// Given an assetBase location and a
pubspec.yaml Flutter manifest, return a
///
map of
assets to asset variants.
///
/// Returns `null` on missing assets.
Map
<
_Asset
,
List
<
_Asset
>>
_parseAssets
(
...
...
@@ -344,7 +345,7 @@ Map<_Asset, List<_Asset>> _parseAssets(
_Asset
baseAsset
=
_resolveAsset
(
packageMap
,
assetBase
,
asset
);
if
(!
baseAsset
.
assetFileExists
)
{
printError
(
'Error: unable to locate asset entry in
flutter
.yaml: "
$asset
".'
);
printError
(
'Error: unable to locate asset entry in
pubspec
.yaml: "
$asset
".'
);
return
null
;
}
...
...
@@ -389,7 +390,7 @@ Map<_Asset, List<_Asset>> _parseAssets(
_Asset
baseAsset
=
_resolveAsset
(
packageMap
,
assetBase
,
asset
);
if
(!
baseAsset
.
assetFileExists
)
{
printError
(
'Error: unable to locate asset entry in
flutter
.yaml: "
$asset
".'
);
printError
(
'Error: unable to locate asset entry in
pubspec
.yaml: "
$asset
".'
);
return
null
;
}
...
...
@@ -427,23 +428,23 @@ _Asset _resolveAsset(
return
new
_Asset
(
base:
assetBase
,
relativePath:
asset
);
}
dynamic
_loadFlutter
Yaml
Manifest
(
String
manifestPath
)
{
dynamic
_loadFlutterManifest
(
String
manifestPath
)
{
if
(
manifestPath
==
null
||
!
fs
.
isFileSync
(
manifestPath
))
return
null
;
String
manifestDescriptor
=
fs
.
file
(
manifestPath
).
readAsStringSync
();
return
loadYaml
(
manifestDescriptor
);
}
Future
<
int
>
_validateFlutter
Yaml
Manifest
(
Object
manifest
)
async
{
Future
<
int
>
_validateFlutterManifest
(
Object
manifest
)
async
{
String
schemaPath
=
path
.
join
(
path
.
absolute
(
Cache
.
flutterRoot
),
'packages'
,
'flutter_tools'
,
'schema'
,
'
flutter
_yaml.json'
);
'packages'
,
'flutter_tools'
,
'schema'
,
'
pubspec
_yaml.json'
);
Schema
schema
=
await
Schema
.
createSchemaFromUrl
(
'file://
$schemaPath
'
);
Validator
validator
=
new
Validator
(
schema
);
if
(
validator
.
validate
(
manifest
))
{
return
0
;
}
else
{
printStatus
(
'Error detected in
flutter
.yaml:'
,
emphasis:
true
);
printStatus
(
'Error detected in
pubspec
.yaml:'
,
emphasis:
true
);
printError
(
validator
.
errors
.
join
(
'
\n
'
));
return
1
;
}
...
...
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
1bdf3518
...
...
@@ -29,7 +29,7 @@ const String _kDefaultAndroidManifestPath = 'android/AndroidManifest.xml';
const
String
_kDefaultResourcesPath
=
'android/res'
;
const
String
_kDefaultAssetsPath
=
'android/assets'
;
const
String
_kFlutterManifestPath
=
'
flutter
.yaml'
;
const
String
_kFlutterManifestPath
=
'
pubspec
.yaml'
;
const
String
_kPackagesStatusPath
=
'.packages'
;
// Alias of the key provided in the Chromium debug keystore
...
...
packages/flutter_tools/lib/src/flx.dart
View file @
1bdf3518
...
...
@@ -19,7 +19,7 @@ import 'zip.dart';
const
String
defaultMainPath
=
'lib/main.dart'
;
const
String
defaultAssetBasePath
=
'.'
;
const
String
defaultManifestPath
=
'
flutter
.yaml'
;
const
String
defaultManifestPath
=
'
pubspec
.yaml'
;
String
get
defaultFlxOutputPath
=>
path
.
join
(
getBuildDirectory
(),
'app.flx'
);
String
get
defaultSnapshotPath
=>
path
.
join
(
getBuildDirectory
(),
'snapshot_blob.bin'
);
String
get
defaultDepfilePath
=>
path
.
join
(
getBuildDirectory
(),
'snapshot_blob.bin.d'
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
1bdf3518
...
...
@@ -208,9 +208,28 @@ abstract class FlutterCommand extends Command<Null> {
if
(!
PackageMap
.
isUsingCustomPackagesPath
)
{
// Don't expect a pubspec.yaml file if the user passed in an explicit .packages file path.
if
(!
fs
.
isFileSync
(
'pubspec.yaml'
))
{
throw
new
ToolExit
(
'Error: No pubspec.yaml file found.
\n
'
throw
new
ToolExit
(
'Error: No pubspec.yaml file found.
\n
'
'This command should be run from the root of your Flutter project.
\n
'
'Do not run this command from the root of your git clone of Flutter.'
);
'Do not run this command from the root of your git clone of Flutter.'
);
}
if
(
fs
.
isFileSync
(
'flutter.yaml'
))
{
throw
new
ToolExit
(
'Please merge your flutter.yaml into your pubspec.yaml.
\n\n
'
'We have changed from having separate flutter.yaml and pubspec.yaml
\n
'
'files to having just one pubspec.yaml file. Transitioning is simple:
\n
'
'add a line that just says "flutter:" to your pubspec.yaml file, and
\n
'
'move everything from your current flutter.yaml file into the
\n
'
'pubspec.yaml file, below that line, with everything indented by two
\n
'
'extra spaces compared to how it was in the flutter.yaml file. Then, if
\n
'
'you had a "name:" line, move that to the top of your "pubspec.yaml"
\n
'
'file (you may already have one there), so that there is only one
\n
'
'"name:" line. Finally, delete the flutter.yaml file.
\n\n
'
'For an example of what a new-style pubspec.yaml file might look like,
\n
'
'check out the Flutter Gallery pubspec.yaml:
\n
'
'https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/pubspec.yaml
\n
'
);
}
}
...
...
packages/flutter_tools/lib/src/services.dart
View file @
1bdf3518
...
...
@@ -13,7 +13,7 @@ import 'dart/package_map.dart';
import
'android/android_sdk.dart'
;
import
'globals.dart'
;
const
String
_kFlutterManifestPath
=
'
flutter
.yaml'
;
const
String
_kFlutterManifestPath
=
'
pubspec
.yaml'
;
const
String
_kFlutterServicesManifestPath
=
'flutter_services.yaml'
;
dynamic
_loadYamlFile
(
String
path
)
{
...
...
@@ -24,7 +24,7 @@ dynamic _loadYamlFile(String path) {
return
loadYaml
(
manifestString
);
}
/// Loads all services specified in `
flutter
.yaml`. Parses each service config file,
/// Loads all services specified in `
pubspec
.yaml`. Parses each service config file,
/// storing meta data in [services] and the list of jar files in [jars].
Future
<
Null
>
parseServiceConfigs
(
List
<
Map
<
String
,
String
>>
services
,
{
List
<
File
>
jars
}
...
...
@@ -40,8 +40,9 @@ Future<Null> parseServiceConfigs(
dynamic
manifest
;
try
{
manifest
=
_loadYamlFile
(
_kFlutterManifestPath
);
manifest
=
manifest
[
'flutter'
];
}
catch
(
e
)
{
printStatus
(
'Error detected in
flutter
.yaml:'
,
emphasis:
true
);
printStatus
(
'Error detected in
pubspec
.yaml:'
,
emphasis:
true
);
printError
(
e
);
return
;
}
...
...
packages/flutter_tools/schema/flutter_yaml.json
deleted
100644 → 0
View file @
ba4d78ac
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"title"
:
"flutter.yaml"
,
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"name"
:
{
"type"
:
"string"
},
"uses-material-design"
:
{
"type"
:
"boolean"
},
"assets"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"string"
}
},
"services"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"string"
}
},
"fonts"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"family"
:
{
"type"
:
"string"
},
"fonts"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"asset"
:
{
"type"
:
"string"
},
"weight"
:
{
"type"
:
"integer"
},
"style"
:
{
"enum"
:
[
"normal"
,
"italic"
]
}
}
}
}
}
}
}
}
}
packages/flutter_tools/schema/pubspec_yaml.json
0 → 100644
View file @
1bdf3518
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"title"
:
"pubspec.yaml"
,
"type"
:
"object"
,
"additionalProperties"
:
true
,
"properties"
:
{
"name"
:
{
"type"
:
"string"
},
"flutter"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"uses-material-design"
:
{
"type"
:
"boolean"
},
"assets"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"string"
}
},
"services"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"string"
}
},
"fonts"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"family"
:
{
"type"
:
"string"
},
"fonts"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"asset"
:
{
"type"
:
"string"
},
"weight"
:
{
"enum"
:
[
100
,
200
,
300
,
400
,
500
,
600
,
700
,
800
,
900
]
},
"style"
:
{
"enum"
:
[
"normal"
,
"italic"
]
}
}
}
}
}
}
}
}
}
}
}
packages/flutter_tools/templates/create/flutter.yaml.tmpl
deleted
100644 → 0
View file @
ba4d78ac
name: {{projectName}}
uses-material-design: true
packages/flutter_tools/templates/create/pubspec.yaml.tmpl
View file @
1bdf3518
name: {{projectName}}
description: {{description}}
dependencies:
flutter:
sdk: flutter
...
...
@@ -8,3 +9,37 @@ dev_dependencies:
flutter_driver:
sdk: flutter
{{/withDriverTest}}
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the Icons class.
uses-material-design: true
# To add assets to your application, add an assets section here, in
# this "flutter" section, as in:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
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