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
17edb9aa
Unverified
Commit
17edb9aa
authored
Jan 15, 2021
by
Jenn Magder
Committed by
GitHub
Jan 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build x86_64 iOS apps with simulator local engines (#74003)
parent
8aeef71e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+12
-2
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+28
-0
No files found.
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
17edb9aa
...
...
@@ -191,7 +191,9 @@ List<String> _xcodeBuildSettingsLines({
final
LocalEngineArtifacts
localEngineArtifacts
=
globals
.
artifacts
as
LocalEngineArtifacts
;
final
String
engineOutPath
=
localEngineArtifacts
.
engineOutPath
;
xcodeBuildSettings
.
add
(
'FLUTTER_ENGINE=
${globals.fs.path.dirname(globals.fs.path.dirname(engineOutPath))}
'
);
xcodeBuildSettings
.
add
(
'LOCAL_ENGINE=
${globals.fs.path.basename(engineOutPath)}
'
);
final
String
localEngineName
=
globals
.
fs
.
path
.
basename
(
engineOutPath
);
xcodeBuildSettings
.
add
(
'LOCAL_ENGINE=
$localEngineName
'
);
// Tell Xcode not to build universal binaries for local engines, which are
// single-architecture.
...
...
@@ -202,7 +204,15 @@ List<String> _xcodeBuildSettingsLines({
//
// Skip this step for macOS builds.
if
(!
useMacOSConfig
)
{
final
String
arch
=
engineOutPath
.
endsWith
(
'_arm'
)
?
'armv7'
:
'arm64'
;
String
arch
;
if
(
localEngineName
.
endsWith
(
'_arm'
))
{
arch
=
'armv7'
;
}
else
if
(
localEngineName
.
contains
(
'_sim'
))
{
// Apple Silicon ARM simulators not yet supported.
arch
=
'x86_64'
;
}
else
{
arch
=
'arm64'
;
}
xcodeBuildSettings
.
add
(
'ARCHS=
$arch
'
);
}
}
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
17edb9aa
...
...
@@ -691,6 +691,34 @@ Information about project "Runner":
expect
(
buildPhaseScriptContents
.
contains
(
'ARCHS=armv7'
),
isTrue
);
});
testUsingOsxContext
(
'sets ARCHS=x86_64 when sim local engine is set'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
platform:
TargetPlatform
.
ios
,
mode:
anyNamed
(
'mode'
),
environmentType:
anyNamed
(
'environmentType'
)))
.
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_debug_sim_unopt'
));
const
BuildInfo
buildInfo
=
BuildInfo
(
BuildMode
.
debug
,
null
,
treeShakeIcons:
false
);
final
FlutterProject
project
=
FlutterProject
.
fromPath
(
'path/to/project'
);
await
updateGeneratedXcodeProperties
(
project:
project
,
buildInfo:
buildInfo
,
);
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
existsSync
(),
isTrue
);
final
String
contents
=
config
.
readAsStringSync
();
expect
(
contents
.
contains
(
'ARCHS=x86_64'
),
isTrue
);
final
File
buildPhaseScript
=
fs
.
file
(
'path/to/project/ios/Flutter/flutter_export_environment.sh'
);
expect
(
buildPhaseScript
.
existsSync
(),
isTrue
);
final
String
buildPhaseScriptContents
=
buildPhaseScript
.
readAsStringSync
();
expect
(
buildPhaseScriptContents
.
contains
(
'ARCHS=x86_64'
),
isTrue
);
});
testUsingOsxContext
(
'sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
platform:
TargetPlatform
.
ios
,
...
...
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