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
f98c4683
Unverified
Commit
f98c4683
authored
Nov 13, 2020
by
Jonah Williams
Committed by
GitHub
Nov 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove unused JSON schema (#70480)
parent
477a4241
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
218 deletions
+0
-218
flutter_manifest.dart
packages/flutter_tools/lib/src/flutter_manifest.dart
+0
-18
pubspec_yaml.json
packages/flutter_tools/schema/pubspec_yaml.json
+0
-114
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+0
-3
asset_bundle_package_fonts_test.dart
...s/test/general.shard/asset_bundle_package_fonts_test.dart
+0
-15
asset_bundle_package_test.dart
...r_tools/test/general.shard/asset_bundle_package_test.dart
+0
-36
asset_bundle_variant_test.dart
...r_tools/test/general.shard/asset_bundle_variant_test.dart
+0
-5
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+0
-4
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+0
-4
pubspec_schema.dart
packages/flutter_tools/test/src/pubspec_schema.dart
+0
-19
No files found.
packages/flutter_tools/lib/src/flutter_manifest.dart
View file @
f98c4683
...
@@ -10,7 +10,6 @@ import 'base/file_system.dart';
...
@@ -10,7 +10,6 @@ import 'base/file_system.dart';
import
'base/logger.dart'
;
import
'base/logger.dart'
;
import
'base/user_messages.dart'
;
import
'base/user_messages.dart'
;
import
'base/utils.dart'
;
import
'base/utils.dart'
;
import
'cache.dart'
;
import
'plugins.dart'
;
import
'plugins.dart'
;
/// A wrapper around the `flutter` section in the `pubspec.yaml` file.
/// A wrapper around the `flutter` section in the `pubspec.yaml` file.
...
@@ -347,24 +346,7 @@ class FontAsset {
...
@@ -347,24 +346,7 @@ class FontAsset {
String
toString
()
=>
'
$runtimeType
(asset:
${assetUri.path}
, weight;
$weight
, style:
$style
)'
;
String
toString
()
=>
'
$runtimeType
(asset:
${assetUri.path}
, weight;
$weight
, style:
$style
)'
;
}
}
@visibleForTesting
String
buildSchemaDir
(
FileSystem
fileSystem
)
{
return
fileSystem
.
path
.
join
(
fileSystem
.
path
.
absolute
(
Cache
.
flutterRoot
),
'packages'
,
'flutter_tools'
,
'schema'
,
);
}
@visibleForTesting
String
buildSchemaPath
(
FileSystem
fileSystem
)
{
return
fileSystem
.
path
.
join
(
buildSchemaDir
(
fileSystem
),
'pubspec_yaml.json'
,
);
}
/// This method should be kept in sync with the schema in
/// `$FLUTTER_ROOT/packages/flutter_tools/schema/pubspec_yaml.json`,
/// but avoid introducing dependencies on packages for simple validation.
bool
_validate
(
dynamic
manifest
,
Logger
logger
)
{
bool
_validate
(
dynamic
manifest
,
Logger
logger
)
{
final
List
<
String
>
errors
=
<
String
>[];
final
List
<
String
>
errors
=
<
String
>[];
if
(
manifest
is
!
YamlMap
)
{
if
(
manifest
is
!
YamlMap
)
{
...
...
packages/flutter_tools/schema/pubspec_yaml.json
deleted
100644 → 0
View file @
477a4241
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"$comment"
:
"This should be kept in sync with the validator in packages/flutter_tools/lib/src/flutter_manifest.dart"
,
"title"
:
"pubspec.yaml"
,
"type"
:
"object"
,
"additionalProperties"
:
true
,
"properties"
:
{
"name"
:
{
"type"
:
"string"
},
"flutter"
:
{
"oneOf"
:
[
{
"type"
:
"object"
},
{
"type"
:
"null"
}
],
"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"
]
}
}
}
}
}
}
},
"module"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"androidX"
:
{
"type"
:
"boolean"
},
"androidPackage"
:
{
"type"
:
"string"
},
"iosBundleIdentifier"
:
{
"type"
:
"string"
}
}
},
"plugin"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"platforms"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"android"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"package"
:
{
"type"
:
"string"
},
"pluginClass"
:
{
"type"
:
"string"
}
}
},
"ios"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"pluginClass"
:
{
"type"
:
"string"
}
}
},
"linux"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"pluginClass"
:
{
"type"
:
"string"
},
"dartPluginClass"
:
{
"type"
:
"string"
}
}
},
"macos"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"pluginClass"
:
{
"type"
:
"string"
},
"dartPluginClass"
:
{
"type"
:
"string"
}
}
},
"windows"
:
{
"type"
:
"object"
,
"additionalProperties"
:
false
,
"properties"
:
{
"pluginClass"
:
{
"type"
:
"string"
},
"dartPluginClass"
:
{
"type"
:
"string"
}
}
}
}
},
"androidPackage"
:
{
"type"
:
"string"
},
"iosPrefix"
:
{
"type"
:
"string"
},
"macosPrefix"
:
{
"type"
:
"string"
},
"pluginClass"
:
{
"type"
:
"string"
}
}
}
}
}
}
}
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
f98c4683
...
@@ -29,7 +29,6 @@ import 'package:process/process.dart';
...
@@ -29,7 +29,6 @@ import 'package:process/process.dart';
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/mocks.dart'
;
import
'../../src/mocks.dart'
;
import
'../../src/pubspec_schema.dart'
;
void
main
(
)
{
void
main
(
)
{
Cache
.
flutterRoot
=
getFlutterRoot
();
Cache
.
flutterRoot
=
getFlutterRoot
();
...
@@ -553,8 +552,6 @@ include ':app'
...
@@ -553,8 +552,6 @@ include ':app'
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
writeAsStringSync
(
manifest
);
manifestFile
.
writeAsStringSync
(
manifest
);
// write schemaData otherwise pubspec.yaml file can't be loaded
writeEmptySchemaFile
(
fs
);
updateLocalProperties
(
updateLocalProperties
(
project:
FlutterProject
.
fromPath
(
'path/to/project'
),
project:
FlutterProject
.
fromPath
(
'path/to/project'
),
...
...
packages/flutter_tools/test/general.shard/asset_bundle_package_fonts_test.dart
View file @
f98c4683
...
@@ -14,7 +14,6 @@ import 'package:flutter_tools/src/globals.dart' as globals;
...
@@ -14,7 +14,6 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'../src/context.dart'
;
import
'../src/pubspec_schema.dart'
;
void
main
(
)
{
void
main
(
)
{
String
fixPath
(
String
path
)
{
String
fixPath
(
String
path
)
{
...
@@ -106,8 +105,6 @@ $fontsSection
...
@@ -106,8 +105,6 @@ $fontsSection
});
});
testUsingContext
(
'App includes neither font manifest nor fonts when no defines fonts'
,
()
async
{
testUsingContext
(
'App includes neither font manifest nor fonts when no defines fonts'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePubspecFile
(
'p/p/pubspec.yaml'
,
'test_package'
);
writePubspecFile
(
'p/p/pubspec.yaml'
,
'test_package'
);
...
@@ -122,8 +119,6 @@ $fontsSection
...
@@ -122,8 +119,6 @@ $fontsSection
});
});
testUsingContext
(
'App font uses font file from package'
,
()
async
{
testUsingContext
(
'App font uses font file from package'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
const
String
fontsSection
=
'''
const
String
fontsSection
=
'''
- family: foo
- family: foo
fonts:
fonts:
...
@@ -150,8 +145,6 @@ $fontsSection
...
@@ -150,8 +145,6 @@ $fontsSection
});
});
testUsingContext
(
'App font uses local font file and package font file'
,
()
async
{
testUsingContext
(
'App font uses local font file and package font file'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
const
String
fontsSection
=
'''
const
String
fontsSection
=
'''
- family: foo
- family: foo
fonts:
fonts:
...
@@ -182,8 +175,6 @@ $fontsSection
...
@@ -182,8 +175,6 @@ $fontsSection
});
});
testUsingContext
(
'App uses package font with own font file'
,
()
async
{
testUsingContext
(
'App uses package font with own font file'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
const
String
fontsSection
=
'''
const
String
fontsSection
=
'''
...
@@ -215,8 +206,6 @@ $fontsSection
...
@@ -215,8 +206,6 @@ $fontsSection
});
});
testUsingContext
(
'App uses package font with font file from another package'
,
()
async
{
testUsingContext
(
'App uses package font with font file from another package'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/
\n
test_package2:p2/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/
\n
test_package2:p2/p/lib/'
);
const
String
fontsSection
=
'''
const
String
fontsSection
=
'''
...
@@ -249,8 +238,6 @@ $fontsSection
...
@@ -249,8 +238,6 @@ $fontsSection
});
});
testUsingContext
(
'App uses package font with properties and own font file'
,
()
async
{
testUsingContext
(
'App uses package font with properties and own font file'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -284,8 +271,6 @@ $fontsSection
...
@@ -284,8 +271,6 @@ $fontsSection
});
});
testUsingContext
(
'App uses local font and package font with own font file.'
,
()
async
{
testUsingContext
(
'App uses local font and package font with own font file.'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
const
String
fontsSection
=
'''
const
String
fontsSection
=
'''
- family: foo
- family: foo
fonts:
fonts:
...
...
packages/flutter_tools/test/general.shard/asset_bundle_package_test.dart
View file @
f98c4683
...
@@ -14,7 +14,6 @@ import 'package:flutter_tools/src/globals.dart' as globals;
...
@@ -14,7 +14,6 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'../src/context.dart'
;
import
'../src/pubspec_schema.dart'
;
void
main
(
)
{
void
main
(
)
{
String
fixPath
(
String
path
)
{
String
fixPath
(
String
path
)
{
...
@@ -115,8 +114,6 @@ $assetsSection
...
@@ -115,8 +114,6 @@ $assetsSection
group
(
'AssetBundle assets from packages'
,
()
{
group
(
'AssetBundle assets from packages'
,
()
{
testUsingContext
(
'No assets are bundled when the package has no assets'
,
()
async
{
testUsingContext
(
'No assets are bundled when the package has no assets'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePubspecFile
(
'p/p/pubspec.yaml'
,
'test_package'
);
writePubspecFile
(
'p/p/pubspec.yaml'
,
'test_package'
);
...
@@ -139,8 +136,6 @@ $assetsSection
...
@@ -139,8 +136,6 @@ $assetsSection
});
});
testUsingContext
(
'No assets are bundled when the package has an asset that is not listed'
,
()
async
{
testUsingContext
(
'No assets are bundled when the package has an asset that is not listed'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePubspecFile
(
'p/p/pubspec.yaml'
,
'test_package'
);
writePubspecFile
(
'p/p/pubspec.yaml'
,
'test_package'
);
...
@@ -167,8 +162,6 @@ $assetsSection
...
@@ -167,8 +162,6 @@ $assetsSection
testUsingContext
(
'One asset is bundled when the package has and lists one '
testUsingContext
(
'One asset is bundled when the package has and lists one '
'asset its pubspec'
,
()
async
{
'asset its pubspec'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -195,8 +188,6 @@ $assetsSection
...
@@ -195,8 +188,6 @@ $assetsSection
testUsingContext
(
'One asset is bundled when the package has one asset, '
testUsingContext
(
'One asset is bundled when the package has one asset, '
"listed in the app's pubspec"
,
()
async
{
"listed in the app's pubspec"
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
final
List
<
String
>
assetEntries
=
<
String
>[
'packages/test_package/a/foo'
];
final
List
<
String
>
assetEntries
=
<
String
>[
'packages/test_package/a/foo'
];
writePubspecFile
(
writePubspecFile
(
'pubspec.yaml'
,
'pubspec.yaml'
,
...
@@ -223,8 +214,6 @@ $assetsSection
...
@@ -223,8 +214,6 @@ $assetsSection
testUsingContext
(
'One asset and its variant are bundled when the package '
testUsingContext
(
'One asset and its variant are bundled when the package '
'has an asset and a variant, and lists the asset in its pubspec'
,
()
async
{
'has an asset and a variant, and lists the asset in its pubspec'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePubspecFile
(
writePubspecFile
(
...
@@ -251,8 +240,6 @@ $assetsSection
...
@@ -251,8 +240,6 @@ $assetsSection
testUsingContext
(
'One asset and its variant are bundled when the package '
testUsingContext
(
'One asset and its variant are bundled when the package '
'has an asset and a variant, and the app lists the asset in its pubspec'
,
()
async
{
'has an asset and a variant, and the app lists the asset in its pubspec'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
writePubspecFile
(
'pubspec.yaml'
,
'pubspec.yaml'
,
'test'
,
'test'
,
...
@@ -282,8 +269,6 @@ $assetsSection
...
@@ -282,8 +269,6 @@ $assetsSection
testUsingContext
(
'Two assets are bundled when the package has and lists '
testUsingContext
(
'Two assets are bundled when the package has and lists '
'two assets in its pubspec'
,
()
async
{
'two assets in its pubspec'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -310,8 +295,6 @@ $assetsSection
...
@@ -310,8 +295,6 @@ $assetsSection
});
});
testUsingContext
(
"Two assets are bundled when the package has two assets, listed in the app's pubspec"
,
()
async
{
testUsingContext
(
"Two assets are bundled when the package has two assets, listed in the app's pubspec"
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
final
List
<
String
>
assetEntries
=
<
String
>[
final
List
<
String
>
assetEntries
=
<
String
>[
'packages/test_package/a/foo'
,
'packages/test_package/a/foo'
,
'packages/test_package/a/bar'
,
'packages/test_package/a/bar'
,
...
@@ -345,8 +328,6 @@ $assetsSection
...
@@ -345,8 +328,6 @@ $assetsSection
});
});
testUsingContext
(
'Two assets are bundled when two packages each have and list an asset their pubspec'
,
()
async
{
testUsingContext
(
'Two assets are bundled when two packages each have and list an asset their pubspec'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
writePubspecFile
(
'pubspec.yaml'
,
'pubspec.yaml'
,
'test'
,
'test'
,
...
@@ -384,8 +365,6 @@ $assetsSection
...
@@ -384,8 +365,6 @@ $assetsSection
});
});
testUsingContext
(
"Two assets are bundled when two packages each have an asset, listed in the app's pubspec"
,
()
async
{
testUsingContext
(
"Two assets are bundled when two packages each have an asset, listed in the app's pubspec"
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
final
List
<
String
>
assetEntries
=
<
String
>[
final
List
<
String
>
assetEntries
=
<
String
>[
'packages/test_package/a/foo'
,
'packages/test_package/a/foo'
,
'packages/test_package2/a/foo'
,
'packages/test_package2/a/foo'
,
...
@@ -427,7 +406,6 @@ $assetsSection
...
@@ -427,7 +406,6 @@ $assetsSection
testUsingContext
(
'One asset is bundled when the app depends on a package, '
testUsingContext
(
'One asset is bundled when the app depends on a package, '
'listing in its pubspec an asset from another package'
,
()
async
{
'listing in its pubspec an asset from another package'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
writePubspecFile
(
'pubspec.yaml'
,
'pubspec.yaml'
,
'test'
,
'test'
,
...
@@ -462,8 +440,6 @@ $assetsSection
...
@@ -462,8 +440,6 @@ $assetsSection
});
});
testUsingContext
(
'Asset paths can contain URL reserved characters'
,
()
async
{
testUsingContext
(
'Asset paths can contain URL reserved characters'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -491,8 +467,6 @@ $assetsSection
...
@@ -491,8 +467,6 @@ $assetsSection
group
(
'AssetBundle assets from scanned paths'
,
()
{
group
(
'AssetBundle assets from scanned paths'
,
()
{
testUsingContext
(
'Two assets are bundled when scanning their directory'
,
()
async
{
testUsingContext
(
'Two assets are bundled when scanning their directory'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -521,8 +495,6 @@ $assetsSection
...
@@ -521,8 +495,6 @@ $assetsSection
});
});
testUsingContext
(
'Two assets are bundled when listing one and scanning second directory'
,
()
async
{
testUsingContext
(
'Two assets are bundled when listing one and scanning second directory'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -551,8 +523,6 @@ $assetsSection
...
@@ -551,8 +523,6 @@ $assetsSection
});
});
testUsingContext
(
'One asset is bundled with variant, scanning wrong directory'
,
()
async
{
testUsingContext
(
'One asset is bundled with variant, scanning wrong directory'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -580,8 +550,6 @@ $assetsSection
...
@@ -580,8 +550,6 @@ $assetsSection
group
(
'AssetBundle assets from scanned paths with MemoryFileSystem'
,
()
{
group
(
'AssetBundle assets from scanned paths with MemoryFileSystem'
,
()
{
testUsingContext
(
'One asset is bundled with variant, scanning directory'
,
()
async
{
testUsingContext
(
'One asset is bundled with variant, scanning directory'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -609,8 +577,6 @@ $assetsSection
...
@@ -609,8 +577,6 @@ $assetsSection
});
});
testUsingContext
(
'No asset is bundled with variant, no assets or directories are listed'
,
()
async
{
testUsingContext
(
'No asset is bundled with variant, no assets or directories are listed'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
@@ -637,8 +603,6 @@ $assetsSection
...
@@ -637,8 +603,6 @@ $assetsSection
});
});
testUsingContext
(
'Expect error generating manifest, wrong non-existing directory is listed'
,
()
async
{
testUsingContext
(
'Expect error generating manifest, wrong non-existing directory is listed'
,
()
async
{
writeEmptySchemaFile
(
globals
.
fs
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePubspecFile
(
'pubspec.yaml'
,
'test'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
writePackagesFile
(
'test_package:p/p/lib/'
);
...
...
packages/flutter_tools/test/general.shard/asset_bundle_variant_test.dart
View file @
f98c4683
...
@@ -14,7 +14,6 @@ import 'package:flutter_tools/src/globals.dart' as globals;
...
@@ -14,7 +14,6 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'../src/context.dart'
;
import
'../src/pubspec_schema.dart'
;
void
main
(
)
{
void
main
(
)
{
String
fixPath
(
String
path
)
{
String
fixPath
(
String
path
)
{
...
@@ -38,10 +37,6 @@ void main() {
...
@@ -38,10 +37,6 @@ void main() {
});
});
testUsingContext
(
'main asset and variants'
,
()
async
{
testUsingContext
(
'main asset and variants'
,
()
async
{
// Setting flutterRoot here so that it picks up the MemoryFileSystem's
// path separator.
writeEmptySchemaFile
(
globals
.
fs
);
globals
.
fs
.
file
(
'pubspec.yaml'
)
globals
.
fs
.
file
(
'pubspec.yaml'
)
..
createSync
()
..
createSync
()
..
writeAsStringSync
(
..
writeAsStringSync
(
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
f98c4683
...
@@ -19,7 +19,6 @@ import 'package:process/process.dart';
...
@@ -19,7 +19,6 @@ import 'package:process/process.dart';
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
import
'../../src/mocks.dart'
as
mocks
;
import
'../../src/mocks.dart'
as
mocks
;
import
'../../src/pubspec_schema.dart'
;
const
String
xcodebuild
=
'/usr/bin/xcodebuild'
;
const
String
xcodebuild
=
'/usr/bin/xcodebuild'
;
...
@@ -803,9 +802,6 @@ Information about project "Runner":
...
@@ -803,9 +802,6 @@ Information about project "Runner":
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
writeAsStringSync
(
manifestString
);
manifestFile
.
writeAsStringSync
(
manifestString
);
// write schemaData otherwise pubspec.yaml file can't be loaded
writeEmptySchemaFile
(
fs
);
await
updateGeneratedXcodeProperties
(
await
updateGeneratedXcodeProperties
(
project:
FlutterProject
.
fromPath
(
'path/to/project'
),
project:
FlutterProject
.
fromPath
(
'path/to/project'
),
buildInfo:
buildInfo
,
buildInfo:
buildInfo
,
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
f98c4683
...
@@ -792,10 +792,6 @@ void _testInMemory(String description, Future<void> testMethod()) {
...
@@ -792,10 +792,6 @@ void _testInMemory(String description, Future<void> testMethod()) {
.
childDirectory
(
'packages'
)
.
childDirectory
(
'packages'
)
.
childDirectory
(
'flutter_tools'
)
.
childDirectory
(
'flutter_tools'
)
.
childDirectory
(
'templates'
),
testFileSystem
);
.
childDirectory
(
'templates'
),
testFileSystem
);
transfer
(
globals
.
fs
.
directory
(
Cache
.
flutterRoot
)
.
childDirectory
(
'packages'
)
.
childDirectory
(
'flutter_tools'
)
.
childDirectory
(
'schema'
),
testFileSystem
);
// Set up enough of the packages to satisfy the templating code.
// Set up enough of the packages to satisfy the templating code.
final
File
packagesFile
=
testFileSystem
.
directory
(
Cache
.
flutterRoot
)
final
File
packagesFile
=
testFileSystem
.
directory
(
Cache
.
flutterRoot
)
.
childDirectory
(
'packages'
)
.
childDirectory
(
'packages'
)
...
...
packages/flutter_tools/test/src/pubspec_schema.dart
View file @
f98c4683
...
@@ -2,31 +2,12 @@
...
@@ -2,31 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:file/file.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/flutter_manifest.dart'
;
import
'package:flutter_tools/src/flutter_manifest.dart'
;
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:yaml/yaml.dart'
;
import
'package:yaml/yaml.dart'
;
import
'common.dart'
;
import
'common.dart'
;
/// Writes a schemaData used for validating pubspec.yaml files when parsing
/// asset information.
void
writeSchemaFile
(
FileSystem
filesystem
,
String
schemaData
)
{
final
String
schemaPath
=
buildSchemaPath
(
filesystem
);
final
File
schemaFile
=
filesystem
.
file
(
schemaPath
);
final
String
schemaDir
=
buildSchemaDir
(
filesystem
);
filesystem
.
directory
(
schemaDir
).
createSync
(
recursive:
true
);
schemaFile
.
writeAsStringSync
(
schemaData
);
}
/// Writes an empty schemaData that will validate any pubspec.yaml file.
void
writeEmptySchemaFile
(
FileSystem
filesystem
)
{
writeSchemaFile
(
filesystem
,
'{}'
);
}
/// Check if the pubspec.yaml file under the `projectDir` is valid for a plugin project.
/// Check if the pubspec.yaml file under the `projectDir` is valid for a plugin project.
void
validatePubspecForPlugin
(
{
@required
String
projectDir
,
@required
String
pluginClass
,
@required
List
<
String
>
expectedPlatforms
,
List
<
String
>
unexpectedPlatforms
=
const
<
String
>[],
String
androidIdentifier
,
String
webFileName
})
{
void
validatePubspecForPlugin
(
{
@required
String
projectDir
,
@required
String
pluginClass
,
@required
List
<
String
>
expectedPlatforms
,
List
<
String
>
unexpectedPlatforms
=
const
<
String
>[],
String
androidIdentifier
,
String
webFileName
})
{
final
FlutterManifest
manifest
=
FlutterManifest
.
createFromPath
(
projectDir
+
'/pubspec.yaml'
,
fileSystem:
globals
.
fs
,
logger:
globals
.
logger
);
final
FlutterManifest
manifest
=
FlutterManifest
.
createFromPath
(
projectDir
+
'/pubspec.yaml'
,
fileSystem:
globals
.
fs
,
logger:
globals
.
logger
);
...
...
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