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
aa7be00d
Unverified
Commit
aa7be00d
authored
Dec 05, 2020
by
Jenn Magder
Committed by
GitHub
Dec 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename IOSMigrator -> ProjectMigrator (#71757)
parent
89ef88c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
23 deletions
+23
-23
project_migrator.dart
packages/flutter_tools/lib/src/base/project_migrator.dart
+10
-10
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+3
-3
project_base_configuration_migration.dart
.../ios/migrations/project_base_configuration_migration.dart
+2
-2
remove_framework_link_and_embedding_migration.dart
...ations/remove_framework_link_and_embedding_migration.dart
+2
-2
xcode_build_system_migration.dart
.../lib/src/ios/migrations/xcode_build_system_migration.dart
+2
-2
ios_project_migration_test.dart
...ls/test/general.shard/ios/ios_project_migration_test.dart
+4
-4
No files found.
packages/flutter_tools/lib/src/
ios/migrations/ios
_migrator.dart
→
packages/flutter_tools/lib/src/
base/project
_migrator.dart
View file @
aa7be00d
...
...
@@ -4,14 +4,14 @@
import
'package:meta/meta.dart'
;
import
'
../../base/
file_system.dart'
;
import
'
../../base/
logger.dart'
;
import
'file_system.dart'
;
import
'logger.dart'
;
///
iOS p
roject is generated from a template on Flutter project creation.
/// Sometimes (due to behavior changes in Xcode,
CocoaPods
, etc) these files need to be altered
///
P
roject is generated from a template on Flutter project creation.
/// Sometimes (due to behavior changes in Xcode,
Gradle
, etc) these files need to be altered
/// from the original template.
abstract
class
IOS
Migrator
{
IOS
Migrator
(
this
.
logger
);
abstract
class
Project
Migrator
{
Project
Migrator
(
this
.
logger
);
@protected
final
Logger
logger
;
...
...
@@ -58,13 +58,13 @@ abstract class IOSMigrator {
}
}
class
IOS
Migration
{
IOS
Migration
(
this
.
migrators
);
class
Project
Migration
{
Project
Migration
(
this
.
migrators
);
final
List
<
IOS
Migrator
>
migrators
;
final
List
<
Project
Migrator
>
migrators
;
bool
run
()
{
for
(
final
IOS
Migrator
migrator
in
migrators
)
{
for
(
final
Project
Migrator
migrator
in
migrators
)
{
if
(!
migrator
.
migrate
())
{
// Migration failures should be more robust, with transactions and fallbacks.
// See https://github.com/flutter/flutter/issues/12573 and
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
aa7be00d
...
...
@@ -12,6 +12,7 @@ import '../base/file_system.dart';
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../base/project_migrator.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../cache.dart'
;
...
...
@@ -23,7 +24,6 @@ import '../project.dart';
import
'../reporting/reporting.dart'
;
import
'code_signing.dart'
;
import
'devices.dart'
;
import
'migrations/ios_migrator.dart'
;
import
'migrations/project_base_configuration_migration.dart'
;
import
'migrations/remove_framework_link_and_embedding_migration.dart'
;
import
'migrations/xcode_build_system_migration.dart'
;
...
...
@@ -102,13 +102,13 @@ Future<XcodeBuildResult> buildXcodeProject({
return
XcodeBuildResult
(
success:
false
);
}
final
List
<
IOSMigrator
>
migrators
=
<
IOS
Migrator
>[
final
List
<
ProjectMigrator
>
migrators
=
<
Project
Migrator
>[
RemoveFrameworkLinkAndEmbeddingMigration
(
app
.
project
,
globals
.
logger
,
globals
.
xcode
,
globals
.
flutterUsage
),
XcodeBuildSystemMigration
(
app
.
project
,
globals
.
logger
),
ProjectBaseConfigurationMigration
(
app
.
project
,
globals
.
logger
),
];
final
IOSMigration
migration
=
IOS
Migration
(
migrators
);
final
ProjectMigration
migration
=
Project
Migration
(
migrators
);
if
(!
migration
.
run
())
{
return
XcodeBuildResult
(
success:
false
);
}
...
...
packages/flutter_tools/lib/src/ios/migrations/project_base_configuration_migration.dart
View file @
aa7be00d
...
...
@@ -4,13 +4,13 @@
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
import
'../../base/project_migrator.dart'
;
import
'../../project.dart'
;
import
'ios_migrator.dart'
;
// The Runner target should inherit its build configuration from Generated.xcconfig.
// However the top-level Runner project should not inherit any build configuration so
// the Flutter build settings do not stomp on non-Flutter targets.
class
ProjectBaseConfigurationMigration
extends
IOS
Migrator
{
class
ProjectBaseConfigurationMigration
extends
Project
Migrator
{
ProjectBaseConfigurationMigration
(
IosProject
project
,
Logger
logger
)
:
_xcodeProjectInfoFile
=
project
.
xcodeProjectInfoFile
,
super
(
logger
);
...
...
packages/flutter_tools/lib/src/ios/migrations/remove_framework_link_and_embedding_migration.dart
View file @
aa7be00d
...
...
@@ -5,15 +5,15 @@
import
'../../base/common.dart'
;
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
import
'../../base/project_migrator.dart'
;
import
'../../macos/xcode.dart'
;
import
'../../project.dart'
;
import
'../../reporting/reporting.dart'
;
import
'ios_migrator.dart'
;
// Xcode 11.4 requires linked and embedded frameworks to contain all targeted architectures before build phases are run.
// This caused issues switching between a real device and simulator due to architecture mismatch.
// Remove the linking and embedding logic from the Xcode project to give the tool more control over these.
class
RemoveFrameworkLinkAndEmbeddingMigration
extends
IOS
Migrator
{
class
RemoveFrameworkLinkAndEmbeddingMigration
extends
Project
Migrator
{
RemoveFrameworkLinkAndEmbeddingMigration
(
IosProject
project
,
Logger
logger
,
...
...
packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart
View file @
aa7be00d
...
...
@@ -4,13 +4,13 @@
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
import
'../../base/project_migrator.dart'
;
import
'../../project.dart'
;
import
'ios_migrator.dart'
;
// Xcode legacy build system no longer supported by Xcode.
// Set in https://github.com/flutter/flutter/pull/21901/.
// Removed in https://github.com/flutter/flutter/pull/33684.
class
XcodeBuildSystemMigration
extends
IOS
Migrator
{
class
XcodeBuildSystemMigration
extends
Project
Migrator
{
XcodeBuildSystemMigration
(
IosProject
project
,
Logger
logger
,
...
...
packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart
View file @
aa7be00d
...
...
@@ -7,7 +7,7 @@ import 'package:file/memory.dart';
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/terminal.dart'
;
import
'package:flutter_tools/src/
ios/migrations/ios
_migrator.dart'
;
import
'package:flutter_tools/src/
base/project
_migrator.dart'
;
import
'package:flutter_tools/src/ios/migrations/project_base_configuration_migration.dart'
;
import
'package:flutter_tools/src/ios/migrations/remove_framework_link_and_embedding_migration.dart'
;
import
'package:flutter_tools/src/ios/migrations/xcode_build_system_migration.dart'
;
...
...
@@ -28,13 +28,13 @@ void main () {
testWithoutContext
(
'migrators succeed'
,
()
{
final
FakeIOSMigrator
fakeIOSMigrator
=
FakeIOSMigrator
(
succeeds:
true
);
final
IOSMigration
migration
=
IOSMigration
(<
IOS
Migrator
>[
fakeIOSMigrator
]);
final
ProjectMigration
migration
=
ProjectMigration
(<
Project
Migrator
>[
fakeIOSMigrator
]);
expect
(
migration
.
run
(),
isTrue
);
});
testWithoutContext
(
'migrators fail'
,
()
{
final
FakeIOSMigrator
fakeIOSMigrator
=
FakeIOSMigrator
(
succeeds:
false
);
final
IOSMigration
migration
=
IOSMigration
(<
IOS
Migrator
>[
fakeIOSMigrator
]);
final
ProjectMigration
migration
=
ProjectMigration
(<
Project
Migrator
>[
fakeIOSMigrator
]);
expect
(
migration
.
run
(),
isFalse
);
});
...
...
@@ -506,7 +506,7 @@ class MockIosProject extends Mock implements IosProject {}
class
MockXcode
extends
Mock
implements
Xcode
{}
class
MockUsage
extends
Mock
implements
Usage
{}
class
FakeIOSMigrator
extends
IOS
Migrator
{
class
FakeIOSMigrator
extends
Project
Migrator
{
FakeIOSMigrator
({
@required
this
.
succeeds
})
:
super
(
null
);
...
...
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