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
5b30b397
Commit
5b30b397
authored
Aug 16, 2013
by
Eloy Durán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Add all the user's build configurations to the Pods project.
parent
d791a305
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
installer.rb
lib/cocoapods/installer.rb
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+28
-12
No files found.
lib/cocoapods/installer.rb
View file @
5b30b397
...
...
@@ -285,7 +285,7 @@ module Pod
#
def
prepare_pods_project
UI
.
message
"- Creating Pods project"
do
@pods_project
=
Pod
::
Project
.
new
(
sandbox
,
@podfile
.
target_definitions
[
'Pods'
].
build_configurations
)
@pods_project
=
Pod
::
Project
.
new
(
sandbox
,
analysis_result
.
all_user_
build_configurations
)
if
config
.
podfile_path
@pods_project
.
add_podfile
(
config
.
podfile_path
)
end
...
...
spec/unit/installer_spec.rb
View file @
5b30b397
...
...
@@ -16,7 +16,7 @@ end
def
generate_podfile
(
pods
=
[
'JSONKit'
])
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
xcodeproj
'SampleProject/SampleProject'
,
'Debug'
=>
:debug
,
'Test'
=>
:debug
,
'Release'
=>
:release
,
'App Store'
=>
:release
xcodeproj
SpecHelper
.
fixture
(
'SampleProject/SampleProject'
),
'Test'
=>
:debug
,
'App Store'
=>
:release
pods
.
each
{
|
name
|
pod
name
}
end
end
...
...
@@ -112,7 +112,7 @@ module Pod
@installer
.
pod_targets
.
map
(
&
:name
).
sort
.
should
==
[
'Pods-JSONKit'
]
end
it
"configures the anal
i
zer to use update mode if appropriate"
do
it
"configures the anal
y
zer to use update mode if appropriate"
do
@installer
.
update_mode
=
true
Installer
::
Analyzer
.
any_instance
.
expects
(
:update_mode
=
).
with
(
true
)
@installer
.
send
(
:analyze
)
...
...
@@ -217,14 +217,37 @@ module Pod
describe
"#prepare_pods_project"
do
it
"creates the Pods project"
do
before
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
end
it
"creates build configurations for all of the user's targets"
do
config
.
integrate_targets
=
true
@installer
.
send
(
:analyze
)
@installer
.
send
(
:prepare_pods_project
)
@installer
.
pods_project
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
[
'App Store'
,
'Debug'
,
'Release'
,
'Test'
]
end
it
"sets STRIP_INSTALLED_PRODUCT to NO for all configurations for the whole project"
do
config
.
integrate_targets
=
true
@installer
.
send
(
:analyze
)
@installer
.
send
(
:prepare_pods_project
)
@installer
.
pods_project
.
build_settings
(
'Debug'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
@installer
.
pods_project
.
build_settings
(
'Test'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
@installer
.
pods_project
.
build_settings
(
'Release'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
@installer
.
pods_project
.
build_settings
(
'App Store'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
end
before
do
@installer
.
stubs
(
:analysis_result
).
returns
(
stub
(
:all_user_build_configurations
=>
{}))
end
it
"creates the Pods project"
do
@installer
.
send
(
:prepare_pods_project
)
@installer
.
pods_project
.
class
.
should
==
Pod
::
Project
end
it
"adds the Podfile to the Pods project"
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
config
.
stubs
(
:podfile_path
).
returns
(
Pathname
.
new
(
'/Podfile'
))
@installer
.
send
(
:prepare_pods_project
)
@installer
.
pods_project
[
'Podfile'
].
should
.
be
.
not
.
nil
...
...
@@ -244,14 +267,6 @@ module Pod
end
end
it
"sets STRIP_INSTALLED_PRODUCT to NO for all configurations for the whole project"
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
@installer
.
send
(
:prepare_pods_project
)
@installer
.
pods_project
.
build_settings
(
'Debug'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
@installer
.
pods_project
.
build_settings
(
'Test'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
@installer
.
pods_project
.
build_settings
(
'Release'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
@installer
.
pods_project
.
build_settings
(
'App Store'
)[
"STRIP_INSTALLED_PRODUCT"
].
should
==
"NO"
end
end
#--------------------------------------#
...
...
@@ -317,6 +332,7 @@ module Pod
before
do
@installer
.
stubs
(
:aggregate_targets
).
returns
([])
@installer
.
stubs
(
:analysis_result
).
returns
(
stub
(
:all_user_build_configurations
=>
{}))
@installer
.
send
(
:prepare_pods_project
)
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