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
d4bfb013
Unverified
Commit
d4bfb013
authored
Apr 12, 2022
by
Jenn Magder
Committed by
GitHub
Apr 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not build for iOS armv7 (#97341)
parent
888208c1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
286 deletions
+50
-286
build_ios_framework_module_test.dart
dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
+10
-16
podhelper.rb
packages/flutter_tools/bin/podhelper.rb
+1
-0
build.dart
packages/flutter_tools/lib/src/base/build.dart
+2
-2
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+1
-4
xcode_build_settings.dart
packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
+3
-1
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+2
-0
build_test.dart
...ges/flutter_tools/test/general.shard/base/build_test.dart
+16
-97
common_test.dart
.../test/general.shard/build_system/targets/common_test.dart
+1
-117
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+13
-48
xcode_backend_test.dart
.../flutter_tools/test/general.shard/xcode_backend_test.dart
+1
-1
No files found.
dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
View file @
d4bfb013
...
...
@@ -138,7 +138,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
'Debug'
,
'App.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'App.framework'
,
'App'
,
);
...
...
@@ -148,7 +148,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
'Debug'
,
'App.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'App.framework'
,
'Info.plist'
,
));
...
...
@@ -173,12 +173,6 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
'app.ios-arm64.symbols'
,
));
checkFileExists
(
path
.
join
(
projectDir
.
path
,
'symbols'
,
'app.ios-armv7.symbols'
,
));
section
(
'Check debug build has no Dart AOT'
);
final
String
aotSymbols
=
await
_dylibSymbols
(
debugAppFrameworkPath
);
...
...
@@ -195,7 +189,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'App.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'App.framework'
,
'App'
,
);
...
...
@@ -212,7 +206,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'App.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'App.framework'
,
'flutter_assets'
,
'vm_snapshot_data'
,
...
...
@@ -294,7 +288,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'connectivity.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'connectivity.framework'
,
'connectivity'
,
);
...
...
@@ -319,7 +313,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'connectivity.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'connectivity.framework'
,
'Headers'
,
'FLTConnectivityPlugin.h'
,
...
...
@@ -330,7 +324,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'connectivity.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'dSYMs'
,
'connectivity.framework.dSYM'
,
));
...
...
@@ -363,7 +357,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
'Release'
,
'connectivity.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'BCSymbolMaps'
,
));
...
...
@@ -377,7 +371,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'FlutterPluginRegistrant.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'FlutterPluginRegistrant.framework'
,
'FlutterPluginRegistrant'
,
);
...
...
@@ -387,7 +381,7 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
outputPath
,
mode
,
'FlutterPluginRegistrant.xcframework'
,
'ios-arm64
_armv7
'
,
'ios-arm64'
,
'FlutterPluginRegistrant.framework'
,
'Headers'
,
'GeneratedPluginRegistrant.h'
,
...
...
packages/flutter_tools/bin/podhelper.rb
View file @
d4bfb013
...
...
@@ -81,6 +81,7 @@ def flutter_additional_ios_build_settings(target)
# Override legacy Xcode 11 style VALID_ARCHS[sdk=iphonesimulator*]=x86_64 and prefer Xcode 12 EXCLUDED_ARCHS.
build_configuration
.
build_settings
[
'VALID_ARCHS[sdk=iphonesimulator*]'
]
=
'$(ARCHS_STANDARD)'
build_configuration
.
build_settings
[
'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
]
=
'$(inherited) i386'
build_configuration
.
build_settings
[
'EXCLUDED_ARCHS[sdk=iphoneos*]'
]
=
'$(inherited) armv7'
end
end
...
...
packages/flutter_tools/lib/src/base/build.dart
View file @
d4bfb013
...
...
@@ -57,6 +57,7 @@ class GenSnapshot {
DarwinArch
?
darwinArch
,
Iterable
<
String
>
additionalArgs
=
const
<
String
>[],
})
{
assert
(
darwinArch
!=
DarwinArch
.
armv7
);
assert
(
snapshotType
.
platform
!=
TargetPlatform
.
ios
||
darwinArch
!=
null
);
final
List
<
String
>
args
=
<
String
>[
...
additionalArgs
,
...
...
@@ -171,9 +172,8 @@ class AOTSnapshotter {
genSnapshotArgs
.
add
(
'--strip'
);
}
if
(
platform
==
TargetPlatform
.
android_arm
||
darwinArch
==
DarwinArch
.
armv7
)
{
if
(
platform
==
TargetPlatform
.
android_arm
)
{
// Use softfp for Android armv7 devices.
// This is the default for armv7 iOS builds, but harmless to set.
// TODO(cbracken): eliminate this when we fix https://github.com/flutter/flutter/issues/17489
genSnapshotArgs
.
add
(
'--no-sim-use-hardfp'
);
...
...
packages/flutter_tools/lib/src/build_info.dart
View file @
d4bfb013
...
...
@@ -546,7 +546,7 @@ enum TargetPlatform {
//
// TODO(cbracken): split TargetPlatform.ios into ios_armv7, ios_arm64.
enum
DarwinArch
{
armv7
,
armv7
,
// Deprecated. Used to display 32-bit unsupported devices.
arm64
,
x86_64
,
}
...
...
@@ -569,7 +569,6 @@ List<DarwinArch> defaultIOSArchsForEnvironment(
];
}
return
<
DarwinArch
>[
DarwinArch
.
armv7
,
DarwinArch
.
arm64
,
];
}
...
...
@@ -922,8 +921,6 @@ const String kFileSystemRoots = 'FileSystemRoots';
///
/// This is expected to be a space-delimited list of architectures. If not
/// provided, defaults to arm64.
///
/// The other supported value is armv7, the 32-bit iOS architecture.
const
String
kIosArchs
=
'IosArchs'
;
/// The define to control what macOS architectures are built for.
...
...
packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
View file @
d4bfb013
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
...
...
@@ -194,7 +195,7 @@ Future<List<String>> _xcodeBuildSettingsLines({
}
}
else
{
if
(
localEngineName
.
endsWith
(
'_arm'
))
{
arch
=
'armv7'
;
throwToolExit
(
'32-bit iOS local engine binaries are not supported.'
)
;
}
else
if
(
localEngineName
.
contains
(
'_arm64'
))
{
arch
=
'arm64'
;
}
else
if
(
localEngineName
.
contains
(
'_sim'
))
{
...
...
@@ -215,6 +216,7 @@ Future<List<String>> _xcodeBuildSettingsLines({
excludedSimulatorArchs
+=
' arm64'
;
}
xcodeBuildSettings
.
add
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=
$excludedSimulatorArchs
'
);
xcodeBuildSettings
.
add
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7'
);
}
for
(
final
MapEntry
<
String
,
String
>
config
in
buildInfo
.
toEnvironmentConfig
().
entries
)
{
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
d4bfb013
...
...
@@ -1177,6 +1177,7 @@ void main() {
expect
(
xcodeConfig
,
contains
(
'FLUTTER_APPLICATION_PATH='
));
expect
(
xcodeConfig
,
contains
(
'FLUTTER_TARGET='
));
expect
(
xcodeConfig
,
contains
(
'COCOAPODS_PARALLEL_CODE_SIGN=true'
));
expect
(
xcodeConfig
,
contains
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7'
));
// Avoid legacy build locations to support Swift Package Manager.
expect
(
xcodeConfig
,
isNot
(
contains
(
'SYMROOT'
)));
...
...
@@ -1279,6 +1280,7 @@ void main() {
expect
(
xcodeConfig
,
contains
(
'FLUTTER_ROOT='
));
expect
(
xcodeConfig
,
contains
(
'FLUTTER_APPLICATION_PATH='
));
expect
(
xcodeConfig
,
contains
(
'COCOAPODS_PARALLEL_CODE_SIGN=true'
));
expect
(
xcodeConfig
,
contains
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7'
));
// Xcode project
final
String
xcodeProjectPath
=
globals
.
fs
.
path
.
join
(
'ios'
,
'Runner.xcodeproj'
,
'project.pbxproj'
);
expectExists
(
xcodeProjectPath
);
...
...
packages/flutter_tools/test/general.shard/base/build_test.dart
View file @
d4bfb013
...
...
@@ -88,24 +88,6 @@ void main() {
expect
(
result
,
0
);
});
testWithoutContext
(
'iOS armv7'
,
()
async
{
processManager
.
addCommand
(
FakeCommand
(
command:
<
String
>[
'
${artifacts.getArtifactPath(Artifact.genSnapshot, platform: TargetPlatform.ios, mode: BuildMode.release)}
_armv7'
,
'--additional_arg'
],
),
);
final
int
result
=
await
genSnapshot
.
run
(
snapshotType:
SnapshotType
(
TargetPlatform
.
ios
,
BuildMode
.
release
),
darwinArch:
DarwinArch
.
armv7
,
additionalArgs:
<
String
>[
'--additional_arg'
],
);
expect
(
result
,
0
);
});
testWithoutContext
(
'iOS arm64'
,
()
async
{
final
String
genSnapshotPath
=
artifacts
.
getArtifactPath
(
Artifact
.
genSnapshot
,
...
...
@@ -224,13 +206,11 @@ void main() {
);
processManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'
${genSnapshotPath}
_arm
v7
'
,
'
${genSnapshotPath}
_arm
64
'
,
'--deterministic'
,
'--snapshot_kind=app-aot-assembly'
,
'--assembly=
$assembly
'
,
'--strip'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'main.dill'
,
]),
kWhichSysctlCommand
,
...
...
@@ -239,7 +219,7 @@ void main() {
'xcrun'
,
'cc'
,
'-arch'
,
'arm
v7
'
,
'arm
64
'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/sdk'
,
...
...
@@ -253,7 +233,7 @@ void main() {
'xcrun'
,
'clang'
,
'-arch'
,
'arm
v7
'
,
'arm
64
'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/sdk'
,
...
...
@@ -280,7 +260,7 @@ void main() {
buildMode:
BuildMode
.
profile
,
mainPath:
'main.dill'
,
outputPath:
outputPath
,
darwinArch:
DarwinArch
.
arm
v7
,
darwinArch:
DarwinArch
.
arm
64
,
sdkRoot:
'path/to/sdk'
,
bitcode:
true
,
dartObfuscation:
false
,
...
...
@@ -290,10 +270,10 @@ void main() {
expect
(
processManager
,
hasNoRemainingExpectations
);
});
testWithoutContext
(
'builds iOS
armv7 snapshot with dwar
StackTraces'
,
()
async
{
testWithoutContext
(
'builds iOS
snapshot with dwarf
StackTraces'
,
()
async
{
final
String
outputPath
=
fileSystem
.
path
.
join
(
'build'
,
'foo'
);
final
String
assembly
=
fileSystem
.
path
.
join
(
outputPath
,
'snapshot_assembly.S'
);
final
String
debugPath
=
fileSystem
.
path
.
join
(
'foo'
,
'app.ios-arm
v7
.symbols'
);
final
String
debugPath
=
fileSystem
.
path
.
join
(
'foo'
,
'app.ios-arm
64
.symbols'
);
final
String
genSnapshotPath
=
artifacts
.
getArtifactPath
(
Artifact
.
genSnapshot
,
platform:
TargetPlatform
.
ios
,
...
...
@@ -301,13 +281,11 @@ void main() {
);
processManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'
${genSnapshotPath}
_arm
v7
'
,
'
${genSnapshotPath}
_arm
64
'
,
'--deterministic'
,
'--snapshot_kind=app-aot-assembly'
,
'--assembly=
$assembly
'
,
'--strip'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'--dwarf-stack-traces'
,
'--save-debugging-info=
$debugPath
'
,
'main.dill'
,
...
...
@@ -318,7 +296,7 @@ void main() {
'xcrun'
,
'cc'
,
'-arch'
,
'arm
v7
'
,
'arm
64
'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/sdk'
,
...
...
@@ -331,7 +309,7 @@ void main() {
'xcrun'
,
'clang'
,
'-arch'
,
'arm
v7
'
,
'arm
64
'
,
...
kDefaultClang
,
]),
]);
...
...
@@ -341,7 +319,7 @@ void main() {
buildMode:
BuildMode
.
profile
,
mainPath:
'main.dill'
,
outputPath:
outputPath
,
darwinArch:
DarwinArch
.
arm
v7
,
darwinArch:
DarwinArch
.
arm
64
,
sdkRoot:
'path/to/sdk'
,
bitcode:
false
,
splitDebugInfo:
'foo'
,
...
...
@@ -352,7 +330,7 @@ void main() {
expect
(
processManager
,
hasNoRemainingExpectations
);
});
testWithoutContext
(
'builds iOS
armv7
snapshot with obfuscate'
,
()
async
{
testWithoutContext
(
'builds iOS snapshot with obfuscate'
,
()
async
{
final
String
outputPath
=
fileSystem
.
path
.
join
(
'build'
,
'foo'
);
final
String
assembly
=
fileSystem
.
path
.
join
(
outputPath
,
'snapshot_assembly.S'
);
final
String
genSnapshotPath
=
artifacts
.
getArtifactPath
(
...
...
@@ -362,13 +340,11 @@ void main() {
);
processManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'
${genSnapshotPath}
_arm
v7
'
,
'
${genSnapshotPath}
_arm
64
'
,
'--deterministic'
,
'--snapshot_kind=app-aot-assembly'
,
'--assembly=
$assembly
'
,
'--strip'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'--obfuscate'
,
'main.dill'
,
]),
...
...
@@ -378,7 +354,7 @@ void main() {
'xcrun'
,
'cc'
,
'-arch'
,
'arm
v7
'
,
'arm
64
'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/sdk'
,
...
...
@@ -391,7 +367,7 @@ void main() {
'xcrun'
,
'clang'
,
'-arch'
,
'arm
v7
'
,
'arm
64
'
,
...
kDefaultClang
,
]),
]);
...
...
@@ -401,7 +377,7 @@ void main() {
buildMode:
BuildMode
.
profile
,
mainPath:
'main.dill'
,
outputPath:
outputPath
,
darwinArch:
DarwinArch
.
arm
v7
,
darwinArch:
DarwinArch
.
arm
64
,
sdkRoot:
'path/to/sdk'
,
bitcode:
false
,
dartObfuscation:
true
,
...
...
@@ -411,64 +387,7 @@ void main() {
expect
(
processManager
,
hasNoRemainingExpectations
);
});
testWithoutContext
(
'builds iOS armv7 snapshot'
,
()
async
{
final
String
outputPath
=
fileSystem
.
path
.
join
(
'build'
,
'foo'
);
final
String
genSnapshotPath
=
artifacts
.
getArtifactPath
(
Artifact
.
genSnapshot
,
platform:
TargetPlatform
.
ios
,
mode:
BuildMode
.
release
,
);
processManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
'
${genSnapshotPath}
_armv7'
,
'--deterministic'
,
'--snapshot_kind=app-aot-assembly'
,
'--assembly=
${fileSystem.path.join(outputPath, 'snapshot_assembly.S')}
'
,
'--strip'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'main.dill'
,
]),
kWhichSysctlCommand
,
kARMCheckCommand
,
const
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'cc'
,
'-arch'
,
'armv7'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/sdk'
,
'-c'
,
'build/foo/snapshot_assembly.S'
,
'-o'
,
'build/foo/snapshot_assembly.o'
,
]),
const
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'clang'
,
'-arch'
,
'armv7'
,
...
kDefaultClang
,
]),
]);
final
int
genSnapshotExitCode
=
await
snapshotter
.
build
(
platform:
TargetPlatform
.
ios
,
buildMode:
BuildMode
.
release
,
mainPath:
'main.dill'
,
outputPath:
outputPath
,
darwinArch:
DarwinArch
.
armv7
,
sdkRoot:
'path/to/sdk'
,
bitcode:
false
,
dartObfuscation:
false
,
);
expect
(
genSnapshotExitCode
,
0
);
expect
(
processManager
,
hasNoRemainingExpectations
);
});
testWithoutContext
(
'builds iOS arm64 snapshot'
,
()
async
{
testWithoutContext
(
'builds iOS snapshot'
,
()
async
{
final
String
outputPath
=
fileSystem
.
path
.
join
(
'build'
,
'foo'
);
final
String
genSnapshotPath
=
artifacts
.
getArtifactPath
(
Artifact
.
genSnapshot
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart
View file @
d4bfb013
...
...
@@ -451,123 +451,7 @@ void main() {
ProcessManager:
()
=>
processManager
,
});
testUsingContext
(
'AotAssemblyProfile generates multiple arches and lipos together'
,
()
async
{
final
String
build
=
iosEnvironment
.
buildDir
.
path
;
processManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
// This path is not known by the cache due to the iOS gen_snapshot split.
'Artifact.genSnapshot.TargetPlatform.ios.profile_armv7'
,
'--deterministic'
,
kAssemblyAot
,
'--assembly=
$build
/armv7/snapshot_assembly.S'
,
'--strip'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'
$build
/app.dill'
,
]),
FakeCommand
(
command:
<
String
>[
// This path is not known by the cache due to the iOS gen_snapshot split.
'Artifact.genSnapshot.TargetPlatform.ios.profile_arm64'
,
'--deterministic'
,
kAssemblyAot
,
'--assembly=
$build
/arm64/snapshot_assembly.S'
,
'--strip'
,
'
$build
/app.dill'
,
]),
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'cc'
,
'-arch'
,
'armv7'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/iPhoneOS.sdk'
,
'-c'
,
'
$build
/armv7/snapshot_assembly.S'
,
'-o'
,
'
$build
/armv7/snapshot_assembly.o'
,
]),
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'cc'
,
'-arch'
,
'arm64'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/iPhoneOS.sdk'
,
'-c'
,
'
$build
/arm64/snapshot_assembly.S'
,
'-o'
,
'
$build
/arm64/snapshot_assembly.o'
,
]),
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'clang'
,
'-arch'
,
'armv7'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/iPhoneOS.sdk'
,
'-dynamiclib'
,
'-Xlinker'
,
'-rpath'
,
'-Xlinker'
,
'@executable_path/Frameworks'
,
'-Xlinker'
,
'-rpath'
,
'-Xlinker'
,
'@loader_path/Frameworks'
,
'-install_name'
,
'@rpath/App.framework/App'
,
'-o'
,
'
$build
/armv7/App.framework/App'
,
'
$build
/armv7/snapshot_assembly.o'
,
]),
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'clang'
,
'-arch'
,
'arm64'
,
'-miphoneos-version-min=9.0'
,
'-isysroot'
,
'path/to/iPhoneOS.sdk'
,
'-dynamiclib'
,
'-Xlinker'
,
'-rpath'
,
'-Xlinker'
,
'@executable_path/Frameworks'
,
'-Xlinker'
,
'-rpath'
,
'-Xlinker'
,
'@loader_path/Frameworks'
,
'-install_name'
,
'@rpath/App.framework/App'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/snapshot_assembly.o'
,
]),
FakeCommand
(
command:
<
String
>[
'lipo'
,
'
$build
/armv7/App.framework/App'
,
'
$build
/arm64/App.framework/App'
,
'-create'
,
'-output'
,
'
$build
/App.framework/App'
,
]),
]);
iosEnvironment
.
defines
[
kIosArchs
]
=
'armv7 arm64'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/iPhoneOS.sdk'
;
await
const
AotAssemblyProfile
().
build
(
iosEnvironment
);
expect
(
processManager
,
hasNoRemainingExpectations
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
macPlatform
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
});
testUsingContext
(
'AotAssemblyProfile with bitcode sends correct argument to snapshotter (one arch)'
,
()
async
{
testUsingContext
(
'AotAssemblyProfile with bitcode sends correct argument to snapshotter'
,
()
async
{
iosEnvironment
.
defines
[
kIosArchs
]
=
'arm64'
;
iosEnvironment
.
defines
[
kBitcodeFlag
]
=
'true'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/iPhoneOS.sdk'
;
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
d4bfb013
...
...
@@ -683,7 +683,7 @@ Information about project "Runner":
setUp
(()
{
fs
=
MemoryFileSystem
.
test
();
localIosArtifacts
=
Artifacts
.
test
(
localEngine:
'out/ios_profile_arm'
);
localIosArtifacts
=
Artifacts
.
test
(
localEngine:
'out/ios_profile_arm
64
'
);
macOS
=
FakePlatform
(
operatingSystem:
'macos'
);
fs
.
file
(
xcodebuild
).
createSync
(
recursive:
true
);
});
...
...
@@ -744,6 +744,7 @@ Build settings for action build and target plugin2:
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
\n
'
));
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
\n
'
));
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
localIosArtifacts
,
...
...
@@ -788,6 +789,7 @@ Build settings for action build and target plugin2:
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64
\n
'
));
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
\n
'
));
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
localIosArtifacts
,
...
...
@@ -844,6 +846,7 @@ Build settings for action build and target plugin2:
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64
\n
'
));
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
\n
'
));
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
localIosArtifacts
,
...
...
@@ -863,27 +866,17 @@ Build settings for action build and target plugin2:
});
}
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local iOS engine is set'
,
()
async
{
testUsingOsxContext
(
'exits when armv7 local engine is set'
,
()
async
{
localIosArtifacts
=
Artifacts
.
test
(
localEngine:
'out/ios_profile_arm'
);
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
final
FlutterProject
project
=
FlutterProject
.
fromDirectoryTest
(
fs
.
directory
(
'path/to/project'
));
await
updateGeneratedXcodeProperties
(
project:
project
,
buildInfo:
buildInfo
,
await
expectLater
(()
=>
updateGeneratedXcodeProperties
(
project:
project
,
buildInfo:
buildInfo
,
),
throwsToolExit
(
message:
'32-bit iOS local engine binaries are not supported.'
),
);
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=armv7'
),
isTrue
);
expect
(
contents
.
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386'
),
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=armv7'
),
isTrue
);
expect
(
buildPhaseScriptContents
.
contains
(
'EXCLUDED_ARCHS'
),
isFalse
);
});
testUsingContext
(
'sets ARCHS=arm64 when arm64 local host engine is set'
,
()
async
{
...
...
@@ -950,6 +943,7 @@ Build settings for action build and target plugin2:
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
\n
'
));
expect
(
config
.
readAsStringSync
(),
contains
(
'EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
\n
'
));
final
File
buildPhaseScript
=
fs
.
file
(
'path/to/project/ios/Flutter/flutter_export_environment.sh'
);
expect
(
buildPhaseScript
.
readAsStringSync
(),
isNot
(
contains
(
'EXCLUDED_ARCHS'
)));
...
...
@@ -1051,35 +1045,6 @@ Build settings for action build and target plugin2:
});
});
group
(
'armv7 local engine'
,
()
{
Artifacts
localArtifacts
;
setUp
(()
{
localArtifacts
=
Artifacts
.
test
(
localEngine:
'out/ios_profile'
);
});
testUsingContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
final
FlutterProject
project
=
FlutterProject
.
fromDirectoryTest
(
fs
.
directory
(
'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=arm64'
),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
localArtifacts
,
Platform:
()
=>
macOS
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
String
propertyFor
(
String
key
,
File
file
)
{
final
List
<
String
>
properties
=
file
.
readAsLinesSync
()
...
...
packages/flutter_tools/test/general.shard/xcode_backend_test.dart
View file @
d4bfb013
...
...
@@ -130,7 +130,7 @@ void main() {
..
createSync
(
recursive:
true
);
final
Directory
flutterRoot
=
fileSystem
.
directory
(
'/path/to/flutter'
)
..
createSync
(
recursive:
true
);
const
String
archs
=
'arm64
armv7
'
;
const
String
archs
=
'arm64'
;
const
String
buildMode
=
'Release'
;
const
String
dartObfuscation
=
'false'
;
const
String
dartDefines
=
'flutter.inspector.structuredErrors%3Dtrue'
;
...
...
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