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
f4c411e7
Commit
f4c411e7
authored
Jan 15, 2016
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4765 from efirestone/firestone/variant-groups-fix
Fix bug where lproj directories aren't added to project
parents
ddbffba9
3a4d1a83
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
CHANGELOG.md
CHANGELOG.md
+4
-0
file_references_installer.rb
lib/cocoapods/installer/file_references_installer.rb
+9
-9
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+6
-2
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+3
-0
No files found.
CHANGELOG.md
View file @
f4c411e7
...
@@ -10,6 +10,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -10,6 +10,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Properly add resource files to resources build phase.
[
Eric Firestone
](
https://github.com/efirestone
)
[
#4762
](
https://github.com/CocoaPods/CocoaPods/issues/4762
)
*
Fix suggestion of sudo when it actually isn't needed.
*
Fix suggestion of sudo when it actually isn't needed.
[
Marcel Jackwerth
](
https://github.com/sirlantis
)
[
Marcel Jackwerth
](
https://github.com/sirlantis
)
...
...
lib/cocoapods/installer/file_references_installer.rb
View file @
f4c411e7
...
@@ -199,29 +199,29 @@ module Pod
...
@@ -199,29 +199,29 @@ module Pod
lproj_paths
=
Set
.
new
lproj_paths
=
Set
.
new
lproj_paths_with_files
=
Set
.
new
lproj_paths_with_files
=
Set
.
new
allowable_paths
=
paths
.
select
do
|
path
|
allowable_paths
=
paths
.
select
do
|
path
|
path_str
=
path
.
to_s
.
downcase
path_str
=
path
.
to_s
# We add the directory for a Core Data model, but not the items in it.
# We add the directory for a Core Data model, but not the items in it.
next
if
path_str
=~
/.*\.xcdatamodeld\/.+/
next
if
path_str
=~
/.*\.xcdatamodeld\/.+/
i
# We add the directory for an asset catalog, but not the items in it.
# We add the directory for an asset catalog, but not the items in it.
next
if
path_str
=~
/.*\.xcassets\/.+/
next
if
path_str
=~
/.*\.xcassets\/.+/
i
if
path_str
=~
/\.lproj(\/|$)/
if
path_str
=~
/\.lproj(\/|$)/
i
# If the element is an .lproj directory then save it and potentially
# If the element is an .lproj directory then save it and potentially
# add it later if we don't find any contained items.
# add it later if we don't find any contained items.
if
path_str
.
end_with?
(
'.lproj'
)
&&
path
.
directory?
if
path_str
=~
/\.lproj$/i
&&
path
.
directory?
lproj_paths
<<
path
_str
lproj_paths
<<
path
next
next
end
end
# Collect the paths for the .lproj directories that contain files.
# Collect the paths for the .lproj directories that contain files.
lproj_path
=
/(^.*\.lproj)\/.*/
.
match
(
path_str
)[
1
]
lproj_path
=
/(^.*\.lproj)\/.*/
i
.
match
(
path_str
)[
1
]
lproj_paths_with_files
<<
lproj_path
lproj_paths_with_files
<<
Pathname
(
lproj_path
)
# Directories nested within an .lproj directory are added as file
# Directories nested within an .lproj directory are added as file
# system references so their contained items are not added directly.
# system references so their contained items are not added directly.
next
if
path
.
dirname
.
dirname
.
to_s
.
downcase
==
lproj_path
next
if
path
.
dirname
.
dirname
==
lproj_path
end
end
true
true
...
...
spec/unit/installer/file_references_installer_spec.rb
View file @
f4c411e7
...
@@ -12,7 +12,7 @@ module Pod
...
@@ -12,7 +12,7 @@ module Pod
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
describe
'Installation'
do
describe
'Installation
With Flat Resources Glob
'
do
it
'adds the files references of the source files the Pods project'
do
it
'adds the files references of the source files the Pods project'
do
@file_accessor
.
path_list
.
read_file_system
@file_accessor
.
path_list
.
read_file_system
@file_accessor
.
path_list
.
expects
(
:read_file_system
)
@file_accessor
.
path_list
.
expects
(
:read_file_system
)
...
@@ -47,20 +47,24 @@ module Pod
...
@@ -47,20 +47,24 @@ module Pod
file_ref
.
path
.
should
==
'Resources/logo-sidebar.png'
file_ref
.
path
.
should
==
'Resources/logo-sidebar.png'
end
end
it
"add file references for localization directories if glob doesn't include contained files"
do
it
"add
s
file references for localization directories if glob doesn't include contained files"
do
@installer
.
install!
@installer
.
install!
file_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/en.lproj'
]
file_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/en.lproj'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
path
.
should
==
'Resources/en.lproj'
end
end
it
'adds file references for files within CoreData directories'
do
it
'adds file references for files within CoreData directories'
do
@installer
.
install!
@installer
.
install!
model_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/Sample.xcdatamodeld'
]
model_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/Sample.xcdatamodeld'
]
model_ref
.
should
.
be
.
not
.
nil
model_ref
.
should
.
be
.
not
.
nil
model_ref
.
path
.
should
==
'Resources/Sample.xcdatamodeld'
# Files within the .xcdatamodeld directory are added automatically by adding the .xcdatamodeld directory.
# Files within the .xcdatamodeld directory are added automatically by adding the .xcdatamodeld directory.
file_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/Sample.xcdatamodeld/Sample.xcdatamodel'
]
file_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/Sample.xcdatamodeld/Sample.xcdatamodel'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
path
.
should
==
'Sample.xcdatamodel'
file_ref
.
source_tree
.
should
==
'<group>'
end
end
it
'links the headers required for building the pod target'
do
it
'links the headers required for building the pod target'
do
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
f4c411e7
...
@@ -124,6 +124,9 @@ module Pod
...
@@ -124,6 +124,9 @@ module Pod
resources
.
count
.
should
>
0
resources
.
count
.
should
>
0
resource
=
resources
.
find
{
|
res
|
res
.
file_ref
.
path
.
include?
(
'logo-sidebar.png'
)
}
resource
=
resources
.
find
{
|
res
|
res
.
file_ref
.
path
.
include?
(
'logo-sidebar.png'
)
}
resource
.
should
.
be
.
not
.
nil
resource
.
should
.
be
.
not
.
nil
resource
=
resources
.
find
{
|
res
|
res
.
file_ref
.
path
.
include?
(
'en.lproj'
)
}
resource
.
should
.
be
.
not
.
nil
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