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
3477df74
Unverified
Commit
3477df74
authored
Jun 03, 2021
by
Jenn Magder
Committed by
GitHub
Jun 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate iOS project migrations to null safety (#83855)
parent
14f00790
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
37 deletions
+26
-37
project_migrator.dart
packages/flutter_tools/lib/src/base/project_migrator.dart
+2
-2
project_base_configuration_migration.dart
.../ios/migrations/project_base_configuration_migration.dart
+1
-3
project_build_location_migration.dart
.../src/ios/migrations/project_build_location_migration.dart
+0
-2
remove_framework_link_and_embedding_migration.dart
...ations/remove_framework_link_and_embedding_migration.dart
+1
-3
xcode_build_system_migration.dart
.../lib/src/ios/migrations/xcode_build_system_migration.dart
+0
-2
ios_project_migration_test.dart
...ls/test/general.shard/ios/ios_project_migration_test.dart
+22
-25
No files found.
packages/flutter_tools/lib/src/base/project_migrator.dart
View file @
3477df74
...
...
@@ -21,7 +21,7 @@ abstract class ProjectMigrator {
/// Return null if the line should be deleted.
@protected
String
migrateLine
(
String
line
)
{
String
?
migrateLine
(
String
line
)
{
return
line
;
}
...
...
@@ -41,7 +41,7 @@ abstract class ProjectMigrator {
bool
migrationRequired
=
false
;
for
(
final
String
line
in
lines
)
{
final
String
newProjectLine
=
migrateLine
(
line
);
final
String
?
newProjectLine
=
migrateLine
(
line
);
if
(
newProjectLine
==
null
)
{
logger
.
printTrace
(
'Migrating
$basename
, removing:'
);
logger
.
printTrace
(
'
$line
'
);
...
...
packages/flutter_tools/lib/src/ios/migrations/project_base_configuration_migration.dart
View file @
3477df74
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
import
'../../base/project_migrator.dart'
;
...
...
@@ -41,7 +39,7 @@ class ProjectBaseConfigurationMigration extends ProjectMigrator {
multiLine:
true
,
);
final
RegExpMatch
match
=
projectBuildConfigurationList
.
firstMatch
(
originalProjectContents
);
final
RegExpMatch
?
match
=
projectBuildConfigurationList
.
firstMatch
(
originalProjectContents
);
// If the PBXProject "Runner" build configuration identifiers can't be parsed, default to the generated template identifiers.
final
String
debugIdentifier
=
match
?.
group
(
1
)
??
'97C147031CF9000F007C117D'
;
...
...
packages/flutter_tools/lib/src/ios/migrations/project_build_location_migration.dart
View file @
3477df74
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
import
'../../base/project_migrator.dart'
;
...
...
packages/flutter_tools/lib/src/ios/migrations/remove_framework_link_and_embedding_migration.dart
View file @
3477df74
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'../../base/common.dart'
;
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
...
...
@@ -39,7 +37,7 @@ class RemoveFrameworkLinkAndEmbeddingMigration extends ProjectMigrator {
}
@override
String
migrateLine
(
String
line
)
{
String
?
migrateLine
(
String
line
)
{
// App.framework Frameworks reference.
// isa = PBXFrameworksBuildPhase;
// files = (
...
...
packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart
View file @
3477df74
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'../../base/file_system.dart'
;
import
'../../base/logger.dart'
;
import
'../../base/project_migrator.dart'
;
...
...
packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart
View file @
3477df74
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
...
@@ -14,14 +12,13 @@ import 'package:flutter_tools/src/ios/migrations/remove_framework_link_and_embed
import
'package:flutter_tools/src/ios/migrations/xcode_build_system_migration.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:meta/meta.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
void
main
(
)
{
group
(
'iOS migration'
,
()
{
TestUsage
testUsage
;
late
TestUsage
testUsage
;
setUp
(()
{
testUsage
=
TestUsage
();
...
...
@@ -40,10 +37,10 @@ void main () {
});
group
(
'remove framework linking and embedding migration'
,
()
{
MemoryFileSystem
memoryFileSystem
;
BufferLogger
testLogger
;
FakeIosProject
project
;
File
xcodeProjectInfoFile
;
late
MemoryFileSystem
memoryFileSystem
;
late
BufferLogger
testLogger
;
late
FakeIosProject
project
;
late
File
xcodeProjectInfoFile
;
setUp
(()
{
memoryFileSystem
=
MemoryFileSystem
.
test
();
...
...
@@ -187,10 +184,10 @@ keep this 2
});
group
(
'new Xcode build system'
,
()
{
MemoryFileSystem
memoryFileSystem
;
BufferLogger
testLogger
;
FakeIosProject
project
;
File
xcodeWorkspaceSharedSettings
;
late
MemoryFileSystem
memoryFileSystem
;
late
BufferLogger
testLogger
;
late
FakeIosProject
project
;
late
File
xcodeWorkspaceSharedSettings
;
setUp
(()
{
memoryFileSystem
=
MemoryFileSystem
.
test
();
...
...
@@ -259,10 +256,10 @@ keep this 2
});
group
(
'Xcode default build location'
,
()
{
MemoryFileSystem
memoryFileSystem
;
BufferLogger
testLogger
;
FakeIosProject
project
;
File
xcodeProjectWorkspaceData
;
late
MemoryFileSystem
memoryFileSystem
;
late
BufferLogger
testLogger
;
late
FakeIosProject
project
;
late
File
xcodeProjectWorkspaceData
;
setUp
(()
{
memoryFileSystem
=
MemoryFileSystem
();
...
...
@@ -338,10 +335,10 @@ keep this 2
});
group
(
'remove Runner project base configuration'
,
()
{
MemoryFileSystem
memoryFileSystem
;
BufferLogger
testLogger
;
FakeIosProject
project
;
File
xcodeProjectInfoFile
;
late
MemoryFileSystem
memoryFileSystem
;
late
BufferLogger
testLogger
;
late
FakeIosProject
project
;
late
File
xcodeProjectInfoFile
;
setUp
(()
{
memoryFileSystem
=
MemoryFileSystem
();
...
...
@@ -495,18 +492,18 @@ keep this 3
class
FakeIosProject
extends
Fake
implements
IosProject
{
@override
File
xcodeProjectWorkspaceData
;
File
xcodeProjectWorkspaceData
=
MemoryFileSystem
.
test
().
file
(
'xcodeProjectWorkspaceData'
)
;
@override
File
xcodeWorkspaceSharedSettings
;
File
xcodeWorkspaceSharedSettings
=
MemoryFileSystem
.
test
().
file
(
'xcodeWorkspaceSharedSettings'
)
;
@override
File
xcodeProjectInfoFile
;
File
xcodeProjectInfoFile
=
MemoryFileSystem
.
test
().
file
(
'xcodeProjectInfoFile'
)
;
}
class
FakeIOSMigrator
extends
ProjectMigrator
{
FakeIOSMigrator
({
@
required
this
.
succeeds
})
:
super
(
null
);
FakeIOSMigrator
({
required
this
.
succeeds
})
:
super
(
BufferLogger
.
test
()
);
final
bool
succeeds
;
...
...
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