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
f0bc0a3f
Commit
f0bc0a3f
authored
Feb 25, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue to refactor TargetInstaller.
parent
8390e00b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
Xcodeproj
external/Xcodeproj
+1
-1
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+19
-14
installer_spec.rb
spec/unit/installer_spec.rb
+1
-1
No files found.
Xcodeproj
@
fc2a3c01
Subproject commit
ea0ac9953d8ad7da4f35f0e452a68ecf7ef5938e
Subproject commit
fc2a3c0152605451a67e9ee5f69ea244fd624a68
lib/cocoapods/installer/target_installer.rb
View file @
f0bc0a3f
...
...
@@ -4,10 +4,10 @@ module Pod
include
Config
::
Mixin
include
Shared
attr_reader
:podfile
,
:project
,
:definition
,
:target
attr_reader
:podfile
,
:project
,
:
target_
definition
,
:target
def
initialize
(
podfile
,
project
,
definition
)
@podfile
,
@project
,
@
definition
=
podfile
,
project
,
definition
def
initialize
(
podfile
,
project
,
target_
definition
)
@podfile
,
@project
,
@
target_definition
=
podfile
,
project
,
target_
definition
end
def
xcconfig
...
...
@@ -23,7 +23,7 @@ module Pod
end
def
xcconfig_filename
"
#{
@definition
.
lib_name
}
.xcconfig"
"
#{
@
target_
definition
.
lib_name
}
.xcconfig"
end
def
copy_resources_script_for
(
pods
)
...
...
@@ -31,7 +31,7 @@ module Pod
end
def
copy_resources_filename
"
#{
@definition
.
lib_name
}
-resources.sh"
"
#{
@
target_
definition
.
lib_name
}
-resources.sh"
end
def
bridge_support_generator
...
...
@@ -43,7 +43,7 @@ module Pod
end
def
bridge_support_filename
"
#{
@definition
.
lib_name
}
.bridgesupport"
"
#{
@
target_
definition
.
lib_name
}
.bridgesupport"
end
# TODO move out to Generator::PrefixHeader
...
...
@@ -56,13 +56,17 @@ module Pod
end
def
prefix_header_filename
"
#{
@definition
.
lib_name
}
-prefix.pch"
"
#{
@target_definition
.
lib_name
}
-prefix.pch"
end
def
target_support_files
[
copy_resources_filename
,
prefix_header_filename
,
xcconfig_filename
]
end
# TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support.
def
install!
(
pods
,
sandbox
)
# First add the target to the project
@target
=
@project
.
targets
.
new_static_library
(
@definition
.
lib_name
)
@target
=
@project
.
targets
.
new_static_library
(
@
target_
definition
.
lib_name
)
pods
.
each
do
|
pod
|
xcconfig
.
merge!
(
pod
.
specification
.
xcconfig
)
...
...
@@ -74,15 +78,16 @@ module Pod
# Add all the target related support files to the group, even the copy
# resources script although the project doesn't actually use them.
support_files_group
=
@project
.
groups
.
find
do
|
group
|
group
.
name
==
"Targets Support Files"
end
.
groups
.
new
(
"name"
=>
@definition
.
lib_name
)
support_files_group
.
files
.
new
(
'path'
=>
copy_resources_filename
)
prefix_file
=
support_files_group
.
files
.
new
(
'path'
=>
prefix_header_filename
)
xcconfig_file
=
support_files_group
.
files
.
new
(
"path"
=>
xcconfig_filename
)
support_files_group
=
@project
.
groups
.
object_named
(
"Targets Support Files"
)
support_files_group
=
support_files_group
.
create_group
(
@target_definition
.
lib_name
)
target_support_files
.
each
do
|
file_path
|
support_files_group
.
create_file
(
file_path
)
end
# Assign the xcconfig as the base config of each config.
@target
.
buildConfigurations
.
each
do
|
config
|
xcconfig_file
=
support_files_group
.
file_with_path
(
xcconfig_filename
)
config
.
baseConfiguration
=
xcconfig_file
config
.
buildSettings
[
'OTHER_LDFLAGS'
]
=
''
config
.
buildSettings
[
'GCC_PREFIX_HEADER'
]
=
prefix_header_filename
...
...
spec/unit/installer_spec.rb
View file @
f0bc0a3f
...
...
@@ -56,6 +56,6 @@ describe "Pod::Installer" do
end
config
.
rootspec
=
podfile
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
target_installers
.
map
(
&
:definition
).
map
(
&
:name
).
should
==
[
:not_empty
]
installer
.
target_installers
.
map
(
&
:
target_
definition
).
map
(
&
:name
).
should
==
[
:not_empty
]
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