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
170ba7dc
Commit
170ba7dc
authored
Feb 08, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Combine helper methods for build dir
parent
74aef542
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
28 deletions
+13
-28
aggregate_xcconfig.rb
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+1
-1
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+5
-5
pod_target.rb
lib/cocoapods/target/pod_target.rb
+3
-20
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+4
-2
No files found.
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
View file @
170ba7dc
...
@@ -97,7 +97,7 @@ module Pod
...
@@ -97,7 +97,7 @@ module Pod
if
target
.
requires_frameworks?
if
target
.
requires_frameworks?
build_pod_targets
=
pod_targets
.
select
(
&
:should_build?
)
build_pod_targets
=
pod_targets
.
select
(
&
:should_build?
)
framework_header_search_paths
=
build_pod_targets
.
map
do
|
target
|
framework_header_search_paths
=
build_pod_targets
.
map
do
|
target
|
"
#{
target
.
relative_
configuration_build_dir
}
/
#{
target
.
product_name
}
/Headers"
"
#{
target
.
configuration_build_dir
}
/
#{
target
.
product_name
}
/Headers"
end
end
build_settings
=
{
build_settings
=
{
# Make framework headers discoverable by `import "…"`
# Make framework headers discoverable by `import "…"`
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
170ba7dc
...
@@ -219,23 +219,23 @@ module Pod
...
@@ -219,23 +219,23 @@ module Pod
dependent_targets
=
dependent_targets
.
select
(
&
:should_build?
)
dependent_targets
=
dependent_targets
.
select
(
&
:should_build?
)
has_configuration_build_dir
=
target
.
respond_to?
(
:configuration_build_dir
)
has_configuration_build_dir
=
target
.
respond_to?
(
:configuration_build_dir
)
if
has_configuration_build_dir
if
has_configuration_build_dir
build_dir_var
=
"$
#{
SHARED_BUILD_DIR_VARIABLE
}
"
build_settings
=
{
build_settings
=
{
'CONFIGURATION_BUILD_DIR'
=>
target
.
configuration_build_dir
,
'CONFIGURATION_BUILD_DIR'
=>
target
.
configuration_build_dir
(
build_dir_var
)
,
SHARED_BUILD_DIR_VARIABLE
=>
'$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
,
SHARED_BUILD_DIR_VARIABLE
=>
'$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
,
}
}
build_dir_var
=
"$
#{
SHARED_BUILD_DIR_VARIABLE
}
"
else
else
build_settings
=
{}
build_dir_var
=
'$CONFIGURATION_BUILD_DIR'
build_dir_var
=
'$CONFIGURATION_BUILD_DIR'
build_settings
=
{}
end
end
unless
dependent_targets
.
empty?
unless
dependent_targets
.
empty?
framework_search_paths
=
[]
framework_search_paths
=
[]
library_search_paths
=
[]
library_search_paths
=
[]
dependent_targets
.
each
do
|
dependent_target
|
dependent_targets
.
each
do
|
dependent_target
|
if
dependent_target
.
requires_frameworks?
if
dependent_target
.
requires_frameworks?
framework_search_paths
<<
dependent_target
.
relative_
configuration_build_dir
(
build_dir_var
)
framework_search_paths
<<
dependent_target
.
configuration_build_dir
(
build_dir_var
)
else
else
library_search_paths
<<
dependent_target
.
relative_
configuration_build_dir
(
build_dir_var
)
library_search_paths
<<
dependent_target
.
configuration_build_dir
(
build_dir_var
)
end
end
end
end
build_settings
[
'FRAMEWORK_SEARCH_PATHS'
]
=
'$(inherited) '
+
XCConfigHelper
.
quote
(
framework_search_paths
.
uniq
)
unless
framework_search_paths
.
empty?
build_settings
[
'FRAMEWORK_SEARCH_PATHS'
]
=
'$(inherited) '
+
XCConfigHelper
.
quote
(
framework_search_paths
.
uniq
)
unless
framework_search_paths
.
empty?
...
...
lib/cocoapods/target/pod_target.rb
View file @
170ba7dc
...
@@ -249,32 +249,15 @@ module Pod
...
@@ -249,32 +249,15 @@ module Pod
end
end
end
end
# @return [String] The configuration build dir, relevant if the target is
# integrated as framework.
#
def
configuration_build_dir
if
scoped?
"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/
#{
scope_suffix
}
"
else
'$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
end
end
# @param [String] dir
# @param [String] dir
# The directory (which might be a variable) relative to which
# The directory (which might be a variable) relative to which
# the returned path should be. This must be used if the
# the returned path should be. This must be used if the
# $CONFIGURATION_BUILD_DIR is modified.
# $CONFIGURATION_BUILD_DIR is modified.
#
#
# @return [String] The configuration build dir, relative to the default
# @return [String] The absolute path to the configuration build dir
# configuration build dir, which is:
# '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
#
#
def
relative_configuration_build_dir
(
dir
=
'$CONFIGURATION_BUILD_DIR'
)
def
configuration_build_dir
(
dir
=
'$CONFIGURATION_BUILD_DIR'
)
if
scoped?
"
#{
dir
}
/
#{
pod_name
}#{
scoped?
?
"/
#{
scope_suffix
}
"
:
''
}
"
"
#{
dir
}
/
#{
pod_name
}
/
#{
scope_suffix
}
"
else
"
#{
dir
}
/
#{
pod_name
}
"
end
end
end
private
private
...
...
spec/unit/target/pod_target_spec.rb
View file @
170ba7dc
...
@@ -162,8 +162,10 @@ module Pod
...
@@ -162,8 +162,10 @@ module Pod
end
end
it
'returns the path for the CONFIGURATION_BUILD_DIR build setting'
do
it
'returns the path for the CONFIGURATION_BUILD_DIR build setting'
do
@pod_target
.
configuration_build_dir
.
should
==
'$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
@pod_target
.
configuration_build_dir
.
should
==
'$CONFIGURATION_BUILD_DIR/BananaLib'
@pod_target
.
scoped
.
first
.
configuration_build_dir
.
should
==
'$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods'
@pod_target
.
scoped
.
first
.
configuration_build_dir
.
should
==
'$CONFIGURATION_BUILD_DIR/BananaLib/Pods'
@pod_target
.
configuration_build_dir
(
'$PODS_SHARED_BUILD_DIR'
).
should
==
'$PODS_SHARED_BUILD_DIR/BananaLib'
@pod_target
.
scoped
.
first
.
configuration_build_dir
(
'$PODS_SHARED_BUILD_DIR'
).
should
==
'$PODS_SHARED_BUILD_DIR/BananaLib/Pods'
end
end
end
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