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
9e987977
Commit
9e987977
authored
Jan 14, 2012
by
Dieter Komendera
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #104 from roothybrid7/hotfix/prevent_dup_cleaning
fixed bug of directory cleaning.
parents
eb15d119
dab9bf68
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
8 deletions
+36
-8
config.rb
lib/cocoapods/config.rb
+4
-0
installer.rb
lib/cocoapods/installer.rb
+4
-0
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+1
-8
integration_spec.rb
spec/integration_spec.rb
+27
-0
No files found.
lib/cocoapods/config.rb
View file @
9e987977
...
@@ -40,6 +40,10 @@ module Pod
...
@@ -40,6 +40,10 @@ module Pod
@project_podfile
@project_podfile
end
end
def
headers_symlink_root
@headers_symlink_root
||=
"
#{
project_pods_root
}
/Headers"
end
# Returns the spec at the pat returned from `project_podfile`.
# Returns the spec at the pat returned from `project_podfile`.
def
rootspec
def
rootspec
unless
@rootspec
unless
@rootspec
...
...
lib/cocoapods/installer.rb
View file @
9e987977
...
@@ -72,6 +72,10 @@ module Pod
...
@@ -72,6 +72,10 @@ module Pod
puts
"Installing dependencies of:
#{
@podfile
.
defined_in_file
}
"
if
config
.
verbose?
puts
"Installing dependencies of:
#{
@podfile
.
defined_in_file
}
"
if
config
.
verbose?
install_dependencies!
install_dependencies!
root
=
config
.
project_pods_root
root
=
config
.
project_pods_root
headers_symlink_root
=
config
.
headers_symlink_root
# Clean old header symlinks
FileUtils
.
rm_r
(
headers_symlink_root
,
:secure
=>
true
)
if
File
.
exists?
(
headers_symlink_root
)
puts
"Generating support files"
unless
config
.
silent?
puts
"Generating support files"
unless
config
.
silent?
target_installers
.
each
do
|
target_installer
|
target_installers
.
each
do
|
target_installer
|
...
...
lib/cocoapods/installer/target_installer.rb
View file @
9e987977
...
@@ -61,18 +61,11 @@ module Pod
...
@@ -61,18 +61,11 @@ module Pod
"
#{
@definition
.
lib_name
}
-prefix.pch"
"
#{
@definition
.
lib_name
}
-prefix.pch"
end
end
def
headers_symlink_path_name
"
#{
config
.
project_pods_root
}
/Headers"
end
# TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support.
# TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support.
def
install!
def
install!
# First add the target to the project
# First add the target to the project
@target
=
@project
.
targets
.
new_static_library
(
@definition
.
lib_name
)
@target
=
@project
.
targets
.
new_static_library
(
@definition
.
lib_name
)
# Clean old header symlinks
FileUtils
.
rm_r
(
headers_symlink_path_name
,
:secure
=>
true
)
if
File
.
exists?
(
headers_symlink_path_name
)
header_search_paths
=
[]
header_search_paths
=
[]
build_specifications
.
each
do
|
spec
|
build_specifications
.
each
do
|
spec
|
xcconfig
.
merge!
(
spec
.
xcconfig
)
xcconfig
.
merge!
(
spec
.
xcconfig
)
...
@@ -82,7 +75,7 @@ module Pod
...
@@ -82,7 +75,7 @@ module Pod
end
end
# Symlink header files to Pods/Headers
# Symlink header files to Pods/Headers
spec
.
copy_header_mappings
.
each
do
|
header_dir
,
files
|
spec
.
copy_header_mappings
.
each
do
|
header_dir
,
files
|
target_dir
=
"
#{
headers_symlink_path_name
}
/
#{
header_dir
}
"
target_dir
=
"
#{
config
.
headers_symlink_root
}
/
#{
header_dir
}
"
FileUtils
.
mkdir_p
(
target_dir
)
FileUtils
.
mkdir_p
(
target_dir
)
target_dir_real_path
=
Pathname
.
new
(
target_dir
).
realpath
target_dir_real_path
=
Pathname
.
new
(
target_dir
).
realpath
files
.
each
do
|
file
|
files
.
each
do
|
file
|
...
...
spec/integration_spec.rb
View file @
9e987977
...
@@ -337,6 +337,33 @@ else
...
@@ -337,6 +337,33 @@ else
end
end
end
end
it
"should prevent duplication cleaning headers symlinks with multiple targets"
do
Pod
::
Source
.
reset!
Pod
::
Spec
::
Set
.
reset!
podfile
=
Pod
::
Podfile
.
new
do
# first ensure that the correct info is available to the specs when they load
config
.
rootspec
=
self
self
.
platform
platform
target
(
:debug
)
{
dependency
'SSZipArchive'
}
target
(
:test
,
:exclusive
=>
true
)
{
dependency
'JSONKit'
}
dependency
'ASIHTTPRequest'
end
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
install!
root
=
config
.
project_pods_root
(
root
+
'Pods.xcconfig'
).
should
.
exist
(
root
+
'Headers'
).
should
.
exist
(
root
+
'Headers/SSZipArchive'
).
should
.
exist
(
root
+
'Headers/ASIHTTPRequest'
).
should
.
exist
(
root
+
'Headers/JSONKit'
).
should
.
exist
Pathname
.
glob
(
File
.
join
(
root
.
to_s
,
'Headers/ASIHTTPRequest/*.h'
)).
size
.
should
.
be
>
0
Pathname
.
glob
(
File
.
join
(
root
.
to_s
,
'Headers/SSZipArchive/*.h'
)).
size
.
should
.
be
>
0
Pathname
.
glob
(
File
.
join
(
root
.
to_s
,
'Headers/JSONKit/*.h'
)).
size
.
should
.
be
>
0
end
end
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