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
5adc5c74
Commit
5adc5c74
authored
May 21, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Xcconfig] Refactor file structure
parent
1b09daca
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
154 additions
and
120 deletions
+154
-120
cocoapods.rb
lib/cocoapods.rb
+4
-3
xcconfig.rb
lib/cocoapods/generator/xcconfig.rb
+0
-117
aggregate_xcconfig.rb
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+46
-0
private_pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb
+44
-0
public_pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/public_pod_xcconfig.rb
+39
-0
aggregate_xcconfig_spec.rb
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
+7
-0
private_pod_xcconfig_spec.rb
spec/unit/generator/xcconfig/private_pod_xcconfig_spec.rb
+7
-0
public_pod_xcconfig_spec.rb
spec/unit/generator/xcconfig/public_pod_xcconfig_spec.rb
+7
-0
No files found.
lib/cocoapods.rb
View file @
5adc5c74
...
...
@@ -62,9 +62,10 @@ module Pod
autoload
:DummySource
,
'cocoapods/generator/dummy_source'
autoload
:PrefixHeader
,
'cocoapods/generator/prefix_header'
autoload
:TargetEnvironmentHeader
,
'cocoapods/generator/target_environment_header'
autoload
:AggregateXCConfig
,
'cocoapods/generator/xcconfig'
autoload
:PublicPodXCConfig
,
'cocoapods/generator/xcconfig'
autoload
:PrivatePodXCConfig
,
'cocoapods/generator/xcconfig'
autoload
:XCConfig
,
'cocoapods/generator/xcconfig'
autoload
:AggregateXCConfig
,
'cocoapods/generator/xcconfig/aggregate_xcconfig'
autoload
:PublicPodXCConfig
,
'cocoapods/generator/xcconfig/public_pod_xcconfig'
autoload
:PrivatePodXCConfig
,
'cocoapods/generator/xcconfig/private_pod_xcconfig'
end
module
Hooks
...
...
lib/cocoapods/generator/xcconfig.rb
View file @
5adc5c74
...
...
@@ -111,123 +111,6 @@ module Pod
#-----------------------------------------------------------------------#
end
#-------------------------------------------------------------------------#
class
AggregateXCConfig
<
XCConfig
# Generates the xcconfig for the Pod integration target.
#
# @note The xcconfig file for a Pods integration target includes the
# namespaced xcconfig files for each spec target dependency.
# Each namespaced configuration value is merged into the Pod
# xcconfig file.
#
# @return [Xcodeproj::Config]
#
def
generate
ld_flags
=
'-ObjC'
if
aggregate_target
.
target_definition
.
podfile
.
set_arc_compatibility_flag?
ld_flags
<<
' -fobjc-arc'
end
config
=
{
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
ld_flags
,
'HEADER_SEARCH_PATHS'
=>
quote
(
sandbox
.
public_headers
.
search_paths
),
'PODS_ROOT'
=>
aggregate_target
.
relative_pods_root
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'$(inherited) COCOAPODS=1'
,
}
aggregate_target
.
pod_targets
.
each
do
|
lib
|
consumer_xcconfig
(
lib
.
consumer
).
to_hash
.
each
do
|
k
,
v
|
prefixed_key
=
lib
.
xcconfig_prefix
+
k
config
[
k
]
=
"
#{
config
[
k
]
}
${
#{
prefixed_key
}
}"
end
end
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
@xcconfig
.
includes
=
aggregate_target
.
pod_targets
.
map
(
&
:name
)
@xcconfig
end
end
#-------------------------------------------------------------------------#
class
PublicPodXCConfig
<
XCConfig
# Generates and saves the xcconfig to the given path.
#
# @param [Pathname] path
# the path where the prefix header should be stored.
#
# @note The public xcconfig file for a spec target is completely
# namespaced to prevent configuration value collision with other
# spec configurations.
#
# @return [void]
#
def
save_as
(
path
)
generate
.
save_as
(
path
,
aggregate_target
.
xcconfig_prefix
)
end
# Generates the xcconfig for the aggregate_target.
#
# @note The xcconfig file for a public spec target includes the
# standard podspec defined values including libraries,
# frameworks, weak frameworks and xcconfig overrides.
#
# @return [Xcodeproj::Config]
#
def
generate
@xcconfig
=
consumer_xcconfig
(
aggregate_target
.
consumer
)
@xcconfig
end
end
#-------------------------------------------------------------------------#
class
PrivatePodXCConfig
<
XCConfig
# Generates the xcconfig for the aggregate_target.
#
# @note The private xcconfig file for a spec target includes the public
# namespaced xcconfig file and merges the configuration values
# with the default private configuration values.
#
# @return [Xcodeproj::Config]
#
def
generate
ld_flags
=
'-ObjC'
if
aggregate_target
.
consumer
.
requires_arc?
ld_flags
<<
' -fobjc-arc'
end
config
=
{
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
ld_flags
,
'PODS_ROOT'
=>
'${SRCROOT}'
,
'HEADER_SEARCH_PATHS'
=>
quote
(
aggregate_target
.
build_headers
.
search_paths
)
+
' '
+
quote
(
sandbox
.
public_headers
.
search_paths
),
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'COCOAPODS=1'
,
# 'USE_HEADERMAP' => 'NO'
}
consumer_xcconfig
(
aggregate_target
.
consumer
).
to_hash
.
each
do
|
k
,
v
|
prefixed_key
=
aggregate_target
.
xcconfig_prefix
+
k
config
[
k
]
=
"
#{
config
[
k
]
}
${
#{
prefixed_key
}
}"
end
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
@xcconfig
.
includes
=
[
aggregate_target
.
name
]
@xcconfig
end
end
#-------------------------------------------------------------------------#
end
end
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
0 → 100644
View file @
5adc5c74
module
Pod
module
Generator
#
class
AggregateXCConfig
<
XCConfig
# Generates the xcconfig for the Pod integration target.
#
# @note The xcconfig file for a Pods integration target includes the
# namespaced xcconfig files for each spec target dependency.
# Each namespaced configuration value is merged into the Pod
# xcconfig file.
#
# @return [Xcodeproj::Config]
#
def
generate
ld_flags
=
'-ObjC'
if
aggregate_target
.
target_definition
.
podfile
.
set_arc_compatibility_flag?
ld_flags
<<
' -fobjc-arc'
end
config
=
{
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
ld_flags
,
'HEADER_SEARCH_PATHS'
=>
quote
(
sandbox
.
public_headers
.
search_paths
),
'PODS_ROOT'
=>
aggregate_target
.
relative_pods_root
,
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'$(inherited) COCOAPODS=1'
,
}
aggregate_target
.
pod_targets
.
each
do
|
lib
|
consumer_xcconfig
(
lib
.
consumer
).
to_hash
.
each
do
|
k
,
v
|
prefixed_key
=
lib
.
xcconfig_prefix
+
k
config
[
k
]
=
"
#{
config
[
k
]
}
${
#{
prefixed_key
}
}"
end
end
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
@xcconfig
.
includes
=
aggregate_target
.
pod_targets
.
map
(
&
:name
)
@xcconfig
end
#-----------------------------------------------------------------------#
end
end
end
lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb
0 → 100644
View file @
5adc5c74
module
Pod
module
Generator
#
class
PrivatePodXCConfig
<
XCConfig
# Generates the xcconfig for the aggregate_target.
#
# @note The private xcconfig file for a spec target includes the public
# namespaced xcconfig file and merges the configuration values
# with the default private configuration values.
#
# @return [Xcodeproj::Config]
#
def
generate
ld_flags
=
'-ObjC'
if
aggregate_target
.
consumer
.
requires_arc?
ld_flags
<<
' -fobjc-arc'
end
config
=
{
'ALWAYS_SEARCH_USER_PATHS'
=>
'YES'
,
'OTHER_LDFLAGS'
=>
ld_flags
,
'PODS_ROOT'
=>
'${SRCROOT}'
,
'HEADER_SEARCH_PATHS'
=>
quote
(
aggregate_target
.
build_headers
.
search_paths
)
+
' '
+
quote
(
sandbox
.
public_headers
.
search_paths
),
'GCC_PREPROCESSOR_DEFINITIONS'
=>
'COCOAPODS=1'
,
# 'USE_HEADERMAP' => 'NO'
}
consumer_xcconfig
(
aggregate_target
.
consumer
).
to_hash
.
each
do
|
k
,
v
|
prefixed_key
=
aggregate_target
.
xcconfig_prefix
+
k
config
[
k
]
=
"
#{
config
[
k
]
}
${
#{
prefixed_key
}
}"
end
@xcconfig
=
Xcodeproj
::
Config
.
new
(
config
)
@xcconfig
.
includes
=
[
aggregate_target
.
name
]
@xcconfig
end
#-----------------------------------------------------------------------#
end
end
end
lib/cocoapods/generator/xcconfig/public_pod_xcconfig.rb
0 → 100644
View file @
5adc5c74
module
Pod
module
Generator
#
class
PublicPodXCConfig
<
XCConfig
# Generates and saves the xcconfig to the given path.
#
# @param [Pathname] path
# the path where the prefix header should be stored.
#
# @note The public xcconfig file for a spec target is completely
# namespaced to prevent configuration value collision with other
# spec configurations.
#
# @return [void]
#
def
save_as
(
path
)
generate
.
save_as
(
path
,
aggregate_target
.
xcconfig_prefix
)
end
# Generates the xcconfig for the aggregate_target.
#
# @note The xcconfig file for a public spec target includes the
# standard podspec defined values including libraries,
# frameworks, weak frameworks and xcconfig overrides.
#
# @return [Xcodeproj::Config]
#
def
generate
@xcconfig
=
consumer_xcconfig
(
aggregate_target
.
consumer
)
@xcconfig
end
#-----------------------------------------------------------------------#
end
end
end
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
0 → 100644
View file @
5adc5c74
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Generator
::
AggregateXCConfig
do
end
end
spec/unit/generator/xcconfig/private_pod_xcconfig_spec.rb
0 → 100644
View file @
5adc5c74
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Generator
::
PrivatePodXCConfig
do
end
end
spec/unit/generator/xcconfig/public_pod_xcconfig_spec.rb
0 → 100644
View file @
5adc5c74
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Generator
::
PublicPodXCConfig
do
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