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
d915b394
Commit
d915b394
authored
Jan 24, 2016
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4809 from efirestone/firestone/mapping-models
Handle CoreData mapping model resources
parents
61c1ae80
65625da1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
3 deletions
+52
-3
CHANGELOG.md
CHANGELOG.md
+4
-0
file_references_installer.rb
lib/cocoapods/installer/file_references_installer.rb
+3
-0
banana-lib.tar.gz
spec/fixtures/banana-lib.tar.gz
+0
-0
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+24
-3
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+12
-0
file_accessor_spec.rb
spec/unit/sandbox/file_accessor_spec.rb
+4
-0
path_list_spec.rb
spec/unit/sandbox/path_list_spec.rb
+3
-0
pod_dir_cleaner_spec.rb
spec/unit/sandbox/pod_dir_cleaner_spec.rb
+2
-0
No files found.
CHANGELOG.md
View file @
d915b394
...
@@ -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
*
Handle CoreData mapping models with recursive resource globs.
[
Eric Firestone
](
https://github.com/efirestone
)
[
#4809
](
https://github.com/CocoaPods/CocoaPods/pull/4809
)
*
Generate valid xcconfig when target name includes spaces.
*
Generate valid xcconfig when target name includes spaces.
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#4783
](
https://github.com/CocoaPods/CocoaPods/issues/4783
)
[
#4783
](
https://github.com/CocoaPods/CocoaPods/issues/4783
)
...
...
lib/cocoapods/installer/file_references_installer.rb
View file @
d915b394
...
@@ -204,6 +204,9 @@ module Pod
...
@@ -204,6 +204,9 @@ module Pod
# 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\/.+/i
next
if
path_str
=~
/.*\.xcdatamodeld\/.+/i
# We add the directory for a Core Data migration mapping, but not the items in it.
next
if
path_str
=~
/.*\.xcmappingmodel\/.+/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\/.+/i
next
if
path_str
=~
/.*\.xcassets\/.+/i
...
...
spec/fixtures/banana-lib.tar.gz
View file @
d915b394
No preview for this file type
spec/unit/installer/file_references_installer_spec.rb
View file @
d915b394
...
@@ -143,11 +143,32 @@ module Pod
...
@@ -143,11 +143,32 @@ module Pod
it
"doesn't add file references for files within Asset Catalogs"
do
it
"doesn't add file references for files within Asset Catalogs"
do
@installer
.
install!
@installer
.
install!
catalog_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/Images.xcasset
s'
]
resources_group_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resource
s'
]
catalog_
ref
.
should
.
be
.
not
.
nil
catalog_
path
=
'Resources/Images.xcassets'
# The asset catalog should be a "PBXFileReference" and therefore doesn't have children.
# The asset catalog should be a "PBXFileReference" and therefore doesn't have children.
catalog_ref
.
is_a?
(
Xcodeproj
::
Project
::
Object
::
PBXFileReference
).
should
.
be
.
true
resources_group_ref
.
files
.
any?
{
|
ref
|
ref
.
path
==
catalog_path
}.
should
.
be
.
true
# The asset catalog should not also be a "PBXGroup".
resources_group_ref
.
groups
.
any?
{
|
ref
|
ref
.
path
==
catalog_path
}.
should
.
be
.
false
# None of the children of the catalog directory should be present directly.
resources_group_ref
.
files
.
any?
{
|
ref
|
ref
.
path
.
start_with?
(
catalog_path
+
'/'
)
}.
should
.
be
.
false
end
it
"doesn't add file references for files within CoreData migration mappings"
do
@installer
.
install!
resources_group_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources'
]
mapping_path
=
'Resources/Migration.xcmappingmodel'
# The mapping model should be a "PBXFileReference" and therefore doesn't have children.
resources_group_ref
.
files
.
any?
{
|
ref
|
ref
.
path
==
mapping_path
}.
should
.
be
.
true
# The mapping model should not also be a "PBXGroup".
resources_group_ref
.
groups
.
any?
{
|
ref
|
ref
.
path
==
mapping_path
}.
should
.
be
.
false
# None of the children of the mapping model directory should be present directly.
resources_group_ref
.
files
.
any?
{
|
ref
|
ref
.
path
.
start_with?
(
mapping_path
+
'/'
)
}.
should
.
be
.
false
end
end
end
end
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
d915b394
...
@@ -465,6 +465,18 @@ module Pod
...
@@ -465,6 +465,18 @@ module Pod
end
end
version_build_file
.
should
.
be
.
nil
version_build_file
.
should
.
be
.
nil
end
end
it
'adds Core Data migration mapping models directly to resources'
do
# The model directory item should be present.
dir_build_file
=
@bundle_target
.
resources_build_phase
.
files
.
find
{
|
bf
|
bf
.
file_ref
.
path
==
'Resources/Migration.xcmappingmodel'
}
dir_build_file
.
should
.
be
.
not
.
nil
# An item within the model directory should not be present.
xml_file
=
@bundle_target
.
resources_build_phase
.
files
.
find
do
|
bf
|
bf
.
file_ref
.
path
=~
%r{Resources/Migration
\.
xcmappingmodel/.*}i
end
xml_file
.
should
.
be
.
nil
end
end
end
end
end
end
end
...
...
spec/unit/sandbox/file_accessor_spec.rb
View file @
d915b394
...
@@ -110,6 +110,7 @@ module Pod
...
@@ -110,6 +110,7 @@ module Pod
@accessor
.
resources
.
sort
.
should
==
[
@accessor
.
resources
.
sort
.
should
==
[
@root
+
'Resources/Base.lproj'
,
@root
+
'Resources/Base.lproj'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Migration.xcmappingmodel'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/en.lproj'
,
...
@@ -161,6 +162,7 @@ module Pod
...
@@ -161,6 +162,7 @@ module Pod
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Migration.xcmappingmodel'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/sub_dir'
,
@root
+
'Resources/sub_dir'
,
]
]
...
@@ -175,6 +177,7 @@ module Pod
...
@@ -175,6 +177,7 @@ module Pod
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Migration.xcmappingmodel'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/sub_dir'
,
@root
+
'Resources/sub_dir'
,
]
]
...
@@ -189,6 +192,7 @@ module Pod
...
@@ -189,6 +192,7 @@ module Pod
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/de.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/en.lproj'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/Migration.xcmappingmodel'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/Sample.xcdatamodeld'
,
@root
+
'Resources/sub_dir'
,
@root
+
'Resources/sub_dir'
,
]
]
...
...
spec/unit/sandbox/path_list_spec.rb
View file @
d915b394
...
@@ -26,6 +26,7 @@ module Pod
...
@@ -26,6 +26,7 @@ module Pod
Resources/Base.lproj/Main.storyboard
Resources/Base.lproj/Main.storyboard
Resources/Images.xcassets/Logo.imageset/Contents.json
Resources/Images.xcassets/Logo.imageset/Contents.json
Resources/Images.xcassets/Logo.imageset/logo.png
Resources/Images.xcassets/Logo.imageset/logo.png
Resources/Migration.xcmappingmodel/xcmapping.xml
Resources/Sample.xcdatamodeld/.xccurrentversion
Resources/Sample.xcdatamodeld/.xccurrentversion
Resources/Sample.xcdatamodeld/Sample\ 2.xcdatamodel/contents
Resources/Sample.xcdatamodeld/Sample\ 2.xcdatamodel/contents
Resources/Sample.xcdatamodeld/Sample.xcdatamodel/contents
Resources/Sample.xcdatamodeld/Sample.xcdatamodel/contents
...
@@ -62,6 +63,7 @@ module Pod
...
@@ -62,6 +63,7 @@ module Pod
Resources/Base.lproj
Resources/Base.lproj
Resources/Images.xcassets
Resources/Images.xcassets
Resources/Images.xcassets/Logo.imageset
Resources/Images.xcassets/Logo.imageset
Resources/Migration.xcmappingmodel
Resources/Sample.xcdatamodeld
Resources/Sample.xcdatamodeld
Resources/Sample.xcdatamodeld/Sample\ 2.xcdatamodel
Resources/Sample.xcdatamodeld/Sample\ 2.xcdatamodel
Resources/Sample.xcdatamodeld/Sample.xcdatamodel
Resources/Sample.xcdatamodeld/Sample.xcdatamodel
...
@@ -154,6 +156,7 @@ module Pod
...
@@ -154,6 +156,7 @@ module Pod
paths
.
sort
.
should
==
%w(
paths
.
sort
.
should
==
%w(
Resources/Base.lproj
Resources/Base.lproj
Resources/Images.xcassets
Resources/Images.xcassets
Resources/Migration.xcmappingmodel
Resources/Sample.xcdatamodeld
Resources/Sample.xcdatamodeld
Resources/de.lproj
Resources/de.lproj
Resources/en.lproj
Resources/en.lproj
...
...
spec/unit/sandbox/pod_dir_cleaner_spec.rb
View file @
d915b394
...
@@ -44,6 +44,7 @@ module Pod
...
@@ -44,6 +44,7 @@ module Pod
README
README
Resources/Base.lproj
Resources/Base.lproj
Resources/Images.xcassets
Resources/Images.xcassets
Resources/Migration.xcmappingmodel
Resources/Sample.xcdatamodeld
Resources/Sample.xcdatamodeld
Resources/de.lproj
Resources/de.lproj
Resources/en.lproj
Resources/en.lproj
...
@@ -78,6 +79,7 @@ module Pod
...
@@ -78,6 +79,7 @@ module Pod
README
README
Resources/Base.lproj
Resources/Base.lproj
Resources/Images.xcassets
Resources/Images.xcassets
Resources/Migration.xcmappingmodel
Resources/Sample.xcdatamodeld
Resources/Sample.xcdatamodeld
Resources/de.lproj
Resources/de.lproj
Resources/en.lproj
Resources/en.lproj
...
...
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