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
3268bf72
Commit
3268bf72
authored
Dec 24, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2934 from CocoaPods/fix-resource-bundles-for-not-build-targets
Fix resource bundles for not build targets
parents
9258cd3a
27ff9bc4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
7 deletions
+52
-7
CHANGELOG.md
CHANGELOG.md
+4
-0
installer.rb
lib/cocoapods/installer.rb
+8
-1
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+12
-5
pod_target.rb
lib/cocoapods/target/pod_target.rb
+5
-0
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
integration.rb
spec/integration.rb
+5
-0
installer_spec.rb
spec/unit/installer_spec.rb
+17
-0
No files found.
CHANGELOG.md
View file @
3268bf72
...
...
@@ -43,6 +43,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Fix resource bundles for not build targets.
[
Boris Bügling
](
https://github.com/neonichu
)
[
#2934
](
https://github.com/CocoaPods/CocoaPods/issues/2934
)
*
Fix updating a pod that has subspec dependencies.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#2879
](
https://github.com/CocoaPods/CocoaPods/issues/2879
)
...
...
lib/cocoapods/installer.rb
View file @
3268bf72
...
...
@@ -447,7 +447,14 @@ module Pod
def
set_target_dependencies
aggregate_targets
.
each
do
|
aggregate_target
|
aggregate_target
.
pod_targets
.
each
do
|
pod_target
|
next
unless
pod_target
.
should_build?
unless
pod_target
.
should_build?
pod_target
.
resource_bundle_targets
.
each
do
|
resource_bundle_target
|
aggregate_target
.
native_target
.
add_dependency
(
resource_bundle_target
)
end
next
end
aggregate_target
.
native_target
.
add_dependency
(
pod_target
.
native_target
)
pod_target
.
dependencies
.
each
do
|
dep
|
...
...
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
3268bf72
...
...
@@ -9,7 +9,10 @@ module Pod
# @return [void]
#
def
install!
return
unless
target
.
should_build?
unless
target
.
should_build?
add_resources_bundle_targets
return
end
UI
.
message
"- Installing target `
#{
target
.
name
}
`
#{
target
.
platform
}
"
do
add_target
...
...
@@ -66,10 +69,9 @@ module Pod
target
.
file_accessors
.
each
do
|
file_accessor
|
file_accessor
.
resource_bundles
.
each
do
|
bundle_name
,
paths
|
# Add a dependency on an existing Resource Bundle target if possible
if
bundle_target
=
project
.
targets
.
find
{
|
target
|
target
.
name
==
bundle_name
}
native_target
.
add_dependency
(
bundle_target
)
next
end
bundle_target
=
project
.
targets
.
find
{
|
target
|
target
.
name
==
bundle_name
}
unless
bundle_target
file_references
=
paths
.
map
{
|
sf
|
project
.
reference_for_path
(
sf
)
}
bundle_target
=
project
.
new_resources_bundle
(
bundle_name
,
file_accessor
.
spec_consumer
.
platform_name
)
bundle_target
.
add_resources
(
file_references
)
...
...
@@ -77,11 +79,16 @@ module Pod
target
.
user_build_configurations
.
each
do
|
bc_name
,
type
|
bundle_target
.
add_build_configuration
(
bc_name
,
type
)
end
end
target
.
resource_bundle_targets
<<
bundle_target
if
target
.
should_build?
native_target
.
add_dependency
(
bundle_target
)
end
end
end
end
# Generates the contents of the xcconfig file and saves it to disk.
#
...
...
lib/cocoapods/target/pod_target.rb
View file @
3268bf72
...
...
@@ -21,6 +21,7 @@ module Pod
@sandbox
=
sandbox
@build_headers
=
Sandbox
::
HeadersStore
.
new
(
sandbox
,
'Private'
)
@file_accessors
=
[]
@resource_bundle_targets
=
[]
end
# @return [String] the label for the target.
...
...
@@ -34,6 +35,10 @@ module Pod
#
attr_accessor
:file_accessors
# @return [Array<PBXTarget>] the resource bundle targets belonging
# to this target.
attr_reader
:resource_bundle_targets
# @return [Bool] Whether or not this target should be build.
#
# A target should not be build if it has no source files.
...
...
cocoapods-integration-specs
@
3d83baf6
Subproject commit
626a25f5eb1ffa87af16521704b1a9a81e56be85
Subproject commit
3d83baf65d54e6abae10d480bdeb4f00a11e3682
spec/integration.rb
View file @
3268bf72
...
...
@@ -189,6 +189,11 @@ describe_cli 'pod' do
'install --no-repo-update'
end
describe
'Integrates a Pod without source files but with resources'
do
behaves_like
cli_spec
'install_resources_no_source_files'
,
'install --no-repo-update'
end
# @todo add tests for all the hooks API
#
describe
'Runs the Podfile callbacks'
do
...
...
spec/unit/installer_spec.rb
View file @
3268bf72
...
...
@@ -409,6 +409,23 @@ module Pod
describe
'#set_target_dependencies'
do
it
'sets resource bundles for not build pods as target dependencies of the user target'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
@installer
.
podfile
)
pod_target
=
PodTarget
.
new
([
spec
],
target_definition
,
config
.
sandbox
)
pod_target
.
stubs
(
:resource_bundle_targets
).
returns
([
'dummy'
])
pod_target
.
stubs
(
:should_build?
=>
false
)
target
=
AggregateTarget
.
new
(
target_definition
,
config
.
sandbox
)
mock_target
=
mock
mock_target
.
expects
(
:add_dependency
).
with
(
'dummy'
)
target
.
stubs
(
:native_target
).
returns
(
mock_target
)
target
.
stubs
(
:pod_targets
).
returns
([
pod_target
])
@installer
.
stubs
(
:aggregate_targets
).
returns
([
target
])
@installer
.
send
(
:set_target_dependencies
)
end
xit
'sets the pod targets as dependencies of the aggregate target'
do
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