Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f11b790b
Unverified
Commit
f11b790b
authored
Jun 22, 2018
by
Michael Goderbauer
Committed by
GitHub
Jun 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track size of App.framework and Flutter.framework for Hello World (#18701)
parent
d89a6b54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+25
-2
No files found.
dev/devicelab/lib/tasks/perf_tests.dart
View file @
f11b790b
...
@@ -7,6 +7,7 @@ import 'dart:convert' show json;
...
@@ -7,6 +7,7 @@ import 'dart:convert' show json;
import
'dart:io'
;
import
'dart:io'
;
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
import
'package:path/path.dart'
as
p
;
import
'../framework/adb.dart'
;
import
'../framework/adb.dart'
;
import
'../framework/framework.dart'
;
import
'../framework/framework.dart'
;
...
@@ -288,9 +289,12 @@ class CompileTest {
...
@@ -288,9 +289,12 @@ class CompileTest {
watch
.
start
();
watch
.
start
();
await
flutter
(
'build'
,
options:
options
);
await
flutter
(
'build'
,
options:
options
);
watch
.
stop
();
watch
.
stop
();
// IPAs are created manually AFAICT
final
String
appPath
=
'
$cwd
/build/ios/Release-iphoneos/Runner.app/'
;
await
exec
(
'tar'
,
<
String
>[
'-zcf'
,
'build/app.ipa'
,
'build/ios/Release-iphoneos/Runner.app/'
]);
// IPAs are created manually, https://flutter.io/ios-release/
await
exec
(
'tar'
,
<
String
>[
'-zcf'
,
'build/app.ipa'
,
appPath
]);
releaseSizeInBytes
=
await
file
(
'
$cwd
/build/app.ipa'
).
length
();
releaseSizeInBytes
=
await
file
(
'
$cwd
/build/app.ipa'
).
length
();
if
(
reportPackageContentSizes
)
metrics
.
addAll
(
await
getSizesFromIosApp
(
appPath
));
break
;
break
;
case
DeviceOperatingSystem
.
android
:
case
DeviceOperatingSystem
.
android
:
options
.
insert
(
0
,
'apk'
);
options
.
insert
(
0
,
'apk'
);
...
@@ -361,6 +365,25 @@ class CompileTest {
...
@@ -361,6 +365,25 @@ class CompileTest {
return
_kSdkNameToMetricNameMapping
[
sdkName
];
return
_kSdkNameToMetricNameMapping
[
sdkName
];
}
}
static
Future
<
Map
<
String
,
dynamic
>>
getSizesFromIosApp
(
String
appPath
)
async
{
// Thin the binary to only contain one architecture.
final
String
xcodeBackend
=
p
.
join
(
flutterDirectory
.
path
,
'packages'
,
'flutter_tools'
,
'bin'
,
'xcode_backend.sh'
);
await
exec
(
xcodeBackend
,
<
String
>[
'thin'
],
environment:
<
String
,
String
>{
'ARCHS'
:
'arm64'
,
'WRAPPER_NAME'
:
p
.
basename
(
appPath
),
'TARGET_BUILD_DIR'
:
p
.
dirname
(
appPath
),
});
final
File
appFramework
=
new
File
(
p
.
join
(
appPath
,
'Frameworks'
,
'App.framework'
,
'App'
));
final
File
flutterFramework
=
new
File
(
p
.
join
(
appPath
,
'Frameworks'
,
'Flutter.framework'
,
'Flutter'
));
return
<
String
,
dynamic
>{
'app_framework_uncompressed_bytes'
:
await
appFramework
.
length
(),
'flutter_framework_uncompressed_bytes'
:
await
flutterFramework
.
length
(),
};
}
static
Future
<
Map
<
String
,
dynamic
>>
getSizesFromApk
(
String
apkPath
)
async
{
static
Future
<
Map
<
String
,
dynamic
>>
getSizesFromApk
(
String
apkPath
)
async
{
final
String
output
=
await
eval
(
'unzip'
,
<
String
>[
'-v'
,
apkPath
]);
final
String
output
=
await
eval
(
'unzip'
,
<
String
>[
'-v'
,
apkPath
]);
final
List
<
String
>
lines
=
output
.
split
(
'
\n
'
);
final
List
<
String
>
lines
=
output
.
split
(
'
\n
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment