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
816970fc
Commit
816970fc
authored
Jul 04, 2014
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate an Info.plist for frameworks
parent
4875a76e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
116 additions
and
0 deletions
+116
-0
cocoapods.rb
lib/cocoapods.rb
+1
-0
info_plist_file.rb
lib/cocoapods/generator/info_plist_file.rb
+70
-0
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+18
-0
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+1
-0
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+1
-0
target.rb
lib/cocoapods/target.rb
+6
-0
info_plist_file_spec.rb
spec/unit/generator/info_plist_file_spec.rb
+13
-0
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+6
-0
No files found.
lib/cocoapods.rb
View file @
816970fc
...
@@ -57,6 +57,7 @@ module Pod
...
@@ -57,6 +57,7 @@ module Pod
autoload
:CopyResourcesScript
,
'cocoapods/generator/copy_resources_script'
autoload
:CopyResourcesScript
,
'cocoapods/generator/copy_resources_script'
autoload
:DummySource
,
'cocoapods/generator/dummy_source'
autoload
:DummySource
,
'cocoapods/generator/dummy_source'
autoload
:Header
,
'cocoapods/generator/header'
autoload
:Header
,
'cocoapods/generator/header'
autoload
:InfoPlistFile
,
'cocoapods/generator/info_plist_file'
autoload
:PrefixHeader
,
'cocoapods/generator/prefix_header'
autoload
:PrefixHeader
,
'cocoapods/generator/prefix_header'
autoload
:TargetEnvironmentHeader
,
'cocoapods/generator/target_environment_header'
autoload
:TargetEnvironmentHeader
,
'cocoapods/generator/target_environment_header'
autoload
:XCConfig
,
'cocoapods/generator/xcconfig'
autoload
:XCConfig
,
'cocoapods/generator/xcconfig'
...
...
lib/cocoapods/generator/info_plist_file.rb
0 → 100644
View file @
816970fc
module
Pod
module
Generator
# Generates Info.plist files. A Info.plist file is generated for each
# Pod and for each Pod target definition, that requires to be built as
# framework. It states public attributes.
#
class
InfoPlistFile
# @return [Target] the target represented by this Info.plist.
#
attr_reader
:target
# @param [Target] target @see target
#
def
initialize
(
target
)
@target
=
target
end
# Generates and saves the Info.plist to the given path.
#
# @param [Pathname] path
# the path where the prefix header should be stored.
#
# @return [void]
#
def
save_as
(
path
)
contents
=
generate
File
.
open
(
path
,
'w'
)
do
|
f
|
f
.
write
(
contents
)
end
end
# Generates the contents of the Info.plist
#
# @return [String]
#
def
generate
FILE_CONTENTS
end
FILE_CONTENTS
=
<<-
EOS
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</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>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
EOS
end
end
end
lib/cocoapods/installer/target_installer.rb
View file @
816970fc
...
@@ -64,6 +64,24 @@ module Pod
...
@@ -64,6 +64,24 @@ module Pod
target
.
support_files_dir
.
mkdir
target
.
support_files_dir
.
mkdir
end
end
# Creates the Info.plist file which sets public framework attributes
#
# @return [void]
#
def
create_info_plist_file
path
=
target
.
info_plist_path
UI
.
message
"- Generating Info.plist file at
#{
UI
.
path
(
path
)
}
"
do
generator
=
Generator
::
InfoPlistFile
.
new
(
target
)
generator
.
save_as
(
path
)
add_file_to_support_group
(
path
)
native_target
.
build_configurations
.
each
do
|
c
|
relative_path
=
path
.
relative_path_from
(
sandbox
.
root
)
c
.
build_settings
[
'INFOPLIST_FILE'
]
=
relative_path
.
to_s
end
end
end
# Generates a dummy source file for each target so libraries that contain
# Generates a dummy source file for each target so libraries that contain
# only categories build.
# only categories build.
#
#
...
...
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
816970fc
...
@@ -14,6 +14,7 @@ module Pod
...
@@ -14,6 +14,7 @@ module Pod
create_support_files_dir
create_support_files_dir
create_suport_files_group
create_suport_files_group
create_xcconfig_file
create_xcconfig_file
create_info_plist_file
if
target
.
requires_framework?
create_target_environment_header
create_target_environment_header
create_bridge_support_file
create_bridge_support_file
create_copy_resources_script
create_copy_resources_script
...
...
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
816970fc
...
@@ -20,6 +20,7 @@ module Pod
...
@@ -20,6 +20,7 @@ module Pod
add_files_to_build_phases
add_files_to_build_phases
add_resources_bundle_targets
add_resources_bundle_targets
create_xcconfig_file
create_xcconfig_file
create_info_plist_file
if
target
.
requires_framework?
create_prefix_header
create_prefix_header
create_dummy_source
create_dummy_source
end
end
...
...
lib/cocoapods/target.rb
View file @
816970fc
...
@@ -158,6 +158,12 @@ module Pod
...
@@ -158,6 +158,12 @@ module Pod
support_files_dir
+
"
#{
label
}
.bridgesupport"
support_files_dir
+
"
#{
label
}
.bridgesupport"
end
end
# @return [Pathname] the absolute path of the Info.plist file.
#
def
info_plist_path
support_files_dir
+
"Info.plist"
end
# @return [Pathname] the path of the dummy source generated by CocoaPods
# @return [Pathname] the path of the dummy source generated by CocoaPods
#
#
def
dummy_source_path
def
dummy_source_path
...
...
spec/unit/generator/info_plist_file_spec.rb
0 → 100644
View file @
816970fc
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Generator
::
InfoPlistFile
do
it
'generates a valid Info.plist file'
do
generator
=
Pod
::
Generator
::
InfoPlistFile
.
new
(
mock
(
'Target'
))
file
=
temporary_directory
+
'Info.plist'
generator
.
save_as
(
file
)
`plutil -lint
#{
file
}
`
$?
.
should
.
be
.
success
end
end
spec/unit/target/pod_target_spec.rb
View file @
816970fc
...
@@ -92,6 +92,12 @@ module Pod
...
@@ -92,6 +92,12 @@ module Pod
)
)
end
end
it
'returns the absolute path of the info plist file'
do
@pod_target
.
info_plist_path
.
to_s
.
should
.
include?
(
'Pods/Target Support Files/Pods-BananaLib/Info.plist'
)
end
it
'returns the absolute path of the public and private xcconfig files'
do
it
'returns the absolute path of the public and private xcconfig files'
do
@pod_target
.
xcconfig_path
.
to_s
.
should
.
include?
(
@pod_target
.
xcconfig_path
.
to_s
.
should
.
include?
(
'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib.xcconfig'
'Pods/Target Support Files/Pods-BananaLib/Pods-BananaLib.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