[flutter_tools] ensure build fails if asset files are missing (#54233)

Ensure build fails if asset files are missing and that stderr messages are forwarded through Gradle
This commit is contained in:
Jonah Williams
2020-04-07 19:42:57 -07:00
committed by GitHub
parent 0a25309fb1
commit 981afe39ae
5 changed files with 54 additions and 1 deletions

View File

@@ -190,6 +190,19 @@ Future<void> main() async {
result);
});
await runProjectTest((FlutterProject project) async {
section('gradlew assembleDebug forwards stderr');
await project.introducePubspecError();
final ProcessResult result =
await project.resultOfGradleTask('assembleRelease');
if (result.exitCode == 0)
throw failure(
'Gradle did not exit with error as expected', result);
final String output = '${result.stdout}\n${result.stderr}';
if (!output.contains('No file or variants found for asset: lib/gallery/example_code.dart.'))
throw failure(output, result);
});
await runProjectTest((FlutterProject project) async {
section('flutter build apk on build script with error');
await project.introduceError();