Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
1fd0fe8d
Commit
1fd0fe8d
authored
Jan 05, 2016
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4729 from CocoaPods/seg-bundle-info-plist
[InfoPlist] Generate properly for bundles
parents
72911f4c
2a0a8d6d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
38 deletions
+90
-38
CHANGELOG.md
CHANGELOG.md
+6
-0
Gemfile.lock
Gemfile.lock
+1
-1
info_plist_file.rb
lib/cocoapods/generator/info_plist_file.rb
+48
-35
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+1
-1
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
info_plist_file_spec.rb
spec/unit/generator/info_plist_file_spec.rb
+33
-0
No files found.
CHANGELOG.md
View file @
1fd0fe8d
...
...
@@ -24,6 +24,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#4717
](
https://github.com/CocoaPods/CocoaPods/issues/4717
)
*
The
`Info.plist`
file will now be generated properly for resource bundles,
setting the proper
`CFBundlePackageType`
and omitting the
`CFBundleExecutable`
key.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
Xcodeproj#259
](
https://github.com/CocoaPods/Xcodeproj/issues/259
)
## 1.0.0.beta.1 (2015-12-30)
...
...
Gemfile.lock
View file @
1fd0fe8d
...
...
@@ -7,7 +7,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Core.git
revision:
4ea0658643da06c6a537fd55dbb0d28e7e59a1b5
revision:
f1b6ae5c1c0f45405e71d508c441398e6fa5191f
branch: master
specs:
cocoapods-core (1.0.0.beta.1)
...
...
lib/cocoapods/generator/info_plist_file.rb
View file @
1fd0fe8d
...
...
@@ -9,12 +9,20 @@ module Pod
#
attr_reader
:target
# @return [Symbol] the CFBundlePackageType of the target this Info.plist
# file is for.
#
attr_reader
:bundle_package_type
# Initialize a new instance
#
# @param [Target] target @see target
#
def
initialize
(
target
)
# @param [Symbol] bundle_package_type @see bundle_package_type
#
def
initialize
(
target
,
bundle_package_type: :fmwk
)
@target
=
target
@bundle_package_type
=
bundle_package_type
end
# Generates and saves the Info.plist to the given path.
...
...
@@ -51,7 +59,7 @@ module Pod
# @return [String]
#
def
generate
header
+
dict
+
footer
to_plist
(
info
)
end
private
...
...
@@ -61,51 +69,56 @@ module Pod
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
PLIST
end
def
footer
<<-
PLIST
</dict>
</plist>
PLIST
end
def
dict
dict
=
<<-
PLIST
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>
#{
target_version
}
</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
PLIST
def
to_plist
(
root
)
serialize
(
root
,
header
)
<<
footer
end
if
target
.
platform
.
name
==
:tvos
dict
<<
<<-
PLIST
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
PLIST
def
serialize
(
value
,
output
,
indentation
=
0
)
indent
=
' '
*
indentation
case
value
when
Array
output
<<
indent
<<
"<array>
\n
"
value
.
each
{
|
v
|
serialize
(
v
,
output
,
indentation
+
2
)
}
output
<<
indent
<<
"</array>
\n
"
when
Hash
output
<<
indent
<<
"<dict>
\n
"
value
.
to_a
.
sort_by
(
&
:first
).
each
do
|
key
,
v
|
output
<<
indent
<<
' '
<<
"<key>
#{
key
}
</key>
\n
"
serialize
(
v
,
output
,
indentation
+
2
)
end
output
<<
indent
<<
"</dict>
\n
"
when
String
output
<<
indent
<<
"<string>
#{
value
}
</string>
\n
"
end
output
end
def
info
info
=
{
'CFBundleIdentifier'
=>
'${PRODUCT_BUNDLE_IDENTIFIER}'
,
'CFBundleInfoDictionaryVersion'
=>
'6.0'
,
'CFBundleName'
=>
'${PRODUCT_NAME}'
,
'CFBundlePackageType'
=>
bundle_package_type
.
to_s
.
upcase
,
'CFBundleShortVersionString'
=>
target_version
,
'CFBundleSignature'
=>
'????'
,
'CFBundleVersion'
=>
'${CURRENT_PROJECT_VERSION}'
,
'NSPrincipalClass'
=>
''
,
'CFBundleDevelopmentRegion'
=>
'en'
,
}
info
[
'CFBundleExecutable'
]
=
'${EXECUTABLE_NAME}'
if
bundle_package_type
!=
:bndl
info
[
'UIRequiredDeviceCapabilities'
]
=
%w(arm64)
if
target
.
platform
.
name
==
:tvos
dict
info
end
end
end
...
...
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
1fd0fe8d
...
...
@@ -169,7 +169,7 @@ module Pod
path
=
target
.
info_plist_path
path
.
dirname
.
mkdir
unless
path
.
dirname
.
exist?
info_plist_path
=
path
.
dirname
+
"ResourceBundle-
#{
bundle_name
}
-
#{
path
.
basename
}
"
generator
=
Generator
::
InfoPlistFile
.
new
(
target
)
generator
=
Generator
::
InfoPlistFile
.
new
(
target
,
:bundle_package_type
=>
:bndl
)
generator
.
save_as
(
info_plist_path
)
add_file_to_support_group
(
info_plist_path
)
...
...
cocoapods-integration-specs
@
3c74dd99
Subproject commit
06563e49153f7ce8044f7b2d2d1808b370c282a
b
Subproject commit
3c74dd99cf532ba61336e940f79fb8b02467a65
b
spec/unit/generator/info_plist_file_spec.rb
View file @
1fd0fe8d
...
...
@@ -84,5 +84,38 @@ module Pod
generator
.
save_as
(
file
)
Xcodeproj
::
Plist
.
read_from_path
(
file
)[
'UIRequiredDeviceCapabilities'
].
should
==
%w(arm64)
end
it
'properly formats serialized arrays'
do
generator
=
Generator
::
InfoPlistFile
.
new
(
mock
(
'Target'
))
generator
.
send
(
:to_plist
,
'array'
=>
%w(a b)
).
should
==
<<-
PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>array</key>
<array>
<string>a</string>
<string>b</string>
</array>
</dict>
</plist>
PLIST
end
it
'uses the specified bundle_package_type'
do
target
=
mock
(
'Target'
,
:platform
=>
stub
(
:name
=>
:ios
))
generator
=
Generator
::
InfoPlistFile
.
new
(
target
,
:bundle_package_type
=>
:bndl
)
file
=
temporary_directory
+
'Info.plist'
generator
.
save_as
(
file
)
Xcodeproj
::
Plist
.
read_from_path
(
file
)[
'CFBundlePackageType'
].
should
==
'BNDL'
end
it
'does not include a CFBundleExecutable for bundles'
do
target
=
mock
(
'Target'
,
:platform
=>
stub
(
:name
=>
:ios
))
generator
=
Generator
::
InfoPlistFile
.
new
(
target
,
:bundle_package_type
=>
:bndl
)
file
=
temporary_directory
+
'Info.plist'
generator
.
save_as
(
file
)
Xcodeproj
::
Plist
.
read_from_path
(
file
).
should
.
not
.
key
(
'CFBundleExecutable'
)
end
end
end
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