[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user