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
08128cb2
Unverified
Commit
08128cb2
authored
Dec 13, 2017
by
Sarah Zakarias
Committed by
GitHub
Dec 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade project.pbxproj to include flutter_assets (#13011)
parent
3af6b9cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+53
-0
No files found.
packages/flutter_tools/lib/src/ios/mac.dart
View file @
08128cb2
...
...
@@ -206,6 +206,9 @@ Future<XcodeBuildResult> buildXcodeProject({
bool
codesign:
true
,
bool
usesTerminalUi:
true
,
})
async
{
if
(!
await
upgradePbxProjWithFlutterAssets
(
app
.
name
))
return
new
XcodeBuildResult
(
success:
false
);
if
(!
_checkXcodeVersion
())
return
new
XcodeBuildResult
(
success:
false
);
...
...
@@ -492,3 +495,53 @@ void _copyServiceDefinitionsManifest(List<Map<String, String>> services, File ma
final
Map
<
String
,
dynamic
>
json
=
<
String
,
dynamic
>{
'services'
:
jsonServices
};
manifest
.
writeAsStringSync
(
JSON
.
encode
(
json
),
mode:
FileMode
.
WRITE
,
flush:
true
);
}
Future
<
bool
>
upgradePbxProjWithFlutterAssets
(
String
app
)
async
{
final
File
xcodeProjectFile
=
fs
.
file
(
fs
.
path
.
join
(
'ios'
,
'Runner.xcodeproj'
,
'project.pbxproj'
));
assert
(
await
xcodeProjectFile
.
exists
());
final
List
<
String
>
lines
=
await
xcodeProjectFile
.
readAsLines
();
if
(
lines
.
any
((
String
line
)
=>
line
.
contains
(
'path = Flutter/flutter_assets'
)))
return
true
;
final
String
l1
=
' 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };'
;
final
String
l2
=
' 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };'
;
final
String
l3
=
' 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };'
;
final
String
l4
=
' 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };'
;
final
String
l5
=
' 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,'
;
final
String
l6
=
' 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,'
;
final
String
l7
=
' 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,'
;
final
String
l8
=
' 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,'
;
printStatus
(
"Upgrading project.pbxproj of
$app
' to include the "
"'flutter_assets' directory"
);
if
(!
lines
.
contains
(
l1
)
||
!
lines
.
contains
(
l3
)
||
!
lines
.
contains
(
l5
)
||
!
lines
.
contains
(
l7
))
{
printError
(
'Automatic upgrade of project.pbxproj failed.'
);
printError
(
' To manually upgrade, open ios/Runner.xcodeproj/project.pbxproj:'
);
printError
(
' Add the following line in the "PBXBuildFile" section'
);
printError
(
l2
);
printError
(
' Add the following line in the "PBXFileReference" section'
);
printError
(
l4
);
printError
(
' Add the following line in the "children" list of the "Flutter" group in the "PBXGroup" section'
);
printError
(
l6
);
printError
(
' Add the following line in the "files" list of "Resources" in the "PBXResourcesBuildPhase" section'
);
printError
(
l8
);
return
false
;
}
lines
.
insert
(
lines
.
indexOf
(
l1
)
+
1
,
l2
);
lines
.
insert
(
lines
.
indexOf
(
l3
)
+
1
,
l4
);
lines
.
insert
(
lines
.
indexOf
(
l5
)
+
1
,
l6
);
lines
.
insert
(
lines
.
indexOf
(
l7
)
+
1
,
l8
);
// TODO(zarah): Remove lines with 'app.flx' once 'app.flx' is not used anymore.
final
StringBuffer
buffer
=
new
StringBuffer
();
lines
.
forEach
(
buffer
.
writeln
);
await
xcodeProjectFile
.
writeAsString
(
buffer
.
toString
());
return
true
;
}
\ No newline at end of file
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