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
ce9cde8c
Unverified
Commit
ce9cde8c
authored
Aug 28, 2020
by
Jenn Magder
Committed by
GitHub
Aug 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid thinning frameworks in iOS extensions (#64674)
parent
a3fe33af
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
300 additions
and
55 deletions
+300
-55
ios_app_with_extensions_test.dart
dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart
+112
-49
Debug.xcconfig
..._tests/ios_app_with_extensions/ios/Flutter/Debug.xcconfig
+1
-0
Release.xcconfig
...ests/ios_app_with_extensions/ios/Flutter/Release.xcconfig
+1
-0
Podfile
dev/integration_tests/ios_app_with_extensions/ios/Podfile
+43
-0
project.pbxproj
..._app_with_extensions/ios/Runner.xcodeproj/project.pbxproj
+137
-2
contents.xcworkspacedata
...xtensions/ios/Runner.xcworkspace/contents.xcworkspacedata
+3
-0
xcode_backend.sh
packages/flutter_tools/bin/xcode_backend.sh
+3
-4
No files found.
dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart
View file @
ce9cde8c
...
...
@@ -7,12 +7,14 @@ import 'dart:convert';
import
'dart:io'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/ios.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
import
'package:meta/meta.dart'
;
Future
<
void
>
main
()
async
{
await
task
(()
async
{
section
(
'Copy test Flutter App with
W
atchOS Companion'
);
section
(
'Copy test Flutter App with
w
atchOS Companion'
);
String
watchDeviceID
;
String
phoneDeviceID
;
...
...
@@ -33,22 +35,54 @@ Future<void> main() async {
await
inDirectory
(
projectDir
,
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
'ios'
,
'--no-codesign'
],
options:
<
String
>[
'ios'
,
'--no-codesign'
,
'--release'
],
);
});
final
bool
appReleaseBuilt
=
exists
(
Directory
(
path
.
join
(
final
String
appBundle
=
Directory
(
path
.
join
(
projectDir
.
path
,
'build'
,
'ios'
,
'iphoneos'
,
'Runner.app'
,
))
)
;
))
.
path
;
if
(!
appReleaseBuilt
)
{
return
TaskResult
.
failure
(
'Failed to build flutter iOS app with WatchOS companion in release mode.'
);
}
final
String
appFrameworkPath
=
path
.
join
(
appBundle
,
'Frameworks'
,
'App.framework'
,
'App'
,
);
final
String
flutterFrameworkPath
=
path
.
join
(
appBundle
,
'Frameworks'
,
'Flutter.framework'
,
'Flutter'
,
);
checkDirectoryExists
(
appBundle
);
await
_checkFlutterFrameworkArchs
(
appFrameworkPath
,
isSimulator:
false
);
await
_checkFlutterFrameworkArchs
(
flutterFrameworkPath
,
isSimulator:
false
);
// Check the watch extension framework added in the Podfile
// is in place with the expected watch archs.
final
String
watchExtensionFrameworkPath
=
path
.
join
(
appBundle
,
'Watch'
,
'watch.app'
,
'PlugIns'
,
'watch Extension.appex'
,
'Frameworks'
,
'EFQRCode.framework'
,
'EFQRCode'
,
);
_checkWatchExtensionFrameworkArchs
(
watchExtensionFrameworkPath
);
section
(
'Clean build'
);
await
inDirectory
(
projectDir
,
()
async
{
await
flutter
(
'clean'
);
});
section
(
'Create debug build'
);
...
...
@@ -59,20 +93,18 @@ Future<void> main() async {
);
});
final
bool
appDebugBuilt
=
exists
(
Directory
(
path
.
join
(
projectDir
.
path
,
'build'
,
'ios'
,
'iphoneos'
,
'Runner.app'
,
)));
checkDirectoryExists
(
appBundle
);
await
_checkFlutterFrameworkArchs
(
appFrameworkPath
,
isSimulator:
false
);
await
_checkFlutterFrameworkArchs
(
flutterFrameworkPath
,
isSimulator:
false
);
_checkWatchExtensionFrameworkArchs
(
watchExtensionFrameworkPath
);
if
(!
appDebugBuilt
)
{
return
TaskResult
.
failure
(
'Failed to build flutter iOS app with WatchOS companion in debug mode.'
);
}
section
(
'Clean build'
);
await
inDirectory
(
projectDir
,
()
async
{
await
flutter
(
'clean'
);
});
section
(
'
Create build for a
simulator device'
);
section
(
'
Run app on
simulator device'
);
// Xcode 11.4 simctl create makes the runtime argument optional, and defaults to latest.
// TODO(jmagman): Remove runtime parsing when devicelab upgrades to Xcode 11.4 https://github.com/flutter/flutter/issues/54889
...
...
@@ -160,34 +192,6 @@ Future<void> main() async {
workingDirectory:
flutterDirectory
.
path
,
);
await
inDirectory
(
projectDir
,
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
'ios'
,
'--debug'
,
'--no-codesign'
,
'-d'
,
phoneDeviceID
],
);
});
final
bool
appSimulatorBuilt
=
exists
(
Directory
(
path
.
join
(
projectDir
.
path
,
'build'
,
'ios'
,
'iphoneos'
,
'Runner.app'
,
)));
if
(!
appSimulatorBuilt
)
{
return
TaskResult
.
failure
(
'Failed to build flutter iOS app with WatchOS companion in debug mode for simulated device.'
);
}
section
(
'Run app on simulator device'
);
// Boot simulator devices.
await
eval
(
'xcrun'
,
...
...
@@ -227,9 +231,36 @@ Future<void> main() async {
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
)
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to start flutter iOS app with WatchOS companion on simulated device.'
);
}
final
String
simulatorAppBundle
=
Directory
(
path
.
join
(
projectDir
.
path
,
'build'
,
'ios'
,
'iphonesimulator'
,
'Runner.app'
,
)).
path
;
checkDirectoryExists
(
simulatorAppBundle
);
final
String
simulatorAppFrameworkPath
=
path
.
join
(
simulatorAppBundle
,
'Frameworks'
,
'App.framework'
,
'App'
,
);
final
String
simulatorFlutterFrameworkPath
=
path
.
join
(
simulatorAppBundle
,
'Frameworks'
,
'Flutter.framework'
,
'Flutter'
,
);
await
_checkFlutterFrameworkArchs
(
simulatorAppFrameworkPath
,
isSimulator:
true
);
await
_checkFlutterFrameworkArchs
(
simulatorFlutterFrameworkPath
,
isSimulator:
true
);
return
TaskResult
.
success
(
null
);
}
catch
(
e
)
{
...
...
@@ -268,3 +299,35 @@ Future<void> main() async {
}
});
}
Future
<
void
>
_checkFlutterFrameworkArchs
(
String
frameworkPath
,
{
@required
bool
isSimulator
})
async
{
checkFileExists
(
frameworkPath
);
final
String
archs
=
await
fileType
(
frameworkPath
);
if
(
isSimulator
==
archs
.
contains
(
'armv7'
))
{
throw
TaskResult
.
failure
(
'
$frameworkPath
armv7 architecture unexpected'
);
}
if
(
isSimulator
==
archs
.
contains
(
'arm64'
))
{
throw
TaskResult
.
failure
(
'
$frameworkPath
arm64 architecture unexpected'
);
}
if
(
isSimulator
!=
archs
.
contains
(
'x86_64'
))
{
throw
TaskResult
.
failure
(
'
$frameworkPath
x86_64 architecture unexpected'
);
}
}
Future
<
void
>
_checkWatchExtensionFrameworkArchs
(
String
frameworkPath
)
async
{
checkFileExists
(
frameworkPath
);
final
String
archs
=
await
fileType
(
frameworkPath
);
if
(!
archs
.
contains
(
'armv7k'
))
{
throw
TaskResult
.
failure
(
'
$frameworkPath
armv7k architecture missing'
);
}
if
(!
archs
.
contains
(
'arm64_32'
))
{
throw
TaskResult
.
failure
(
'
$frameworkPath
arm64_32 architecture missing'
);
}
}
dev/integration_tests/ios_app_with_extensions/ios/Flutter/Debug.xcconfig
View file @
ce9cde8c
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
dev/integration_tests/ios_app_with_extensions/ios/Flutter/Release.xcconfig
View file @
ce9cde8c
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
dev/integration_tests/ios_app_with_extensions/ios/Podfile
0 → 100644
View file @
ce9cde8c
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
project
'Runner'
,
{
'Debug'
=>
:debug
,
'Profile'
=>
:release
,
'Release'
=>
:release
,
}
def
flutter_root
generated_xcode_build_settings_path
=
File
.
expand_path
(
File
.
join
(
'..'
,
'Flutter'
,
'Generated.xcconfig'
),
__FILE__
)
unless
File
.
exist?
(
generated_xcode_build_settings_path
)
raise
"
#{
generated_xcode_build_settings_path
}
must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File
.
foreach
(
generated_xcode_build_settings_path
)
do
|
line
|
matches
=
line
.
match
(
/FLUTTER_ROOT\=(.*)/
)
return
matches
[
1
].
strip
if
matches
end
raise
"FLUTTER_ROOT not found in
#{
generated_xcode_build_settings_path
}
. Try deleting Generated.xcconfig, then run flutter pub get"
end
require
File
.
expand_path
(
File
.
join
(
'packages'
,
'flutter_tools'
,
'bin'
,
'podhelper'
),
flutter_root
)
flutter_ios_podfile_setup
target
'Runner'
do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods
File
.
dirname
(
File
.
realpath
(
__FILE__
))
end
target
'watch Extension'
do
platform
:watchos
use_frameworks!
use_modular_headers!
pod
'EFQRCode/watchOS'
,
'5.1.6'
end
dev/integration_tests/ios_app_with_extensions/ios/Runner.xcodeproj/project.pbxproj
View file @
ce9cde8c
This diff is collapsed.
Click to expand it.
dev/integration_tests/ios_app_with_extensions/ios/Runner.xcworkspace/contents.xcworkspacedata
View file @
ce9cde8c
...
...
@@ -4,4 +4,7 @@
<FileRef
location =
"group:Runner.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Pods/Pods.xcodeproj"
>
</FileRef>
</Workspace>
packages/flutter_tools/bin/xcode_backend.sh
View file @
ce9cde8c
...
...
@@ -257,11 +257,10 @@ ThinFramework() {
}
ThinAppFrameworks
()
{
local
app_path
=
"
${
TARGET_BUILD_DIR
}
/
${
WRAPPER_NAME
}
"
local
frameworks_dir
=
"
${
app_path
}
/Frameworks"
local
xcode_frameworks_dir
=
"
${
TARGET_BUILD_DIR
}
/
${
FRAMEWORKS_FOLDER_PATH
}
"
[[
-d
"
$
frameworks_dir
"
]]
||
return
0
find
"
${
app_path
}
"
-type
d
-name
"*.framework"
|
while
read
framework_dir
;
do
[[
-d
"
$
{
xcode_frameworks_dir
}
"
]]
||
return
0
find
"
${
xcode_frameworks_dir
}
"
-type
d
-name
"*.framework"
|
while
read
framework_dir
;
do
ThinFramework
"
$framework_dir
"
"
$ARCHS
"
done
}
...
...
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