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
d691d0bb
Commit
d691d0bb
authored
Sep 06, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean-up
parent
602d23f6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
28 deletions
+22
-28
file_references_installer.rb
...aller/pods_project_generator/file_references_installer.rb
+6
-12
target_installer.rb
...pods/installer/pods_project_generator/target_installer.rb
+5
-5
file_references_installer_spec.rb
.../pods_project_generator/file_references_installer_spec.rb
+11
-11
No files found.
lib/cocoapods/installer/pods_project_generator/file_references_installer.rb
View file @
d691d0bb
...
@@ -36,11 +36,11 @@ module Pod
...
@@ -36,11 +36,11 @@ module Pod
add_resources
add_resources
end
end
#-----------------------------------------------------------------------#
private
private
# @!group Installation Steps
# @!group Installation Steps
#---------------------------------------------------------------------#
# Reads the file accessors contents from the file system.
# Reads the file accessors contents from the file system.
#
#
...
@@ -103,17 +103,11 @@ module Pod
...
@@ -103,17 +103,11 @@ module Pod
end
end
#-----------------------------------------------------------------------#
private
private
# @!group Private Helpers
# @!group Private Helpers
#---------------------------------------------------------------------#
# TODO
#
def
pods_project
sandbox
.
project
end
# @return [Array<Sandbox::FileAccessor>] The file accessors for all the
# @return [Array<Sandbox::FileAccessor>] The file accessors for all the
# specs platform combinations.
# specs platform combinations.
...
@@ -138,15 +132,15 @@ module Pod
...
@@ -138,15 +132,15 @@ module Pod
file_accessors
.
each
do
|
file_accessor
|
file_accessors
.
each
do
|
file_accessor
|
paths
=
file_accessor
.
send
(
file_accessor_key
)
paths
=
file_accessor
.
send
(
file_accessor_key
)
paths
.
each
do
|
path
|
paths
.
each
do
|
path
|
group
=
pods_
project
.
group_for_spec
(
file_accessor
.
spec
.
name
,
group_key
)
group
=
sandbox
.
project
.
group_for_spec
(
file_accessor
.
spec
.
name
,
group_key
)
pods_
project
.
add_file_reference
(
path
,
group
)
sandbox
.
project
.
add_file_reference
(
path
,
group
)
end
end
end
end
end
end
#--
---------------------------------------------------------------------#
#
---------------------------------------------------------------------#
end
end
end
end
end
end
end
end
lib/cocoapods/installer/pods_project_generator/target_installer.rb
View file @
d691d0bb
...
@@ -25,11 +25,11 @@ module Pod
...
@@ -25,11 +25,11 @@ module Pod
@library
=
library
@library
=
library
end
end
private
#-----------------------------------------------------------------------#
private
# @!group Installation steps
# @!group Installation steps
#---------------------------------------------------------------------#
# Adds the target for the library to the Pods project with the
# Adds the target for the library to the Pods project with the
# appropriate build configurations.
# appropriate build configurations.
...
@@ -90,11 +90,11 @@ module Pod
...
@@ -90,11 +90,11 @@ module Pod
#
#
attr_reader
:target
attr_reader
:target
private
#-----------------------------------------------------------------------#
private
# @!group Private helpers.
# @!group Private helpers.
#---------------------------------------------------------------------#
# @return [Project] the Pods project of the sandbox.
# @return [Project] the Pods project of the sandbox.
#
#
...
@@ -128,6 +128,6 @@ module Pod
...
@@ -128,6 +128,6 @@ module Pod
end
end
end
end
end
end
end
end
spec/unit/installer/pods_project_generator/file_references_installer_spec.rb
View file @
d691d0bb
...
@@ -9,7 +9,7 @@ module Pod
...
@@ -9,7 +9,7 @@ module Pod
@pod_target
.
file_accessors
=
[
@file_accessor
]
@pod_target
.
file_accessors
=
[
@file_accessor
]
config
.
sandbox
.
project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
config
.
sandbox
.
project
=
Project
.
new
(
config
.
sandbox
.
project_path
)
config
.
sandbox
.
project
.
add_pod_group
(
'BananaLib'
,
fixture
(
'banana-lib'
))
config
.
sandbox
.
project
.
add_pod_group
(
'BananaLib'
,
fixture
(
'banana-lib'
))
@
installer
=
Installer
::
PodsProjectGenerator
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
@pod_target
])
@
sut
=
Installer
::
PodsProjectGenerator
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
@pod_target
])
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
@@ -19,18 +19,18 @@ module Pod
...
@@ -19,18 +19,18 @@ module Pod
it
"adds the files references of the source files the Pods project"
do
it
"adds the files references of the source files the Pods project"
do
@file_accessor
.
path_list
.
read_file_system
@file_accessor
.
path_list
.
read_file_system
@file_accessor
.
path_list
.
expects
(
:read_file_system
)
@file_accessor
.
path_list
.
expects
(
:read_file_system
)
@
installer
.
install!
@
sut
.
install!
end
end
it
"adds the files references of the source files the Pods project"
do
it
"adds the files references of the source files the Pods project"
do
@
installer
.
install!
@
sut
.
install!
file_ref
=
config
.
sandbox
.
project
[
'Pods/BananaLib/Source Files/Banana.m'
]
file_ref
=
config
.
sandbox
.
project
[
'Pods/BananaLib/Source Files/Banana.m'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
path
.
should
==
"Classes/Banana.m"
file_ref
.
path
.
should
==
"Classes/Banana.m"
end
end
it
"adds the file references of the frameworks of the project"
do
it
"adds the file references of the frameworks of the project"
do
@
installer
.
install!
@
sut
.
install!
group
=
config
.
sandbox
.
project
.
group_for_spec
(
'BananaLib'
,
:frameworks_and_libraries
)
group
=
config
.
sandbox
.
project
.
group_for_spec
(
'BananaLib'
,
:frameworks_and_libraries
)
file_ref
=
group
[
'Bananalib.framework'
]
file_ref
=
group
[
'Bananalib.framework'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
...
@@ -38,7 +38,7 @@ module Pod
...
@@ -38,7 +38,7 @@ module Pod
end
end
it
"adds the file references of the libraries of the project"
do
it
"adds the file references of the libraries of the project"
do
@
installer
.
install!
@
sut
.
install!
group
=
config
.
sandbox
.
project
.
group_for_spec
(
'BananaLib'
,
:frameworks_and_libraries
)
group
=
config
.
sandbox
.
project
.
group_for_spec
(
'BananaLib'
,
:frameworks_and_libraries
)
file_ref
=
group
[
'libBananalib.a'
]
file_ref
=
group
[
'libBananalib.a'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
...
@@ -46,7 +46,7 @@ module Pod
...
@@ -46,7 +46,7 @@ module Pod
end
end
it
"adds the files references of the resources the Pods project"
do
it
"adds the files references of the resources the Pods project"
do
@
installer
.
install!
@
sut
.
install!
file_ref
=
config
.
sandbox
.
project
[
'Pods/BananaLib/Resources/logo-sidebar.png'
]
file_ref
=
config
.
sandbox
.
project
[
'Pods/BananaLib/Resources/logo-sidebar.png'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
path
.
should
==
"Resources/logo-sidebar.png"
file_ref
.
path
.
should
==
"Resources/logo-sidebar.png"
...
@@ -64,23 +64,23 @@ module Pod
...
@@ -64,23 +64,23 @@ module Pod
pod_target_1
.
file_accessors
=
[
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)]
pod_target_1
.
file_accessors
=
[
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)]
pod_target_2
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
pod_target_2
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
pod_target_2
.
file_accessors
=
[
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)]
pod_target_2
.
file_accessors
=
[
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)]
installer
=
Installer
::
PodsProjectGenerator
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
,
pod_target_2
])
@sut
=
Installer
::
PodsProjectGenerator
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
,
pod_target_2
])
roots
=
installer
.
send
(
:file_accessors
).
map
{
|
fa
|
fa
.
path_list
.
root
}
roots
=
@sut
.
send
(
:file_accessors
).
map
{
|
fa
|
fa
.
path_list
.
root
}
roots
.
should
==
[
fixture
(
'banana-lib'
),
fixture
(
'banana-lib'
)]
roots
.
should
==
[
fixture
(
'banana-lib'
),
fixture
(
'banana-lib'
)]
end
end
it
"handles libraries empty libraries without file accessors"
do
it
"handles libraries empty libraries without file accessors"
do
pod_target_1
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
pod_target_1
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
pod_target_1
.
file_accessors
=
[]
pod_target_1
.
file_accessors
=
[]
installer
=
Installer
::
PodsProjectGenerator
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
])
@sut
=
Installer
::
PodsProjectGenerator
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
])
roots
=
installer
.
send
(
:file_accessors
).
should
==
[]
roots
=
@sut
.
send
(
:file_accessors
).
should
==
[]
end
end
end
end
describe
"#add_file_accessors_paths_to_pods_group"
do
describe
"#add_file_accessors_paths_to_pods_group"
do
it
"adds the paths of the paths of the file accessor corresponding to the given key to the Pods project"
do
it
"adds the paths of the paths of the file accessor corresponding to the given key to the Pods project"
do
@
installer
.
send
(
:add_file_accessors_paths_to_pods_group
,
:source_files
,
:source_files
)
@
sut
.
send
(
:add_file_accessors_paths_to_pods_group
,
:source_files
,
:source_files
)
group
=
config
.
sandbox
.
project
.
group_for_spec
(
'BananaLib'
,
:source_files
)
group
=
config
.
sandbox
.
project
.
group_for_spec
(
'BananaLib'
,
:source_files
)
group
.
children
.
map
(
&
:name
).
sort
.
should
==
[
"Banana.h"
,
"Banana.m"
,
"BananaPrivate.h"
]
group
.
children
.
map
(
&
:name
).
sort
.
should
==
[
"Banana.h"
,
"Banana.m"
,
"BananaPrivate.h"
]
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