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
de011ef4
Commit
de011ef4
authored
Aug 22, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Sandbox] Reorganize structure
parent
3f5690c7
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
139 additions
and
140 deletions
+139
-140
sandbox.rb
lib/cocoapods/sandbox.rb
+43
-49
headers_store.rb
lib/cocoapods/sandbox/headers_store.rb
+1
-1
target.rb
lib/cocoapods/target.rb
+1
-1
aggregate_target.rb
lib/cocoapods/target/aggregate_target.rb
+1
-1
pod_target.rb
lib/cocoapods/target/pod_target.rb
+1
-1
abstract_external_source_spec.rb
spec/unit/external_sources/abstract_external_source_spec.rb
+0
-1
aggregate_xcconfig_spec.rb
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
+2
-2
library_representation_spec.rb
spec/unit/hooks/library_representation_spec.rb
+2
-2
sandbox_analyzer_spec.rb
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
+2
-2
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+1
-1
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+22
-22
aggregate_target_installer_spec.rb
...aller/target_installer/aggregate_target_installer_spec.rb
+11
-7
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+5
-3
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+1
-1
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+6
-6
installer_spec.rb
spec/unit/installer_spec.rb
+2
-2
library_spec.rb
spec/unit/library_spec.rb
+8
-8
project_spec.rb
spec/unit/project_spec.rb
+1
-1
headers_store_spec.rb
spec/unit/sandbox/headers_store_spec.rb
+4
-4
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+11
-11
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+8
-8
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+6
-6
No files found.
lib/cocoapods/sandbox.rb
View file @
de011ef4
...
...
@@ -11,38 +11,30 @@ module Pod
#
# Pods
# |
# +-- User
# | +-- [Target Name]-configuration.h
# | +-- Specs
# | +-- Scripts
# +-- Headers
# | +-- Private
# | | +-- [Pod Name]
# | +-- Public
# | +-- [Pod Name]
# |
# +-- Generated
# +-- Headers
# | +-- Private
# | | +-- [Pod Name]
# | +-- Public
# | +-- [Pod Name]
# |
# +-- Sources
# | +-- [Pod Name]
# |
# +-- Specs
# | +-- External Sources
# | +-- Normal Sources
# |
# +-- Target Support Files
# | +-- [Target Name]
# | +-- Pods-acknowledgements.markdown
# | +-- Pods-acknowledgements.plist
# | +-- Pods-dummy.m
# | +-- Pods-prefix.pch
# | +-- Pods.xcconfig
# |
# +-- Manifest.lock
# |
# +-- Pods.xcodeproj
#
# See #833
# +-- Local Podspecs
# | +-- External Sources
# | +-- Normal Sources
# |
# +-- Target Support Files
# | +-- [Target Name]
# | +-- Pods-acknowledgements.markdown
# | +-- Pods-acknowledgements.plist
# | +-- Pods-dummy.m
# | +-- Pods-prefix.pch
# | +-- Pods.xcconfig
# |
# +-- Sources
# | +-- [Pod Name]
# |
# +-- Manifest.lock
# |
# +-- Pods.xcodeproj
#
class
Sandbox
autoload
:FileAccessor
,
'cocoapods/sandbox/file_accessor'
...
...
@@ -62,13 +54,15 @@ module Pod
def
initialize
(
root
)
FileUtils
.
mkdir_p
(
root
)
@root
=
Pathname
.
new
(
root
).
realpath
@public_headers
=
HeadersStore
.
new
(
self
,
'
Headers
'
)
@public_headers
=
HeadersStore
.
new
(
self
,
'
Public
'
)
@predownloaded_pods
=
[]
@head_pods
=
[]
@checkout_sources
=
{}
@development_pods
=
{}
@pods_with_absolute_path
=
[]
FileUtils
.
mkdir_p
(
generated_dir_root
)
FileUtils
.
mkdir_p
(
headers_root
)
FileUtils
.
mkdir_p
(
sources_root
)
FileUtils
.
mkdir_p
(
target_support_files_root
)
end
# @return [Lockfile] the manifest which contains the information about the
...
...
@@ -111,13 +105,13 @@ module Pod
# @return [Pathname] the path of the manifest.
#
def
manifest_path
generated_dir_
root
+
"Manifest.lock"
root
+
"Manifest.lock"
end
# @return [Pathname] the path of the Pods project.
#
def
project_path
generated_dir_
root
+
"Pods.xcodeproj"
root
+
"Pods.xcodeproj"
end
# Returns the path for the directory where to store the support files of
...
...
@@ -128,9 +122,8 @@ module Pod
#
# @return [Pathname] the path of the support files.
#
def
library_support_files_dir
(
_name
)
# root + "Target Support Files/#{name}"
generated_dir_root
def
target_support_files_dir
(
_name
)
target_support_files_root
end
# Returns the path where the Pod with the given name is stored, taking into
...
...
@@ -160,22 +153,24 @@ module Pod
@pods_with_absolute_path
.
include?
name
end
# @return [Pathname]
# @return [Pathname]
The directory where to store the headers.
#
def
generated_dir
_root
root
+
'
Generated
'
def
headers
_root
root
+
'
Headers
'
end
# @return [Pathname]
# @return [Pathname] The directory where to store the downloaded sources of
# the Pods.
#
def
header
s_root
generated_dir_root
+
'Header
s'
def
source
s_root
root
+
'Source
s'
end
# @return [Pathname]
# @return [Pathname] The directory where to store the files generated by
# CocoaPods to support the umbrella targets.
#
def
sourc
es_root
generated_dir_root
+
'Sourc
es'
def
target_support_fil
es_root
root
+
'Target Support Fil
es'
end
#-------------------------------------------------------------------------#
...
...
@@ -205,8 +200,7 @@ module Pod
# Two folders should be created `External Sources` and `Podspecs`.
#
def
specifications_dir
(
_external_source
=
false
)
# root + "Specifications"
generated_dir_root
+
"Local Podspecs"
root
+
"Local Podspecs"
end
# Returns the path of the specification for the Pod with the
...
...
lib/cocoapods/sandbox/headers_store.rb
View file @
de011ef4
...
...
@@ -31,7 +31,7 @@ module Pod
# root with the `${PODS_ROOT}` variable.
#
def
search_paths
headers_dir
=
root
.
relative_path_from
(
sandbox
.
generated_dir_
root
).
dirname
headers_dir
=
root
.
relative_path_from
(
sandbox
.
root
).
dirname
@search_paths
.
uniq
.
map
{
|
path
|
"${PODS_ROOT}/
#{
headers_dir
}
/
#{
path
}
"
}
end
...
...
lib/cocoapods/target.rb
View file @
de011ef4
...
...
@@ -72,7 +72,7 @@ module Pod
# library.
#
def
support_files_root
@sandbox
.
library
_support_files_dir
(
name
)
@sandbox
.
target
_support_files_dir
(
name
)
end
# @param [String] variant
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
de011ef4
...
...
@@ -115,7 +115,7 @@ module Pod
# variable of the user's project.
#
def
relative_pods_root
"${SRCROOT}/
#{
s
upport_files_
root
.
relative_path_from
(
client_root
)
}
"
"${SRCROOT}/
#{
s
andbox
.
root
.
relative_path_from
(
client_root
)
}
"
end
# @param [String] config_name The build configuration name to get the xcconfig for
...
...
lib/cocoapods/target/pod_target.rb
View file @
de011ef4
...
...
@@ -19,7 +19,7 @@ module Pod
@specs
=
specs
@target_definition
=
target_definition
@sandbox
=
sandbox
@build_headers
=
Sandbox
::
HeadersStore
.
new
(
sandbox
,
'Build
Headers
'
)
@build_headers
=
Sandbox
::
HeadersStore
.
new
(
sandbox
,
'Build'
)
@file_accessors
=
[]
end
...
...
spec/unit/external_sources/abstract_external_source_spec.rb
View file @
de011ef4
...
...
@@ -50,7 +50,6 @@ module Pod
it
"checks for JSON podspecs"
do
path
=
config
.
sandbox
.
pod_dir
(
'Reachability'
)
podspec_path
=
path
+
'Reachability.podspec.json'
Dir
.
mkdir
(
config
.
sandbox
.
sources_root
)
Dir
.
mkdir
(
path
)
File
.
open
(
podspec_path
,
"w"
)
{}
Pathname
.
any_instance
.
stubs
(
:rmtree
)
...
...
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
View file @
de011ef4
...
...
@@ -21,7 +21,7 @@ module Pod
end
it
'returns the path of the pods root relative to the user project'
do
@generator
.
target
.
relative_pods_root
.
should
==
'${SRCROOT}/Pods
/Generated
'
@generator
.
target
.
relative_pods_root
.
should
==
'${SRCROOT}/Pods'
end
#-----------------------------------------------------------------------#
...
...
@@ -53,7 +53,7 @@ module Pod
end
it
'sets the PODS_ROOT build variable'
do
@xcconfig
.
to_hash
[
'PODS_ROOT'
].
should
==
'${SRCROOT}/Pods
/Generated
'
@xcconfig
.
to_hash
[
'PODS_ROOT'
].
should
==
'${SRCROOT}/Pods'
end
it
'adds the sandbox public headers search paths to the xcconfig, with quotes, as header search paths'
do
...
...
spec/unit/hooks/library_representation_spec.rb
View file @
de011ef4
...
...
@@ -29,11 +29,11 @@ module Pod
end
it
'returns the path of the prefix header'
do
@rep
.
prefix_header_path
.
should
==
temporary_directory
+
'Pods/
Generated
/Pods-MyApp-prefix.pch'
@rep
.
prefix_header_path
.
should
==
temporary_directory
+
'Pods/
Target Support Files
/Pods-MyApp-prefix.pch'
end
it
'returns the path of the copy resources script'
do
@rep
.
copy_resources_script_path
.
should
==
temporary_directory
+
'Pods/
Generated
/Pods-MyApp-resources.sh'
@rep
.
copy_resources_script_path
.
should
==
temporary_directory
+
'Pods/
Target Support Files
/Pods-MyApp-resources.sh'
end
it
'returns the pods project'
do
...
...
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
View file @
de011ef4
...
...
@@ -168,7 +168,7 @@ module Pod
it
'returns whether the folder containing the Pod with the given name exists'
do
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
false
path
=
temporary_directory
+
'Pods/
Generated/
Sources/BananaLib'
path
=
temporary_directory
+
'Pods/Sources/BananaLib'
path
.
mkpath
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
true
...
...
@@ -176,7 +176,7 @@ module Pod
it
'returns whether the folder containing the Pod with the given name is empty'
do
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
true
path
=
temporary_directory
+
'Pods/
Generated/
Sources/BananaLib'
path
=
temporary_directory
+
'Pods/Sources/BananaLib'
path
.
mkpath
File
.
open
(
path
+
'file'
,
'w'
)
{}
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
false
...
...
spec/unit/installer/analyzer_spec.rb
View file @
de011ef4
...
...
@@ -82,7 +82,7 @@ module Pod
'Pods-SVPullToRefresh'
,
'Pods-libextobjc'
,
].
sort
target
.
support_files_root
.
should
==
config
.
sandbox
.
generated_dir_root
target
.
support_files_root
.
should
==
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
target
.
user_project_path
.
to_s
.
should
.
include
'SampleProject/SampleProject'
target
.
client_root
.
to_s
.
should
.
include
'SampleProject'
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
de011ef4
...
...
@@ -119,14 +119,14 @@ module Pod
it
'cleans the paths non used by the installation'
do
@installer
.
install!
@installer
.
clean!
unused_file
=
config
.
sandbox
.
root
+
'
Generated/
Sources/BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file
=
config
.
sandbox
.
root
+
'Sources/BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file
.
should
.
not
.
exist
end
it
'preserves important files like the LICENSE and the README'
do
@installer
.
install!
@installer
.
clean!
readme_file
=
config
.
sandbox
.
root
+
'
Generated/
Sources/BananaLib/README'
readme_file
=
config
.
sandbox
.
root
+
'Sources/BananaLib/README'
readme_file
.
should
.
exist
end
...
...
@@ -169,13 +169,13 @@ module Pod
@installer
.
send
(
:download_source
)
paths
=
@installer
.
send
(
:clean_paths
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)}
paths_without_git
=
relative_paths
.
reject
{
|
p
|
p
.
include?
'Pods/
Generated/
Sources/BananaLib/.git'
}
paths_without_git
=
relative_paths
.
reject
{
|
p
|
p
.
include?
'Pods/Sources/BananaLib/.git'
}
paths_without_git
.
sort
.
should
==
[
"Pods/
Generated/
Sources/BananaLib/BananaLib.podspec"
,
"Pods/
Generated/
Sources/BananaLib/libPusher"
,
"Pods/
Generated/
Sources/BananaLib/sub-dir"
,
"Pods/
Generated/
Sources/BananaLib/sub-dir/sub-dir-2"
,
"Pods/
Generated/
Sources/BananaLib/sub-dir/sub-dir-2/somefile.txt"
"Pods/Sources/BananaLib/BananaLib.podspec"
,
"Pods/Sources/BananaLib/libPusher"
,
"Pods/Sources/BananaLib/sub-dir"
,
"Pods/Sources/BananaLib/sub-dir/sub-dir-2"
,
"Pods/Sources/BananaLib/sub-dir/sub-dir-2/somefile.txt"
]
end
...
...
@@ -184,13 +184,13 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
.
sort
.
should
==
[
"Pods/
Generated/
Sources/BananaLib/Classes/Banana.h"
,
"Pods/
Generated/
Sources/BananaLib/Classes/Banana.m"
,
"Pods/
Generated/
Sources/BananaLib/Classes/BananaLib.pch"
,
"Pods/
Generated/
Sources/BananaLib/Classes/BananaPrivate.h"
,
"Pods/
Generated/
Sources/BananaLib/LICENSE"
,
"Pods/
Generated/
Sources/BananaLib/README"
,
"Pods/
Generated/
Sources/BananaLib/Resources/logo-sidebar.png"
"Pods/Sources/BananaLib/Classes/Banana.h"
,
"Pods/Sources/BananaLib/Classes/Banana.m"
,
"Pods/Sources/BananaLib/Classes/BananaLib.pch"
,
"Pods/Sources/BananaLib/Classes/BananaPrivate.h"
,
"Pods/Sources/BananaLib/LICENSE"
,
"Pods/Sources/BananaLib/README"
,
"Pods/Sources/BananaLib/Resources/logo-sidebar.png"
]
end
...
...
@@ -208,13 +208,13 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
.
sort
.
should
==
[
"Pods/
Generated/
Sources/BananaLib/Classes/Banana.h"
,
"Pods/
Generated/
Sources/BananaLib/Classes/Banana.m"
,
"Pods/
Generated/
Sources/BananaLib/Classes/BananaLib.pch"
,
"Pods/
Generated/
Sources/BananaLib/Classes/BananaPrivate.h"
,
"Pods/
Generated/
Sources/BananaLib/LICENSE"
,
"Pods/
Generated/
Sources/BananaLib/README"
,
"Pods/
Generated/
Sources/BananaLib/Resources/logo-sidebar.png"
"Pods/Sources/BananaLib/Classes/Banana.h"
,
"Pods/Sources/BananaLib/Classes/Banana.m"
,
"Pods/Sources/BananaLib/Classes/BananaLib.pch"
,
"Pods/Sources/BananaLib/Classes/BananaPrivate.h"
,
"Pods/Sources/BananaLib/LICENSE"
,
"Pods/Sources/BananaLib/README"
,
"Pods/Sources/BananaLib/Resources/logo-sidebar.png"
]
end
...
...
spec/unit/installer/target_installer/aggregate_target_installer_spec.rb
View file @
de011ef4
...
...
@@ -119,12 +119,13 @@ module Pod
@installer
.
install!
file
=
config
.
sandbox
.
root
+
@target
.
xcconfig_path
(
'Release'
)
xcconfig
=
Xcodeproj
::
Config
.
new
(
file
)
xcconfig
.
to_hash
[
'PODS_ROOT'
].
should
==
'${SRCROOT}/Pods
/Generated
'
xcconfig
.
to_hash
[
'PODS_ROOT'
].
should
==
'${SRCROOT}/Pods'
end
it
'creates a header for the target which contains the information about the installed Pods'
do
@installer
.
install!
file
=
config
.
sandbox
.
generated_dir_root
+
'Pods-environment.h'
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
file
=
support_files_dir
+
'Pods-environment.h'
contents
=
file
.
read
contents
.
should
.
include?
(
'#define COCOAPODS_POD_AVAILABLE_BananaLib'
)
contents
.
should
.
include?
(
'#define COCOAPODS_VERSION_MAJOR_BananaLib 1'
)
...
...
@@ -140,7 +141,8 @@ module Pod
it
'creates a create copy resources script'
do
@installer
.
install!
script
=
config
.
sandbox
.
generated_dir_root
+
'Pods-resources.sh'
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
script
=
support_files_dir
+
'Pods-resources.sh'
script
.
read
.
should
.
include?
(
'logo-sidebar.png'
)
end
...
...
@@ -154,9 +156,10 @@ module Pod
it
'creates the acknowledgements files '
do
@installer
.
install!
markdown
=
config
.
sandbox
.
generated_dir_root
+
'Pods-acknowledgements.markdown'
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
markdown
=
support_files_dir
+
'Pods-acknowledgements.markdown'
markdown
.
read
.
should
.
include?
(
'Permission is hereby granted'
)
plist
=
config
.
sandbox
.
generated_dir_root
+
'Pods-acknowledgements.plist'
plist
=
support_files_dir
+
'Pods-acknowledgements.plist'
plist
.
read
.
should
.
include?
(
'Permission is hereby granted'
)
end
...
...
@@ -165,8 +168,9 @@ module Pod
build_files
=
@installer
.
library
.
target
.
source_build_phase
.
files
build_file
=
build_files
.
find
{
|
bf
|
bf
.
file_ref
.
path
.
include?
(
'Pods-dummy.m'
)
}
build_file
.
should
.
be
.
not
.
nil
build_file
.
file_ref
.
path
.
should
==
'Pods-dummy.m'
dummy
=
config
.
sandbox
.
generated_dir_root
+
'Pods-dummy.m'
build_file
.
file_ref
.
path
.
should
==
'Target Support Files/Pods-dummy.m'
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
dummy
=
support_files_dir
+
'Pods-dummy.m'
dummy
.
read
.
should
.
include?
(
'@interface PodsDummy_Pods'
)
end
end
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
de011ef4
...
...
@@ -124,7 +124,8 @@ module Pod
it
"creates a prefix header, including the contents of the specification's prefix header"
do
@spec
.
prefix_header_contents
=
'#import "BlocksKit.h"'
@installer
.
install!
prefix_header
=
config
.
sandbox
.
generated_dir_root
+
'Pods-BananaLib-prefix.pch'
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
prefix_header
=
support_files_dir
+
'Pods-BananaLib-prefix.pch'
generated
=
prefix_header
.
read
expected
=
<<-
EOS
.
strip_heredoc
#ifdef __OBJC__
...
...
@@ -143,8 +144,9 @@ module Pod
build_files
=
@installer
.
library
.
target
.
source_build_phase
.
files
build_file
=
build_files
.
find
{
|
bf
|
bf
.
file_ref
.
display_name
==
'Pods-BananaLib-dummy.m'
}
build_file
.
should
.
be
.
not
.
nil
build_file
.
file_ref
.
path
.
should
==
'Pods-BananaLib-dummy.m'
dummy
=
config
.
sandbox
.
generated_dir_root
+
'Pods-BananaLib-dummy.m'
build_file
.
file_ref
.
path
.
should
==
'Target Support Files/Pods-BananaLib-dummy.m'
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
dummy
=
support_files_dir
+
'Pods-BananaLib-dummy.m'
dummy
.
read
.
should
.
include?
(
'@interface PodsDummy_Pods'
)
end
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
de011ef4
...
...
@@ -58,7 +58,7 @@ module Pod
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
'Copy Pods Resources'
}
phase
.
shell_script
.
strip
.
should
==
"
\"
${SRCROOT}/../Pods/
Generated
/Pods-resources.sh
\"
"
phase
.
shell_script
.
strip
.
should
==
"
\"
${SRCROOT}/../Pods/
Target Support Files
/Pods-resources.sh
\"
"
end
it
'adds a Check Manifest.lock build phase to each target'
do
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
de011ef4
...
...
@@ -96,7 +96,7 @@ module Pod
saved
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
workspace_path
)
saved
.
file_references
.
map
(
&
:path
).
should
==
[
'SampleProject/SampleProject.xcodeproj'
,
"Pods/
Generated/
Pods.xcodeproj"
"Pods/Pods.xcodeproj"
]
end
...
...
@@ -109,14 +109,14 @@ module Pod
saved
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
workspace_path
)
saved
.
file_references
.
map
(
&
:path
).
should
==
[
'SampleProject/SampleProject.xcodeproj'
,
"Pods/
Generated/
Pods.xcodeproj"
"Pods/Pods.xcodeproj"
]
end
it
"doesn't write the workspace if not needed"
do
file_references
=
[
Xcodeproj
::
Workspace
::
FileReference
.
new
(
'SampleProject/SampleProject.xcodeproj'
,
'group'
),
Xcodeproj
::
Workspace
::
FileReference
.
new
(
'Pods/
Generated/
Pods.xcodeproj'
,
'group'
),
Xcodeproj
::
Workspace
::
FileReference
.
new
(
'Pods/Pods.xcodeproj'
,
'group'
),
]
workspace
=
Xcodeproj
::
Workspace
.
new
(
file_references
)
...
...
@@ -136,13 +136,13 @@ module Pod
saved
.
file_references
.
map
(
&
:path
).
should
==
[
'user_added_project.xcodeproj'
,
'SampleProject/SampleProject.xcodeproj'
,
'Pods/
Generated/
Pods.xcodeproj'
,
'Pods/Pods.xcodeproj'
,
]
end
it
'preserves the order of the projects in the workspace'
do
file_references
=
[
Xcodeproj
::
Workspace
::
FileReference
.
new
(
'Pods/
Generated/
Pods.xcodeproj'
,
'group'
),
Xcodeproj
::
Workspace
::
FileReference
.
new
(
'Pods/Pods.xcodeproj'
,
'group'
),
Xcodeproj
::
Workspace
::
FileReference
.
new
(
'SampleProject/SampleProject.xcodeproj'
,
'group'
),
]
...
...
@@ -152,7 +152,7 @@ module Pod
@integrator
.
send
(
:create_workspace
)
saved
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
workspace_path
)
saved
.
file_references
.
map
(
&
:path
).
should
==
[
'Pods/
Generated/
Pods.xcodeproj'
,
'Pods/Pods.xcodeproj'
,
'SampleProject/SampleProject.xcodeproj'
,
]
end
...
...
spec/unit/installer_spec.rb
View file @
de011ef4
...
...
@@ -424,7 +424,7 @@ module Pod
it
'saves the project to the given path'
do
Xcodeproj
::
Project
.
any_instance
.
stubs
(
:recreate_user_schemes
)
path
=
temporary_directory
+
'Pods/
Generated/
Pods.xcodeproj'
path
=
temporary_directory
+
'Pods/Pods.xcodeproj'
@installer
.
pods_project
.
expects
(
:save
)
@installer
.
send
(
:write_pod_project
)
end
...
...
@@ -454,7 +454,7 @@ module Pod
it
'writes the sandbox manifest'
do
@installer
.
send
(
:write_lockfiles
)
lockfile
=
Lockfile
.
from_file
(
temporary_directory
+
'Pods/
Generated/
Manifest.lock'
)
lockfile
=
Lockfile
.
from_file
(
temporary_directory
+
'Pods/Manifest.lock'
)
lockfile
.
pod_names
.
should
==
[
'BananaLib'
]
end
...
...
spec/unit/library_spec.rb
View file @
de011ef4
...
...
@@ -36,37 +36,37 @@ module Pod
end
it
'returns the absolute path of the xcconfig file'
do
@lib
.
xcconfig_path
(
'Release'
).
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods.release.xcconfig'
)
@lib
.
xcconfig_path
(
'Release'
).
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods.release.xcconfig'
)
end
it
'returns the absolute path of the resources script'
do
@lib
.
copy_resources_script_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-resources.sh'
)
@lib
.
copy_resources_script_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-resources.sh'
)
end
it
'returns the absolute path of the target header file'
do
@lib
.
target_environment_header_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-environment.h'
)
@lib
.
target_environment_header_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-environment.h'
)
end
it
'returns the absolute path of the prefix header file'
do
@lib
.
prefix_header_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-prefix.pch'
)
@lib
.
prefix_header_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-prefix.pch'
)
end
it
'returns the absolute path of the bridge support file'
do
@lib
.
bridge_support_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods.bridgesupport'
)
@lib
.
bridge_support_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods.bridgesupport'
)
end
it
'returns the absolute path of the acknowledgements files without extension'
do
@lib
.
acknowledgements_basepath
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-acknowledgements'
)
@lib
.
acknowledgements_basepath
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-acknowledgements'
)
end
#--------------------------------------#
it
'returns the path of the resources script relative to the user project'
do
@lib
.
copy_resources_script_relative_path
.
should
==
'${SRCROOT}/Pods/
Generated
/Pods-resources.sh'
@lib
.
copy_resources_script_relative_path
.
should
==
'${SRCROOT}/Pods/
Target Support Files
/Pods-resources.sh'
end
it
'returns the path of the xcconfig file relative to the user project'
do
@lib
.
xcconfig_relative_path
(
'Release'
).
should
==
'Pods/
Generated
/Pods.release.xcconfig'
@lib
.
xcconfig_relative_path
(
'Release'
).
should
==
'Pods/
Target Support Files
/Pods.release.xcconfig'
end
end
...
...
spec/unit/project_spec.rb
View file @
de011ef4
...
...
@@ -222,7 +222,7 @@ module Pod
f
=
@project
[
'Podfile'
]
f
.
source_tree
.
should
==
'SOURCE_ROOT'
f
.
xc_language_specification_identifier
.
should
==
'xcode.lang.ruby'
f
.
path
.
should
==
'../
../
Podfile'
f
.
path
.
should
==
'../Podfile'
end
#----------------------------------------#
...
...
spec/unit/sandbox/headers_store_spec.rb
View file @
de011ef4
...
...
@@ -5,11 +5,11 @@ module Pod
before
do
@sandbox
=
Pod
::
Sandbox
.
new
(
temporary_directory
+
'Sandbox'
)
@header_dir
=
Sandbox
::
HeadersStore
.
new
(
@sandbox
,
'
Headers
'
)
@header_dir
=
Sandbox
::
HeadersStore
.
new
(
@sandbox
,
'
Public
'
)
end
it
"returns it's headers root"
do
@header_dir
.
root
.
should
==
temporary_directory
+
'Sandbox/
Generated/Headers/Headers
'
@header_dir
.
root
.
should
==
temporary_directory
+
'Sandbox/
Headers/Public
'
end
it
"can add namespaced headers to it's header path using symlinks and return the relative path"
do
...
...
@@ -40,11 +40,11 @@ module Pod
File
.
open
(
@sandbox
.
root
+
path
,
'w'
)
{
|
file
|
file
.
write
(
'hello'
)
}
end
@header_dir
.
add_files
(
namespace_path
,
relative_header_paths
)
@header_dir
.
search_paths
.
should
.
include
(
'${PODS_ROOT}/Headers/
Headers
/ExampleLib'
)
@header_dir
.
search_paths
.
should
.
include
(
'${PODS_ROOT}/Headers/
Public
/ExampleLib'
)
end
it
'always adds the Headers root to the header search paths'
do
@header_dir
.
search_paths
.
should
.
include
(
'${PODS_ROOT}/Headers/
Headers
'
)
@header_dir
.
search_paths
.
should
.
include
(
'${PODS_ROOT}/Headers/
Public
'
)
end
end
end
spec/unit/sandbox_spec.rb
View file @
de011ef4
...
...
@@ -33,7 +33,7 @@ module Pod
end
it
'returns the public headers store'
do
@sandbox
.
public_headers
.
root
.
should
==
temporary_directory
+
'Sandbox/
Generated/Headers/Headers
'
@sandbox
.
public_headers
.
root
.
should
==
temporary_directory
+
'Sandbox/
Headers/Public
'
end
it
'cleans any trace of the Pod with the given name'
do
...
...
@@ -61,19 +61,19 @@ module Pod
describe
'Paths'
do
it
'returns the path of the manifest'
do
@sandbox
.
manifest_path
.
should
==
temporary_directory
+
'Sandbox/
Generated/
Manifest.lock'
@sandbox
.
manifest_path
.
should
==
temporary_directory
+
'Sandbox/Manifest.lock'
end
it
'returns the path of the Pods project'
do
@sandbox
.
project_path
.
should
==
temporary_directory
+
'Sandbox/
Generated/
Pods.xcodeproj'
@sandbox
.
project_path
.
should
==
temporary_directory
+
'Sandbox/Pods.xcodeproj'
end
it
'returns the directory for the support files of a library'
do
@sandbox
.
library_support_files_dir
(
'Pods'
).
should
==
temporary_directory
+
'Sandbox/Generated
'
@sandbox
.
target_support_files_dir
(
'Pods'
).
should
==
temporary_directory
+
'Sandbox/Target Support Files
'
end
it
'returns the directory where a Pod is stored'
do
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/
Generated/
Sources/JSONKit'
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/Sources/JSONKit'
end
it
'returns the directory where a local Pod is stored'
do
...
...
@@ -112,18 +112,18 @@ module Pod
end
it
'returns the directory where to store the specifications'
do
@sandbox
.
specifications_dir
.
should
==
temporary_directory
+
'Sandbox/
Generated/
Local Podspecs'
@sandbox
.
specifications_dir
.
should
==
temporary_directory
+
'Sandbox/Local Podspecs'
end
it
"returns the path to a spec file in the 'Local Podspecs' dir"
do
(
@sandbox
.
root
+
'
Generated/
Local Podspecs'
).
mkdir
FileUtils
.
cp
(
fixture
(
'banana-lib/BananaLib.podspec'
),
@sandbox
.
root
+
'
Generated/
Local Podspecs'
)
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
@sandbox
.
root
+
'
Generated/
Local Podspecs/BananaLib.podspec'
(
@sandbox
.
root
+
'Local Podspecs'
).
mkdir
FileUtils
.
cp
(
fixture
(
'banana-lib/BananaLib.podspec'
),
@sandbox
.
root
+
'Local Podspecs'
)
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
end
it
'stores a podspec with a given path into the sandbox'
do
@sandbox
.
store_podspec
(
'BananaLib'
,
fixture
(
'banana-lib/BananaLib.podspec'
))
path
=
@sandbox
.
root
+
'
Generated/
Local Podspecs/BananaLib.podspec'
path
=
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
path
.
should
.
exist
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
path
end
...
...
@@ -131,7 +131,7 @@ module Pod
it
'stores a podspec with the given string into the sandbox'
do
podspec_string
=
fixture
(
'banana-lib/BananaLib.podspec'
).
read
@sandbox
.
store_podspec
(
'BananaLib'
,
podspec_string
)
path
=
@sandbox
.
root
+
'
Generated/
Local Podspecs/BananaLib.podspec'
path
=
@sandbox
.
root
+
'Local Podspecs/BananaLib.podspec'
path
.
should
.
exist
@sandbox
.
specification_path
(
'BananaLib'
).
should
==
path
end
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
de011ef4
...
...
@@ -44,35 +44,35 @@ module Pod
end
it
'returns the absolute path of the xcconfig file'
do
@target
.
xcconfig_path
(
'Release'
).
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods.release.xcconfig'
)
@target
.
xcconfig_path
(
'Release'
).
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods.release.xcconfig'
)
end
it
'returns the absolute path of the resources script'
do
@target
.
copy_resources_script_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-resources.sh'
)
@target
.
copy_resources_script_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-resources.sh'
)
end
it
'returns the absolute path of the target header file'
do
@target
.
target_environment_header_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-environment.h'
)
@target
.
target_environment_header_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-environment.h'
)
end
it
'returns the absolute path of the prefix header file'
do
@target
.
prefix_header_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-prefix.pch'
)
@target
.
prefix_header_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-prefix.pch'
)
end
it
'returns the absolute path of the bridge support file'
do
@target
.
bridge_support_path
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods.bridgesupport'
)
@target
.
bridge_support_path
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods.bridgesupport'
)
end
it
'returns the absolute path of the acknowledgements files without extension'
do
@target
.
acknowledgements_basepath
.
to_s
.
should
.
include?
(
'Pods/
Generated
/Pods-acknowledgements'
)
@target
.
acknowledgements_basepath
.
to_s
.
should
.
include?
(
'Pods/
Target Support Files
/Pods-acknowledgements'
)
end
it
'returns the path of the resources script relative to the user project'
do
@target
.
copy_resources_script_relative_path
.
should
==
'${SRCROOT}/Pods/
Generated
/Pods-resources.sh'
@target
.
copy_resources_script_relative_path
.
should
==
'${SRCROOT}/Pods/
Target Support Files
/Pods-resources.sh'
end
it
'returns the path of the xcconfig file relative to the user project'
do
@target
.
xcconfig_relative_path
(
'Release'
).
should
==
'Pods/
Generated
/Pods.release.xcconfig'
@target
.
xcconfig_relative_path
(
'Release'
).
should
==
'Pods/
Target Support Files
/Pods.release.xcconfig'
end
end
...
...
spec/unit/target/pod_target_spec.rb
View file @
de011ef4
...
...
@@ -62,24 +62,24 @@ module Pod
describe
'Support files'
do
it
'returns the absolute path of the xcconfig file'
do
@pod_target
.
xcconfig_path
(
'Release'
).
to_s
.
should
.
include
'Pods/
Generated
/Pods-BananaLib.release.xcconfig'
@pod_target
.
xcconfig_path
(
'Release'
).
to_s
.
should
.
include
'Pods/
Target Support Files
/Pods-BananaLib.release.xcconfig'
end
it
'returns the absolute path of the target header file'
do
@pod_target
.
target_environment_header_path
.
to_s
.
should
.
include
'Pods/
Generated
/Pods-environment.h'
@pod_target
.
target_environment_header_path
.
to_s
.
should
.
include
'Pods/
Target Support Files
/Pods-environment.h'
end
it
'returns the absolute path of the prefix header file'
do
@pod_target
.
prefix_header_path
.
to_s
.
should
.
include
'Pods/
Generated
/Pods-BananaLib-prefix.pch'
@pod_target
.
prefix_header_path
.
to_s
.
should
.
include
'Pods/
Target Support Files
/Pods-BananaLib-prefix.pch'
end
it
'returns the absolute path of the bridge support file'
do
@pod_target
.
bridge_support_path
.
to_s
.
should
.
include
'Pods/
Generated
/Pods-BananaLib.bridgesupport'
@pod_target
.
bridge_support_path
.
to_s
.
should
.
include
'Pods/
Target Support Files
/Pods-BananaLib.bridgesupport'
end
it
'returns the absolute path of the public and private xcconfig files'
do
@pod_target
.
xcconfig_path
.
to_s
.
should
.
include
'Pods/
Generated
/Pods-BananaLib.xcconfig'
@pod_target
.
xcconfig_private_path
.
to_s
.
should
.
include
'Pods/
Generated
/Pods-BananaLib-Private.xcconfig'
@pod_target
.
xcconfig_path
.
to_s
.
should
.
include
'Pods/
Target Support Files
/Pods-BananaLib.xcconfig'
@pod_target
.
xcconfig_private_path
.
to_s
.
should
.
include
'Pods/
Target Support Files
/Pods-BananaLib-Private.xcconfig'
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