Unverified Commit 81e1f7d1 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] mode code size output to ~/.flutter-devtools (#71601)

parent ece72384
......@@ -532,7 +532,9 @@ Future<void> _performCodeSizeAnalysis(
kind: kind,
);
final File outputFile = globals.fsUtils.getUniqueFile(
globals.fs.directory(getBuildDirectory()),'$kind-code-size-analysis', 'json',
globals.fs
.directory(globals.fsUtils.homeDirPath)
.childDirectory('.flutter-devtools'), '$kind-code-size-analysis', 'json',
)..writeAsStringSync(jsonEncode(output));
// This message is used as a sentinel in analyze_apk_size_test.dart
globals.printStatus(
......
......@@ -103,6 +103,7 @@ class FileSystemUtils {
final String name = '${baseName}_${i.toString().padLeft(2, '0')}.$ext';
final File file = fs.file(_fileSystem.path.join(dir.path, name));
if (!file.existsSync()) {
file.createSync(recursive: true);
return file;
}
i += 1;
......
......@@ -286,7 +286,9 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
type: 'ios',
);
final File outputFile = globals.fsUtils.getUniqueFile(
globals.fs.directory(getBuildDirectory()),'ios-code-size-analysis', 'json',
globals.fs
.directory(globals.fsUtils.homeDirPath)
.childDirectory('.flutter-devtools'), 'ios-code-size-analysis', 'json',
)..writeAsStringSync(jsonEncode(output));
// This message is used as a sentinel in analyze_apk_size_test.dart
globals.printStatus(
......
......@@ -70,7 +70,9 @@ Future<void> buildLinux(
type: 'linux',
);
final File outputFile = globals.fsUtils.getUniqueFile(
globals.fs.directory(getBuildDirectory()),'linux-code-size-analysis', 'json',
globals.fs
.directory(globals.fsUtils.homeDirPath)
.childDirectory('.flutter-devtools'), 'linux-code-size-analysis', 'json',
)..writeAsStringSync(jsonEncode(output));
// This message is used as a sentinel in analyze_apk_size_test.dart
globals.printStatus(
......
......@@ -133,7 +133,9 @@ Future<void> buildMacOS({
excludePath: 'Versions', // Avoid double counting caused by symlinks
);
final File outputFile = globals.fsUtils.getUniqueFile(
globals.fs.directory(getBuildDirectory()), 'macos-code-size-analysis', 'json',
globals.fs
.directory(globals.fsUtils.homeDirPath)
.childDirectory('.flutter-devtools'), 'macos-code-size-analysis', 'json',
)..writeAsStringSync(jsonEncode(output));
// This message is used as a sentinel in analyze_apk_size_test.dart
globals.printStatus(
......
......@@ -78,7 +78,9 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
type: 'windows',
);
final File outputFile = globals.fsUtils.getUniqueFile(
globals.fs.directory(getBuildDirectory()),'windows-code-size-analysis', 'json',
globals.fs
.directory(globals.fsUtils.homeDirPath)
.childDirectory('.flutter-devtools'), 'windows-code-size-analysis', 'json',
)..writeAsStringSync(jsonEncode(output));
// This message is used as a sentinel in analyze_apk_size_test.dart
globals.printStatus(
......
......@@ -34,6 +34,7 @@ final Platform macosPlatform = FakePlatform(
operatingSystem: 'macos',
environment: <String, String>{
'FLUTTER_ROOT': '/',
'HOME': '/',
}
);
final Platform notMacosPlatform = FakePlatform(
......
......@@ -26,7 +26,8 @@ const String _kTestFlutterRoot = '/flutter';
final Platform linuxPlatform = FakePlatform(
operatingSystem: 'linux',
environment: <String, String>{
'FLUTTER_ROOT': _kTestFlutterRoot
'FLUTTER_ROOT': _kTestFlutterRoot,
'HOME': '/',
}
);
final Platform notLinuxPlatform = FakePlatform(
......
......@@ -26,7 +26,7 @@ import '../../src/testbed.dart';
class FakeXcodeProjectInterpreterWithProfile extends FakeXcodeProjectInterpreter {
@override
Future<XcodeProjectInfo> getInfo(String projectPath, {String projectFilename}) async {
Future<XcodeProjectInfo> getInfo(String projectPath, { String projectFilename }) async {
return XcodeProjectInfo(
<String>['Runner'],
<String>['Debug', 'Profile', 'Release'],
......@@ -40,6 +40,7 @@ final Platform macosPlatform = FakePlatform(
operatingSystem: 'macos',
environment: <String, String>{
'FLUTTER_ROOT': '/',
'HOME': '/',
}
);
final Platform notMacosPlatform = FakePlatform(
......
......@@ -28,6 +28,7 @@ final Platform windowsPlatform = FakePlatform(
environment: <String, String>{
'PROGRAMFILES(X86)': r'C:\Program Files (x86)\',
'FLUTTER_ROOT': flutterRoot,
'USERPROFILE': '/',
}
);
final Platform notWindowsPlatform = FakePlatform(
......
......@@ -34,6 +34,7 @@ void main() {
final String outputFilePath = line.split(apkDebugMessage).last.trim();
expect(fileSystem.file(fileSystem.path.join(woringDirectory, outputFilePath)), exists);
expect(outputFilePath, contains('.flutter-devtools'));
expect(result.exitCode, 0);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment