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
279ff119
Commit
279ff119
authored
May 08, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EmbedFrameworksScript] Be agnostic about target-specific build products
parent
ef5f9a4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
19 deletions
+11
-19
embed_frameworks_script.rb
lib/cocoapods/generator/embed_frameworks_script.rb
+4
-13
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+4
-2
embed_frameworks_script_spec.rb
spec/unit/generator/embed_frameworks_script_spec.rb
+3
-4
No files found.
lib/cocoapods/generator/embed_frameworks_script.rb
View file @
279ff119
module
Pod
module
Generator
class
EmbedFrameworksScript
# @return [TargetDefinition] The target definition, whose label will be
# used to locate the target-specific build products.
#
attr_reader
:target_definition
# @return [Hash{String, Array{String}] Multiple lists of frameworks per
# configuration.
#
attr_reader
:frameworks_by_config
# @param [TargetDefinition] target_definition
# @see #target_definition
#
# @param [Hash{String, Array{String}] frameworks_by_config
# @see #frameworks_by_config
#
def
initialize
(
target_definition
,
frameworks_by_config
)
@target_definition
=
target_definition
def
initialize
(
frameworks_by_config
)
@frameworks_by_config
=
frameworks_by_config
end
...
...
@@ -54,7 +45,7 @@ module Pod
install_framework()
{
local source="${BUILT_PRODUCTS_DIR}/
#{
target_definition
.
label
}
/
$1"
local source="${BUILT_PRODUCTS_DIR}/$1"
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
...
...
@@ -72,9 +63,9 @@ module Pod
# Embed linked Swift runtime libraries
local basename
basename=$(
echo
$1 | sed -E s/
\\\\
..+// && exit ${PIPESTATUS[0]})
basename=$(
basename
$1 | sed -E s/
\\\\
..+// && exit ${PIPESTATUS[0]})
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$
1
/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath
\\\\
/
\\
(.+dylib
\\
).*/
\\\\
1/g | uniq -u && exit ${PIPESTATUS[0]})
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$
{basename}.framework
/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath
\\\\
/
\\
(.+dylib
\\
).*/
\\\\
1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv
\\
"${SWIFT_STDLIB_PATH}/${lib}
\\
"
\\
"${destination}
\\
""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
...
...
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
279ff119
...
...
@@ -140,9 +140,11 @@ module Pod
target
.
user_build_configurations
.
keys
.
each
do
|
config
|
frameworks_by_config
[
config
]
=
target
.
pod_targets
.
select
do
|
pod_target
|
pod_target
.
include_in_build_config?
(
config
)
&&
pod_target
.
should_build?
end
.
map
(
&
:product_name
)
end
.
map
do
|
pod_target
|
"
#{
target_definition
.
label
}
/
#{
pod_target
.
product_name
}
"
end
end
generator
=
Generator
::
EmbedFrameworksScript
.
new
(
target_definition
,
frameworks_by_config
)
generator
=
Generator
::
EmbedFrameworksScript
.
new
(
frameworks_by_config
)
generator
.
save_as
(
path
)
add_file_to_support_group
(
path
)
end
...
...
spec/unit/generator/embed_frameworks_script_spec.rb
View file @
279ff119
...
...
@@ -3,15 +3,14 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Generator
::
EmbedFrameworksScript
do
it
'returns the embed frameworks script'
do
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
nil
)
frameworks
=
{
'Debug'
=>
%w(Loopback.framework Reveal.framework)
,
'Debug'
=>
%w(
Pods/
Loopback.framework Reveal.framework)
,
'Release'
=>
%w(CrashlyticsFramework.framework)
,
}
generator
=
Pod
::
Generator
::
EmbedFrameworksScript
.
new
(
target_definition
,
frameworks
)
generator
=
Pod
::
Generator
::
EmbedFrameworksScript
.
new
(
frameworks
)
generator
.
send
(
:script
).
should
.
include
<<-
eos
.
strip_heredoc
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework 'Loopback.framework'
install_framework '
Pods/
Loopback.framework'
install_framework 'Reveal.framework'
fi
eos
...
...
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