forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly propagate verbosity to subtasks in flutter.gradle (flutter#…
…117897) * Correctly propagate verbosity to subtasks in flutter.gradle * Add test * Revert accidental changes * Fix copyright year * Fix imports
- Loading branch information
Showing
2 changed files
with
67 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/flutter_tools/test/integration.shard/flutter_build_apk_verbose_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2014 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter_tools/src/base/file_system.dart'; | ||
import 'package:flutter_tools/src/base/io.dart'; | ||
|
||
import '../src/common.dart'; | ||
import 'test_utils.dart'; | ||
|
||
// Test that verbosity it propagated to Gradle tasks correctly. | ||
void main() { | ||
late Directory tempDir; | ||
late String flutterBin; | ||
late Directory exampleAppDir; | ||
|
||
setUp(() async { | ||
tempDir = createResolvedTempDirectorySync('flutter_build_test.'); | ||
flutterBin = fileSystem.path.join( | ||
getFlutterRoot(), | ||
'bin', | ||
'flutter', | ||
); | ||
exampleAppDir = tempDir.childDirectory('aaa').childDirectory('example'); | ||
|
||
processManager.runSync(<String>[ | ||
flutterBin, | ||
...getLocalEngineArguments(), | ||
'create', | ||
'--template=plugin', | ||
'--platforms=android', | ||
'aaa', | ||
], workingDirectory: tempDir.path); | ||
}); | ||
|
||
tearDown(() async { | ||
tryToDelete(tempDir); | ||
}); | ||
|
||
test( | ||
'flutter build apk -v output should contain gen_snapshot command', | ||
() async { | ||
final ProcessResult result = processManager.runSync(<String>[ | ||
flutterBin, | ||
...getLocalEngineArguments(), | ||
'build', | ||
'apk', | ||
'--target-platform=android-arm', | ||
'-v', | ||
], workingDirectory: exampleAppDir.path); | ||
expect( | ||
result.stdout, contains(RegExp(r'executing:\s+\S+gen_snapshot\s+'))); | ||
}, | ||
); | ||
} |