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
310553aa
Commit
310553aa
authored
Jul 14, 2017
by
David Airapetyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 4887: Providing a better error message when project references are missing for other files
parent
93816cae
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
1 deletion
+85
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
pod_target_installer.rb
...ller/xcode/pods_project_generator/pod_target_installer.rb
+1
-1
Contents.json
...s-lib/Classes/Images.xcassets/Logo.imageset/Contents.json
+22
-0
logo.png
...inions-lib/Classes/Images.xcassets/Logo.imageset/logo.png
+0
-0
Minions.h
spec/fixtures/minions-lib/Classes/Minions.h
+6
-0
Minions.m
spec/fixtures/minions-lib/Classes/Minions.m
+0
-0
MinionsLib.podspec
spec/fixtures/minions-lib/MinionsLib.podspec
+15
-0
pod_target_installer_spec.rb
...xcode/pods_project_generator/pod_target_installer_spec.rb
+37
-0
No files found.
CHANGELOG.md
View file @
310553aa
...
@@ -26,6 +26,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -26,6 +26,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6829
](
https://github.com/CocoaPods/CocoaPods/pull/6829
)
[
#6829
](
https://github.com/CocoaPods/CocoaPods/pull/6829
)
*
Provide a better error message when references are missing for non-source files
[
David Airapetyan
](
https://github.com/davidair
)
[
#4887
](
https://github.com/CocoaPods/CocoaPods/issues/4887
)
## 1.3.0.beta.2 (2017-06-22)
## 1.3.0.beta.2 (2017-06-22)
##### Enhancements
##### Enhancements
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
View file @
310553aa
...
@@ -155,7 +155,7 @@ module Pod
...
@@ -155,7 +155,7 @@ module Pod
add_header
(
build_file
,
public_headers
,
private_headers
,
native_target
)
add_header
(
build_file
,
public_headers
,
private_headers
,
native_target
)
end
end
other_file_refs
=
other_source_files
.
map
{
|
sf
|
project
.
reference_for_path
(
sf
)
}
other_file_refs
=
project_file_references_array
(
other_source_files
,
'other source'
)
native_target
.
add_file_references
(
other_file_refs
,
nil
)
native_target
.
add_file_references
(
other_file_refs
,
nil
)
next
unless
target
.
requires_frameworks?
next
unless
target
.
requires_frameworks?
...
...
spec/fixtures/minions-lib/Classes/Images.xcassets/Logo.imageset/Contents.json
0 → 100644
View file @
310553aa
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
,
"filename"
:
"logo.png"
},
{
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
spec/fixtures/minions-lib/Classes/Images.xcassets/Logo.imageset/logo.png
0 → 100644
View file @
310553aa
427 Bytes
spec/fixtures/minions-lib/Classes/Minions.h
0 → 100644
View file @
310553aa
#import <Foundation/Foundation.h>
/** Minions are awesome */
@interface
MinionsObj
:
NSObject
@end
spec/fixtures/minions-lib/Classes/Minions.m
0 → 100644
View file @
310553aa
spec/fixtures/minions-lib/MinionsLib.podspec
0 → 100644
View file @
310553aa
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'MinionsLib'
s
.
version
=
'1.0'
s
.
authors
=
'Minions Corp'
,
{
'Stuart'
=>
'stuart@minions-corp.local'
}
s
.
homepage
=
'http://minions-corp.local/minions-lib.html'
s
.
summary
=
'Minions!'
s
.
description
=
'Despicable Me'
s
.
source
=
{
:git
=>
'http://minions-corp.local/minions-lib.git'
,
:tag
=>
'v1.0'
}
s
.
license
=
{
:type
=>
'MIT'
,
:file
=>
'LICENSE'
,
:text
=>
'Permission is hereby granted ...'
}
s
.
source_files
=
'Classes/**/*'
end
spec/unit/installer/xcode/pods_project_generator/pod_target_installer_spec.rb
View file @
310553aa
...
@@ -239,6 +239,43 @@ module Pod
...
@@ -239,6 +239,43 @@ module Pod
end
end
end
end
describe
'test other files under sources'
do
before
do
config
.
sandbox
.
prepare
@podfile
=
Podfile
.
new
do
platform
:ios
,
'6.0'
project
'SampleProject/SampleProject'
target
'SampleProject'
end
@target_definition
=
@podfile
.
target_definitions
[
'SampleProject'
]
@project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
config
.
sandbox
.
project
=
@project
@minions_spec
=
fixture_spec
(
'minions-lib/MinionsLib.podspec'
)
# Add sources to the project.
file_accessor
=
Sandbox
::
FileAccessor
.
new
(
Sandbox
::
PathList
.
new
(
fixture
(
'minions-lib'
)),
@minions_spec
.
consumer
(
:ios
))
@project
.
add_pod_group
(
'MinionsLib'
,
fixture
(
'minions-lib'
))
group
=
@project
.
group_for_spec
(
'MinionsLib'
)
file_accessor
.
source_files
.
each
do
|
file
|
@project
.
add_file_reference
(
file
,
group
)
if
file
.
fnmatch?
(
'*.m'
)
||
file
.
fnmatch?
(
'*.h'
)
end
@minions_pod_target
=
PodTarget
.
new
([
@minions_spec
,
*
@minions_spec
.
recursive_subspecs
],
[
@target_definition
],
config
.
sandbox
)
@minions_pod_target
.
file_accessors
=
[
file_accessor
]
@minions_pod_target
.
user_build_configurations
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
}
@installer
=
PodTargetInstaller
.
new
(
config
.
sandbox
,
@minions_pod_target
)
@first_json_file
=
file_accessor
.
source_files
.
find
{
|
sf
|
sf
.
extname
==
'.json'
}
end
it
'raises when references are missing for non-source files'
do
@minions_pod_target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
exception
=
lambda
{
@installer
.
install!
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"Unable to find other source ref for
#{
@first_json_file
}
for target MinionsLib."
end
end
#--------------------------------------#
#--------------------------------------#
it
'adds the source files of each pod to the target of the Pod library'
do
it
'adds the source files of each pod to the target of the Pod library'
do
...
...
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