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
d71a8a70
Unverified
Commit
d71a8a70
authored
Aug 24, 2022
by
Stephen (Alex) Wallen
Committed by
GitHub
Aug 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[macOS] Bring up "hello_world" devicelab, compilation test for x86. (#109891)
parent
82f35976
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
31 deletions
+100
-31
.ci.yaml
.ci.yaml
+9
-0
TESTOWNERS
TESTOWNERS
+1
-0
hello_world_macos__compile.dart
dev/devicelab/bin/tasks/hello_world_macos__compile.dart
+12
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+78
-31
No files found.
.ci.yaml
View file @
d71a8a70
...
...
@@ -2521,6 +2521,15 @@ targets:
-
bin/**
-
.ci.yaml
-
name
:
Mac hello_world_macos__compile
bringup
:
true
# New target https://github.com/flutter/flutter/issues/109633
recipe
:
devicelab/devicelab_drone
timeout
:
60
properties
:
tags
:
>
["devicelab", "hostonly"]
task_name
:
hello_world_macos__compile
-
name
:
Mac module_custom_host_app_name_test
recipe
:
devicelab/devicelab_drone
timeout
:
60
...
...
TESTOWNERS
View file @
d71a8a70
...
...
@@ -226,6 +226,7 @@
/dev/devicelab/bin/tasks/complex_layout_win_desktop__start_up.dart @schectman @flutter/desktop
/dev/devicelab/bin/tasks/flutter_view_win_desktop__start_up.dart @schectman @flutter/desktop
/dev/devicelab/bin/tasks/platform_view_win_desktop__start_up.dart @schectman @flutter/desktop
/dev/devicelab/bin/tasks/hello_world_macos__compile.dart @a-wallen @flutter/desktop
## Host only framework tests
# Linux analyze
...
...
dev/devicelab/bin/tasks/hello_world_macos__compile.dart
0 → 100644
View file @
d71a8a70
// 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_devicelab/framework/devices.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
macos
;
await
task
(
createHelloWorldCompileTest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
d71a8a70
...
...
@@ -671,7 +671,7 @@ class StartupTest {
'--profile'
,
'--target=
$target
'
,
]);
applicationBinaryPath
=
_find
Ios
AppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
applicationBinaryPath
=
_find
Darwin
AppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
break
;
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fuchsia
:
...
...
@@ -805,7 +805,7 @@ class DevtoolsStartupTest {
'-v'
,
'--profile'
,
]);
applicationBinaryPath
=
_find
Ios
AppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
applicationBinaryPath
=
_find
Darwin
AppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
break
;
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fuchsia
:
...
...
@@ -1376,28 +1376,41 @@ class CompileTest {
switch
(
deviceOperatingSystem
)
{
case
DeviceOperatingSystem
.
ios
:
options
.
insert
(
0
,
'ios'
);
case
DeviceOperatingSystem
.
macos
:
unawaited
(
stderr
.
flush
());
late
final
String
deviceId
;
if
(
deviceOperatingSystem
==
DeviceOperatingSystem
.
ios
)
{
deviceId
=
'ios'
;
}
else
if
(
deviceOperatingSystem
==
DeviceOperatingSystem
.
macos
)
{
deviceId
=
'macos'
;
}
else
{
throw
Exception
(
'Attempted to run darwin compile workflow with
$deviceOperatingSystem
'
);
}
options
.
insert
(
0
,
deviceId
);
options
.
add
(
'--tree-shake-icons'
);
options
.
add
(
'--split-debug-info=infos/'
);
watch
.
start
();
await
flutter
(
'build'
,
options:
options
);
watch
.
stop
();
final
Directory
appBuildDirectory
=
dir
(
path
.
join
(
cwd
,
'build/ios/Release-iphoneos'
));
final
Directory
?
appBundle
=
appBuildDirectory
.
listSync
()
.
whereType
<
Directory
?>()
.
singleWhere
((
Directory
?
directory
)
=>
directory
!=
null
&&
path
.
extension
(
directory
.
path
)
==
'.app'
,
orElse:
()
=>
null
);
if
(
appBundle
==
null
)
{
throw
'Failed to find app bundle in
${appBuildDirectory.path}
'
;
final
Directory
buildDirectory
=
dir
(
path
.
join
(
cwd
,
'build'
,
));
final
String
?
appBundlePath
=
_findDarwinAppInBuildDirectory
(
buildDirectory
.
path
);
if
(
appBundlePath
==
null
)
{
throw
'Failed to find app bundle in
${buildDirectory.path}
'
;
}
final
String
appPath
=
appBundle
.
path
;
// IPAs are created manually, https://flutter.dev/ios-release/
await
exec
(
'tar'
,
<
String
>[
'-zcf'
,
'build/app.ipa'
,
appPath
]);
await
exec
(
'tar'
,
<
String
>[
'-zcf'
,
'build/app.ipa'
,
app
Bundle
Path
]);
releaseSizeInBytes
=
await
file
(
'
$cwd
/build/app.ipa'
).
length
();
if
(
reportPackageContentSizes
)
{
metrics
.
addAll
(
await
getSizesFromIosApp
(
appPath
));
final
Map
<
String
,
Object
>
sizeMetrics
=
await
getSizesFromDarwinApp
(
appPath:
appBundlePath
,
operatingSystem:
deviceOperatingSystem
,
);
metrics
.
addAll
(
sizeMetrics
);
}
break
;
case
DeviceOperatingSystem
.
android
:
...
...
@@ -1435,8 +1448,6 @@ class CompileTest {
throw
Exception
(
'Unsupported option for fake devices'
);
case
DeviceOperatingSystem
.
fuchsia
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
case
DeviceOperatingSystem
.
macos
:
throw
Exception
(
'Unsupported option for macOS devices'
);
case
DeviceOperatingSystem
.
windows
:
unawaited
(
stderr
.
flush
());
options
.
insert
(
0
,
'windows'
);
...
...
@@ -1496,7 +1507,9 @@ class CompileTest {
case
DeviceOperatingSystem
.
fuchsia
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
case
DeviceOperatingSystem
.
macos
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
unawaited
(
stderr
.
flush
());
options
.
insert
(
0
,
'macos'
);
break
;
case
DeviceOperatingSystem
.
windows
:
unawaited
(
stderr
.
flush
());
options
.
insert
(
0
,
'windows'
);
...
...
@@ -1511,19 +1524,52 @@ class CompileTest {
};
}
static
Future
<
Map
<
String
,
dynamic
>>
getSizesFromIosApp
(
String
appPath
)
async
{
// Thin the binary to only contain one architecture.
final
String
xcodeBackend
=
path
.
join
(
flutterDirectory
.
path
,
'packages'
,
'flutter_tools'
,
'bin'
,
'xcode_backend.sh'
);
await
exec
(
xcodeBackend
,
<
String
>[
'thin'
],
environment:
<
String
,
String
>{
'ARCHS'
:
'arm64'
,
'WRAPPER_NAME'
:
path
.
basename
(
appPath
),
'TARGET_BUILD_DIR'
:
path
.
dirname
(
appPath
),
});
static
Future
<
Map
<
String
,
Object
>>
getSizesFromDarwinApp
({
required
String
appPath
,
required
DeviceOperatingSystem
operatingSystem
,
})
async
{
late
final
File
flutterFramework
;
late
final
String
frameworkDirectory
;
switch
(
deviceOperatingSystem
)
{
case
DeviceOperatingSystem
.
ios
:
frameworkDirectory
=
path
.
join
(
appPath
,
'Frameworks'
,
);
flutterFramework
=
File
(
path
.
join
(
frameworkDirectory
,
'Flutter.framework'
,
'Flutter'
,
));
break
;
case
DeviceOperatingSystem
.
macos
:
frameworkDirectory
=
path
.
join
(
appPath
,
'Contents'
,
'Frameworks'
,
);
flutterFramework
=
File
(
path
.
join
(
frameworkDirectory
,
'FlutterMacOS.framework'
,
'FlutterMacOS'
,
));
// https://github.com/flutter/flutter/issues/70413
break
;
case
DeviceOperatingSystem
.
android
:
case
DeviceOperatingSystem
.
androidArm
:
case
DeviceOperatingSystem
.
androidArm64
:
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
windows
:
throw
Exception
(
'Called
${CompileTest.getSizesFromDarwinApp}
with
$operatingSystem
.'
);
}
final
File
appFramework
=
File
(
path
.
join
(
appPath
,
'Frameworks'
,
'App.framework'
,
'App'
));
final
File
flutterFramework
=
File
(
path
.
join
(
appPath
,
'Frameworks'
,
'Flutter.framework'
,
'Flutter'
));
final
File
appFramework
=
File
(
path
.
join
(
frameworkDirectory
,
'App.framework'
,
'App'
,
));
return
<
String
,
dynamic
>{
return
<
String
,
Object
>{
'app_framework_uncompressed_bytes'
:
await
appFramework
.
length
(),
'flutter_framework_uncompressed_bytes'
:
await
flutterFramework
.
length
(),
};
...
...
@@ -1884,8 +1930,9 @@ Future<File> waitForFile(String path) async {
throw
StateError
(
'Did not find vmservice out file after 1 hour'
);
}
String
?
_findIosAppInBuildDirectory
(
String
searchDirectory
)
{
for
(
final
FileSystemEntity
entity
in
Directory
(
searchDirectory
).
listSync
())
{
String
?
_findDarwinAppInBuildDirectory
(
String
searchDirectory
)
{
for
(
final
FileSystemEntity
entity
in
Directory
(
searchDirectory
)
.
listSync
(
recursive:
true
))
{
if
(
entity
.
path
.
endsWith
(
'.app'
))
{
return
entity
.
path
;
}
...
...
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