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
ba5e237e
Unverified
Commit
ba5e237e
authored
Feb 11, 2021
by
Jenn Magder
Committed by
GitHub
Feb 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid duplicating Pods-Runner xcconfig #includes (#75822)
parent
cc95c972
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+4
-3
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+28
-0
No files found.
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
ba5e237e
...
@@ -274,9 +274,10 @@ class CocoaPods {
...
@@ -274,9 +274,10 @@ class CocoaPods {
final
File
file
=
xcodeProject
.
xcodeConfigFor
(
mode
);
final
File
file
=
xcodeProject
.
xcodeConfigFor
(
mode
);
if
(
file
.
existsSync
())
{
if
(
file
.
existsSync
())
{
final
String
content
=
file
.
readAsStringSync
();
final
String
content
=
file
.
readAsStringSync
();
final
String
include
=
'#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.
${mode
final
String
includeFile
=
'Pods/Target Support Files/Pods-Runner/Pods-Runner.
${mode
.toLowerCase()}
.xcconfig"'
;
.toLowerCase()}
.xcconfig'
;
if
(!
content
.
contains
(
include
))
{
final
String
include
=
'#include? "
$includeFile
"'
;
if
(!
content
.
contains
(
includeFile
))
{
file
.
writeAsStringSync
(
'
$include
\n
$content
'
,
flush:
true
);
file
.
writeAsStringSync
(
'
$include
\n
$content
'
,
flush:
true
);
}
}
}
}
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
ba5e237e
...
@@ -260,6 +260,34 @@ void main() {
...
@@ -260,6 +260,34 @@ void main() {
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
testUsingContext
(
'does not include Pod config in xcconfig files, if legacy non-option include present'
,
()
async
{
projectUnderTest
.
ios
.
podfile
..
createSync
()..
writeAsStringSync
(
'Existing Podfile'
);
const
String
legacyDebugInclude
=
'#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig'
;
projectUnderTest
.
ios
.
xcodeConfigFor
(
'Debug'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
legacyDebugInclude
);
const
String
legacyReleaseInclude
=
'#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig'
;
projectUnderTest
.
ios
.
xcodeConfigFor
(
'Release'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
legacyReleaseInclude
);
final
FlutterProject
project
=
FlutterProject
.
fromPath
(
'project'
);
await
cocoaPodsUnderTest
.
setupPodfile
(
project
.
ios
);
final
String
debugContents
=
projectUnderTest
.
ios
.
xcodeConfigFor
(
'Debug'
).
readAsStringSync
();
// Redundant contains check, but this documents what we're testing--that the optional
// #include? doesn't get written in addition to the previous style #include.
expect
(
debugContents
,
isNot
(
contains
(
'#include?'
)));
expect
(
debugContents
,
equals
(
legacyDebugInclude
));
final
String
releaseContents
=
projectUnderTest
.
ios
.
xcodeConfigFor
(
'Release'
).
readAsStringSync
();
expect
(
releaseContents
,
isNot
(
contains
(
'#include?'
)));
expect
(
releaseContents
,
equals
(
legacyReleaseInclude
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
});
group
(
'Update xcconfig'
,
()
{
group
(
'Update xcconfig'
,
()
{
...
...
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