only build asset when there is asset declared in pubspec (#31804)

This commit is contained in:
chunhtai
2019-04-30 16:03:47 -07:00
committed by GitHub
parent 514fb2c7c0
commit e2dfd73c2e
2 changed files with 36 additions and 24 deletions

View File

@@ -127,13 +127,14 @@ class TestCommand extends FastFlutterCommand {
await pubGet(context: PubContext.getVerifyContext(name), skipPubspecYamlCheck: true);
}
final bool buildTestAssets = argResults['test-assets'];
if (buildTestAssets) {
await _buildTestAsset();
}
final List<String> names = argResults['name'];
final List<String> plainNames = argResults['plain-name'];
final FlutterProject flutterProject = FlutterProject.current();
if (buildTestAssets && flutterProject.manifest.assets.isNotEmpty) {
await _buildTestAsset();
}
Iterable<String> files = argResults.rest.map<String>((String testPath) => fs.path.absolute(testPath)).toList();
final bool startPaused = argResults['start-paused'];