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
3082a280
Unverified
Commit
3082a280
authored
Jan 06, 2021
by
Jenn Magder
Committed by
GitHub
Jan 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build ios-framework simulator slices for profile/release (#73378)
parent
e21d8220
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
61 deletions
+57
-61
build_ios_framework_module_test.dart
dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
+15
-15
ios.dart
dev/devicelab/lib/framework/ios.dart
+0
-4
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+42
-42
No files found.
dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
View file @
3082a280
...
...
@@ -191,7 +191,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
section
(
'Check debug build has no Dart AOT'
);
final
String
aotSymbols
=
await
dylibSymbols
(
debugAppFrameworkPath
);
final
String
aotSymbols
=
await
_
dylibSymbols
(
debugAppFrameworkPath
);
if
(
aotSymbols
.
contains
(
'architecture'
)
||
aotSymbols
.
contains
(
'_kDartVmSnapshot'
))
{
...
...
@@ -212,7 +212,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
await
_checkBitcode
(
appFrameworkPath
,
mode
);
final
String
aotSymbols
=
await
dylibSymbols
(
appFrameworkPath
);
final
String
aotSymbols
=
await
_
dylibSymbols
(
appFrameworkPath
);
if
(!
aotSymbols
.
contains
(
'_kDartVmSnapshot'
))
{
throw
TaskResult
.
failure
(
'
$mode
App.framework missing Dart AOT'
);
...
...
@@ -228,7 +228,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
'vm_snapshot_data'
,
));
checkFile
Not
Exists
(
path
.
join
(
checkFileExists
(
path
.
join
(
outputPath
,
mode
,
'App.xcframework'
,
...
...
@@ -314,13 +314,8 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
'DeviceInfoPlugin.h'
,
);
if
(
mode
==
'Debug'
)
{
checkFileExists
(
simulatorFrameworkPath
);
checkFileExists
(
simulatorFrameworkHeaderPath
);
}
else
{
checkFileNotExists
(
simulatorFrameworkPath
);
checkFileNotExists
(
simulatorFrameworkHeaderPath
);
}
checkFileExists
(
simulatorFrameworkPath
);
checkFileExists
(
simulatorFrameworkHeaderPath
);
}
section
(
'Check all modes have generated plugin registrant'
);
...
...
@@ -357,11 +352,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
'Headers'
,
'GeneratedPluginRegistrant.h'
,
);
if
(
mode
==
'Debug'
)
{
checkFileExists
(
simulatorHeaderPath
);
}
else
{
checkFileNotExists
(
simulatorHeaderPath
);
}
checkFileExists
(
simulatorHeaderPath
);
}
// This builds all build modes' frameworks by default
...
...
@@ -443,3 +434,12 @@ Future<void> _checkBitcode(String frameworkPath, String mode) async {
throw
TaskResult
.
failure
(
'
$frameworkPath
does not contain bitcode'
);
}
}
Future
<
String
>
_dylibSymbols
(
String
pathToDylib
)
{
return
eval
(
'nm'
,
<
String
>[
'-g'
,
pathToDylib
,
'-arch'
,
'arm64'
,
]);
}
dev/devicelab/lib/framework/ios.dart
View file @
3082a280
...
...
@@ -10,10 +10,6 @@ import 'utils.dart';
typedef
SimulatorFunction
=
Future
<
void
>
Function
(
String
deviceId
);
Future
<
String
>
dylibSymbols
(
String
pathToDylib
)
{
return
eval
(
'nm'
,
<
String
>[
'-g'
,
pathToDylib
]);
}
Future
<
String
>
fileType
(
String
pathToBinary
)
{
return
eval
(
'file'
,
<
String
>[
pathToBinary
]);
}
...
...
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
3082a280
...
...
@@ -342,17 +342,9 @@ end
);
final List<EnvironmentType> environmentTypes = <EnvironmentType>[
EnvironmentType.physical,
EnvironmentType.simulator,
];
final List<Directory> frameworks = <Directory>[];
Target target;
if (buildInfo.isDebug) {
environmentTypes.add(EnvironmentType.simulator);
target = const DebugIosApplicationBundle();
} else if (buildInfo.isProfile) {
target = const ProfileIosApplicationBundle();
} else {
target = const ReleaseIosApplicationBundle();
}
try {
for (final EnvironmentType sdkType in environmentTypes) {
...
...
@@ -392,6 +384,15 @@ end
? null
: globals.flutterVersion.engineRevision,
);
Target target;
// Always build debug for simulator.
if (buildInfo.isDebug || sdkType == EnvironmentType.simulator) {
target = const DebugIosApplicationBundle();
} else if (buildInfo.isProfile) {
target = const ProfileIosApplicationBundle();
} else {
target = const ReleaseIosApplicationBundle();
}
final BuildResult result = await buildSystem.build(target, environment);
if (!result.success) {
for (final ExceptionMeasurement measurement
...
...
@@ -453,42 +454,42 @@ end
throwToolExit('
Unable
to
build
plugin
frameworks:
$
{
buildPluginsResult
.
stderr
}
');
}
if (mode == BuildMode.debug) {
pluginsBuildCommand = <String>[
...globals.xcode.xcrunCommand(),
'
xcodebuild
',
'
-
alltargets
',
'
-
sdk
',
'
iphonesimulator
',
'
-
configuration
',
xcodeBuildConfiguration,
'
SYMROOT
=
$
{
simulatorBuildOutput
.
path
}
',
'
ENABLE_BITCODE
=
YES
', // Support host apps with bitcode enabled.
'
ARCHS
=
x86_64
',
'
ONLY_ACTIVE_ARCH
=
NO
', // No device targeted, so build all valid architectures.
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
];
buildPluginsResult = await globals.processUtils.run(
pluginsBuildCommand,
workingDirectory: _project.ios.hostAppRoot
.childDirectory('
Pods
')
.path,
allowReentrantFlutter: false,
);
// Always build debug for simulator.
final String simulatorConfiguration = toTitleCase(getNameForBuildMode(BuildMode.debug));
pluginsBuildCommand = <String>[
...globals.xcode.xcrunCommand(),
'
xcodebuild
',
'
-
alltargets
',
'
-
sdk
',
'
iphonesimulator
',
'
-
configuration
',
simulatorConfiguration,
'
SYMROOT
=
$
{
simulatorBuildOutput
.
path
}
',
'
ENABLE_BITCODE
=
YES
', // Support host apps with bitcode enabled.
'
ARCHS
=
x86_64
',
'
ONLY_ACTIVE_ARCH
=
NO
', // No device targeted, so build all valid architectures.
'
BUILD_LIBRARY_FOR_DISTRIBUTION
=
YES
',
];
if (buildPluginsResult.exitCode != 0) {
throwToolExit(
'
Unable
to
build
plugin
frameworks
for
simulator:
$
{
buildPluginsResult
.
stderr
}
',
);
}
buildPluginsResult = await globals.processUtils.run(
pluginsBuildCommand,
workingDirectory: _project.ios.hostAppRoot
.childDirectory('
Pods
')
.path,
allowReentrantFlutter: false,
);
if (buildPluginsResult.exitCode != 0) {
throwToolExit(
'
Unable
to
build
plugin
frameworks
for
simulator:
$
{
buildPluginsResult
.
stderr
}
',
);
}
final Directory iPhoneBuildConfiguration = iPhoneBuildOutput.childDirectory(
'
$xcodeBuildConfiguration
-
iphoneos
',
);
final Directory simulatorBuildConfiguration = simulatorBuildOutput.childDirectory(
'
$
xcodeBuild
Configuration
-
iphonesimulator
',
'
$
simulator
Configuration
-
iphonesimulator
',
);
final Iterable<Directory> products = iPhoneBuildConfiguration
...
...
@@ -504,10 +505,9 @@ end
final List<Directory> frameworks = <Directory>[
podProduct as Directory,
if (mode == BuildMode.debug)
simulatorBuildConfiguration
.childDirectory(builtProduct.basename)
.childDirectory(podFrameworkName)
simulatorBuildConfiguration
.childDirectory(builtProduct.basename)
.childDirectory(podFrameworkName)
];
await _produceXCFramework(frameworks, binaryName, modeDirectory);
...
...
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