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
c1e679fe
Commit
c1e679fe
authored
Mar 13, 2015
by
AliSoftware
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[xcassets] First steps in adding resources to the user's project and targets (WIP)
parent
140c49aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+32
-1
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
c1e679fe
...
...
@@ -30,6 +30,7 @@ module Pod
# TODO: refactor into Xcodeproj https://github.com/CocoaPods/Xcodeproj/issues/202
project_is_dirty
=
[
XCConfigIntegrator
.
integrate
(
target
,
native_targets
),
add_pods_resources
,
update_to_cocoapods_0_34
,
remove_embed_frameworks_script_phases
,
unless
native_targets_to_integrate
.
empty?
...
...
@@ -130,6 +131,36 @@ module Pod
end
end
# Add a reference to pods' resources (like xcassets) to the user target
#
# @return [void]
#
def
add_pods_resources
UI
.
puts
"- User targets being integrated:
#{
native_targets
.
map
(
&
:name
).
inspect
}
"
UI
.
puts
"- Pod Targets =
#{
target
.
pod_targets
.
map
(
&
:name
)
}
"
target
.
pod_targets
.
each
do
|
pod_target
|
pod_name
=
pod_target
.
pod_name
resource_files
=
pod_target
.
file_accessors
.
flat_map
(
&
:resources
)
resource_files
.
each
do
|
resource_path
|
UI
.
puts
" - Adding
#{
resource_path
}
to user project"
relative_path
=
resource_path
.
relative_path_from
(
target
.
client_root
).
to_s
pods_group
=
user_project
[
'Pods'
]
||
user_project
.
new_group
(
'Pods'
)
pod_subgroup
=
pods_group
[
pod_name
]
||
pods_group
.
new_group
(
pod_name
)
file_ref
=
pod_subgroup
.
files
.
find
{
|
f
|
f
.
path
==
relative_path
}
file_ref
||=
pod_subgroup
.
new_file
(
relative_path
)
UI
.
puts
" - Adding
#{
resource_path
.
basename
}
to targets
#{
native_targets
.
map
(
&
:name
)
}
"
native_targets
.
each
do
|
user_target
|
user_target
.
add_file_references
([
file_ref
])
end
end
end
# TODO: Remove code in FileReferencesInstaller#add_resource that adds resources to the Pods.xcodeproj
# TODO: Remove Pods-resources.sh (completely or partially?)
end
# Find or create a 'Embed Pods Frameworks' Copy Files Build Phase
#
# @return [void]
...
...
@@ -256,7 +287,7 @@ module Pod
# @return [Specification::Consumer] the consumer for the specifications.
#
def
spec_consumers
@spec_consumers
||=
target
.
pod_targets
.
map
(
&
:file_accessors
).
flatten
.
map
(
&
:spec_consumer
)
@spec_consumers
||=
target
.
pod_targets
.
flat_map
(
&
:file_accessors
)
.
map
(
&
:spec_consumer
)
end
# @return [String] the message that should be displayed for the target
...
...
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