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
81d3550d
Commit
81d3550d
authored
May 06, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actually add the user's build configurations to Pods.xcodeproj.
Closes #105, #121, #215.
parent
a0a15ccc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
6 deletions
+33
-6
CHANGELOG.md
CHANGELOG.md
+11
-1
installer.rb
lib/cocoapods/installer.rb
+1
-0
podfile.rb
lib/cocoapods/podfile.rb
+1
-1
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+7
-2
installer_spec.rb
spec/unit/installer_spec.rb
+13
-2
No files found.
CHANGELOG.md
View file @
81d3550d
...
@@ -19,7 +19,7 @@ link_with ['MyAppTarget', 'MyOtherAppTarget']
...
@@ -19,7 +19,7 @@ link_with ['MyAppTarget', 'MyOtherAppTarget']
dependency
'JSONKit'
dependency
'JSONKit'
target
:test
,
:exclusive
=>
true
do
target
:test
,
:exclusive
=>
true
do
xcodeproj
'TestProject'
xcodeproj
'TestProject'
,
'Test'
=>
:debug
link_with
'TestRunnerTarget'
link_with
'TestRunnerTarget'
dependency
'Kiwi'
dependency
'Kiwi'
end
end
...
@@ -42,6 +42,16 @@ need to specify the target to link with.
...
@@ -42,6 +42,16 @@ need to specify the target to link with.
See
[
#76
](
https://github.com/CocoaPods/CocoaPods/issues/76
)
for more info.
See
[
#76
](
https://github.com/CocoaPods/CocoaPods/issues/76
)
for more info.
Finally, CocoaPods will add build configurations to the Pods project for all
configurations in the other projects in the workspace. By default the
configurations are based on the
`Release`
configuration, to base them on the
`Debug`
configuration you will have to explicitely specify them as can be seen
above in the following line:
```
ruby
xcodeproj
'TestProject'
,
'Test'
=>
:debug
```
### Documentation
### Documentation
...
...
lib/cocoapods/installer.rb
View file @
81d3550d
...
@@ -25,6 +25,7 @@ module Pod
...
@@ -25,6 +25,7 @@ module Pod
def
project
def
project
return
@project
if
@project
return
@project
if
@project
@project
=
Pod
::
Project
.
new
@project
=
Pod
::
Project
.
new
@project
.
user_build_configurations
=
@podfile
.
user_build_configurations
activated_pods
.
each
do
|
pod
|
activated_pods
.
each
do
|
pod
|
# Add all source files to the project grouped by pod
# Add all source files to the project grouped by pod
group
=
@project
.
add_pod_group
(
pod
.
name
)
group
=
@project
.
add_pod_group
(
pod
.
name
)
...
...
lib/cocoapods/podfile.rb
View file @
81d3550d
...
@@ -29,7 +29,7 @@ module Pod
...
@@ -29,7 +29,7 @@ module Pod
end
end
def
project
def
project
Xcodeproj
::
Project
.
new
(
path
)
if
path
Xcodeproj
::
Project
.
new
(
path
)
if
path
&&
path
.
exist?
end
end
def
build_configurations
def
build_configurations
...
...
spec/unit/installer/target_installer_spec.rb
View file @
81d3550d
...
@@ -32,7 +32,13 @@ describe Pod::Installer::TargetInstaller do
...
@@ -32,7 +32,13 @@ describe Pod::Installer::TargetInstaller do
@project
.
targets
.
count
.
should
==
1
@project
.
targets
.
count
.
should
==
1
@project
.
targets
.
first
.
name
.
should
==
@target_definition
.
label
@project
.
targets
.
first
.
name
.
should
==
@target_definition
.
label
end
end
it
"adds the user's build configurations to the target"
do
@project
.
user_build_configurations
=
{
'Debug'
=>
:debug
,
'Release'
=>
:release
,
'AppStore'
=>
:release
,
'Test'
=>
:debug
}
do_install!
@project
.
targets
.
first
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
%w{ AppStore Debug Release Test }
end
it
'adds each pod to the static library target'
do
it
'adds each pod to the static library target'
do
@pods
[
0
].
expects
(
:add_to_target
).
with
(
instance_of
(
Xcodeproj
::
Project
::
Object
::
PBXNativeTarget
))
@pods
[
0
].
expects
(
:add_to_target
).
with
(
instance_of
(
Xcodeproj
::
Project
::
Object
::
PBXNativeTarget
))
do_install!
do_install!
...
@@ -48,7 +54,6 @@ describe Pod::Installer::TargetInstaller do
...
@@ -48,7 +54,6 @@ describe Pod::Installer::TargetInstaller do
@installer
.
xcconfig
.
to_hash
[
'HEADER_SEARCH_PATHS'
].
should
.
include
(
"
\"
#{
@sandbox
.
header_search_paths
.
join
(
'" "'
)
}
\"
"
)
@installer
.
xcconfig
.
to_hash
[
'HEADER_SEARCH_PATHS'
].
should
.
include
(
"
\"
#{
@sandbox
.
header_search_paths
.
join
(
'" "'
)
}
\"
"
)
end
end
it
'does not add the -fobjc-arc to OTHER_LDFLAGS by default as Xcode 4.3.2 does not support it'
do
it
'does not add the -fobjc-arc to OTHER_LDFLAGS by default as Xcode 4.3.2 does not support it'
do
do_install!
do_install!
@installer
.
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
split
(
" "
).
should
.
not
.
include
(
"-fobjc-arc"
)
@installer
.
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
split
(
" "
).
should
.
not
.
include
(
"-fobjc-arc"
)
...
...
spec/unit/installer_spec.rb
View file @
81d3550d
...
@@ -15,11 +15,12 @@ describe "Pod::Installer" do
...
@@ -15,11 +15,12 @@ describe "Pod::Installer" do
describe
", by default,"
do
describe
", by default,"
do
before
do
before
do
@xcconfig
=
Pod
::
Installer
.
new
(
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
platform
:ios
xcodeproj
'MyProject'
xcodeproj
'MyProject'
dependency
'JSONKit'
dependency
'JSONKit'
end
).
target_installers
.
first
.
xcconfig
.
to_hash
end
@xcconfig
=
Pod
::
Installer
.
new
(
podfile
).
target_installers
.
first
.
xcconfig
.
to_hash
end
end
it
"sets the header search paths where installed Pod headers can be found"
do
it
"sets the header search paths where installed Pod headers can be found"
do
...
@@ -59,4 +60,14 @@ describe "Pod::Installer" do
...
@@ -59,4 +60,14 @@ describe "Pod::Installer" do
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
target_installers
.
map
(
&
:target_definition
).
map
(
&
:name
).
should
==
[
:not_empty
]
installer
.
target_installers
.
map
(
&
:target_definition
).
map
(
&
:name
).
should
==
[
:not_empty
]
end
end
it
"adds the user's build configurations"
do
path
=
fixture
(
'SampleProject/SampleProject.xcodeproj'
)
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
xcodeproj
path
,
'App Store'
=>
:release
end
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
project
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
[
'App Store'
,
'Debug'
,
'Release'
,
'Test'
]
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