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
c8060b62
Commit
c8060b62
authored
Feb 04, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix integration specs.
parent
ada88864
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
43 deletions
+49
-43
installer_data.rb
lib/cocoapods/hooks/installer_data.rb
+4
-7
pod_data.rb
lib/cocoapods/hooks/pod_data.rb
+18
-1
target_installer_data.rb
lib/cocoapods/hooks/target_installer_data.rb
+13
-12
integration_spec.rb
spec/integration_spec.rb
+14
-23
No files found.
lib/cocoapods/hooks/installer_data.rb
View file @
c8060b62
...
@@ -5,6 +5,8 @@ module Pod
...
@@ -5,6 +5,8 @@ module Pod
#
#
class
InstallerData
class
InstallerData
include
Config
::
Mixin
# @return [Sandbox] sandbox the sandbox where the support files should
# @return [Sandbox] sandbox the sandbox where the support files should
# be generated.
# be generated.
#
#
...
@@ -23,20 +25,15 @@ module Pod
...
@@ -23,20 +25,15 @@ module Pod
#
#
# attr_accessor :local_pods_by_target
# attr_accessor :local_pods_by_target
# @return [Array<
LocalPod
>] The list of LocalPod instances for each
# @return [Array<
PodData
>] The list of LocalPod instances for each
# dependency sorted by name.
# dependency sorted by name.
#
#
# attr_accessor :local_
pods
attr_accessor
:
pods
# @return [Pod::Project] the `Pods/Pods.xcodeproj` project.
# @return [Pod::Project] the `Pods/Pods.xcodeproj` project.
#
#
attr_accessor
:project
attr_accessor
:project
def
pods
# UI.warn "InstallerData#pods is deprecated"
# [] # TODO
end
end
end
end
end
end
end
...
...
lib/cocoapods/hooks/pod_data.rb
View file @
c8060b62
...
@@ -5,13 +5,30 @@ module Pod
...
@@ -5,13 +5,30 @@ module Pod
#
#
class
PodData
class
PodData
# @return [Pathname]
#
attr_accessor
:root
attr_accessor
:root
# @return [Version]
#
attr_accessor
:root_spec
#--------------------------------------------------------------------------------#
def
to_s
root_spec
.
to_s
end
end
end
end
end
end
end
# TODO
module
Pod
class
Specification
include
Config
::
Mixin
end
end
lib/cocoapods/hooks/target_installer_data.rb
View file @
c8060b62
...
@@ -4,31 +4,32 @@ module Pod
...
@@ -4,31 +4,32 @@ module Pod
# Stores the information of the target installer
# Stores the information of the target installer
# @todo This has to be removed, but this means the specs have to be
# updated if they need a reference to the prefix header.
#
# def prefix_header_filename
# UI.warn "The usage of the TargetInstaller#prefix_header_filename is deprecated."
# library.prefix_header_path.relative_path_from(sandbox.root)
# end
#
#
# @return [Sandbox] sandbox the sandbox where the support files should
# @return [Sandbox] sandbox the sandbox where the support files should
# be generated.
# be generated.
#
#
attr_
reade
r
:sandbox
attr_
accesso
r
:sandbox
# @return [Library] The library whose target needs to be generated.
# @return [Library] The library whose target needs to be generated.
#
#
attr_reader
:library
attr_accessor
:library
#--------------------------------------------------------------------------------#
# @todo This has to be removed, but this means the specs have to be
# updated if they need a reference to the prefix header.
#
def
prefix_header_filename
UI
.
warn
"The usage of the TargetInstaller#prefix_header_filename is deprecated."
library
.
prefix_header_path
.
relative_path_from
(
sandbox
.
root
)
end
# @return [PBXNativeTarget] the target generated by the installation
# @return [PBXNativeTarget] the target generated by the installation
# process.
# process.
#
#
# @note Generated by the {#add_target} step.
# @note Generated by the {#add_target} step.
#
#
attr_reader
:target
def
target
end
# @return [Project] the Pods project of the sandbox.
# @return [Project] the Pods project of the sandbox.
#
#
...
...
spec/integration_spec.rb
View file @
c8060b62
require
File
.
expand_path
(
'../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../spec_helper'
,
__FILE__
)
require
'yaml'
require
'yaml'
# TODO Make specs faster by limiting remote network connections
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# @!group Helpers
# @!group Helpers
...
@@ -38,7 +36,6 @@ module Pod
...
@@ -38,7 +36,6 @@ module Pod
describe
"Full integration"
do
describe
"Full integration"
do
before
do
before
do
# fixture('spec-repos/master') # ensure the archive is unpacked
config
.
integrate_targets
=
false
config
.
integrate_targets
=
false
end
end
...
@@ -46,14 +43,10 @@ module Pod
...
@@ -46,14 +43,10 @@ module Pod
describe
"Single platform"
do
describe
"Single platform"
do
# it "includes automatically inherited subspecs" do
# xit "includes automatically inherited subspecs" do; end
# end
# xit "handles different subspecs for the same Pod in different target definitions" do; end
# it "handles different subspecs for the same Pod in different target definitions" do
# end
# @todo fix the config of the hook
it
"installs a Pod directly from its repo"
do
xit
"installs a Pod directly from its repo"
do
url
=
fixture
(
'integration/sstoolkit'
).
to_s
url
=
fixture
(
'integration/sstoolkit'
).
to_s
commit
=
'2adcd0f81740d6b0cd4589af98790eee3bd1ae7b'
commit
=
'2adcd0f81740d6b0cd4589af98790eee3bd1ae7b'
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
...
@@ -128,7 +121,7 @@ module Pod
...
@@ -128,7 +121,7 @@ module Pod
# @note ASIHTTPRequest depends on Reachability in iOS.
# @note ASIHTTPRequest depends on Reachability in iOS.
#
#
x
it
"creates targets for different platforms"
do
it
"creates targets for different platforms"
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
:ios
platform
:ios
xcodeproj
'dummy'
xcodeproj
'dummy'
...
@@ -172,7 +165,7 @@ module Pod
...
@@ -172,7 +165,7 @@ module Pod
puts
" ! "
.
red
<<
"Skipping because the `appledoc` executable can't be found."
puts
" ! "
.
red
<<
"Skipping because the `appledoc` executable can't be found."
else
else
# @todo fix the config of the hook
# @todo fix the config of the hook
x
it
"generates documentation of all pods by default"
do
it
"generates documentation of all pods by default"
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
:ios
platform
:ios
...
@@ -182,7 +175,7 @@ module Pod
...
@@ -182,7 +175,7 @@ module Pod
end
end
config
.
generate_docs
=
true
config
.
generate_docs
=
true
config
.
doc_install
=
false
config
.
install_docs
=
false
Generator
::
Documentation
.
any_instance
.
stubs
(
:already_installed?
).
returns
(
false
)
Generator
::
Documentation
.
any_instance
.
stubs
(
:already_installed?
).
returns
(
false
)
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
.
install!
installer
.
install!
...
@@ -239,9 +232,8 @@ module Pod
...
@@ -239,9 +232,8 @@ module Pod
end
end
end
end
Installer
.
new
(
config
.
sandbox
,
podfile
).
install!
Installer
.
new
(
config
.
sandbox
,
podfile
).
install!
project
=
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
=
Xcodeproj
::
Project
.
new
(
config
.
sandbox
.
project_path
)
project
.
targets
.
first
.
build_configurations
.
map
do
|
config
|
project
.
targets
.
first
.
build_configurations
.
map
do
|
config
|
config
.
build_settings
[
'GCC_ENABLE_OBJC_GC'
]
config
.
build_settings
[
'GCC_ENABLE_OBJC_GC'
]
end
.
should
==
%w{ supported supported }
end
.
should
==
%w{ supported supported }
...
@@ -261,7 +253,6 @@ module Pod
...
@@ -261,7 +253,6 @@ module Pod
pod
'SSZipArchive'
,
'< 0.1.2'
pod
'SSZipArchive'
,
'< 0.1.2'
end
end
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
.
install!
installer
.
install!
...
@@ -293,8 +284,8 @@ module Pod
...
@@ -293,8 +284,8 @@ module Pod
(
root
+
'Pods.xcconfig'
).
read
.
should
==
installer
.
libraries
.
first
.
xcconfig
.
to_s
(
root
+
'Pods.xcconfig'
).
read
.
should
==
installer
.
libraries
.
first
.
xcconfig
.
to_s
project_file
=
(
root
+
'Pods.xcodeproj/project.pbxproj'
).
to_s
project_file
=
(
root
+
'Pods.xcodeproj/project.pbxproj'
).
to_s
saved_project
=
Xcodeproj
.
read_plist
(
project_file
)
saved_project
=
Xcodeproj
.
read_plist
(
project_file
)
saved_project
.
to_hash
.
recursive_diff
(
installer
.
project
.
to_hash
).
should
.
be
.
nil
saved_project
.
to_hash
.
recursive_diff
(
installer
.
p
ods_p
roject
.
to_hash
).
should
.
be
.
nil
saved_project
.
should
==
installer
.
project
.
to_hash
saved_project
.
should
==
installer
.
p
ods_p
roject
.
to_hash
should_xcodebuild
(
podfile
.
target_definitions
[
:default
])
should_xcodebuild
(
podfile
.
target_definitions
[
:default
])
end
end
...
@@ -336,15 +327,15 @@ module Pod
...
@@ -336,15 +327,15 @@ module Pod
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
.
install!
installer
.
install!
project
=
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
project
=
Xcodeproj
::
Project
.
new
(
config
.
project_pods_root
+
'Pods.xcodeproj'
)
disk_source_files
=
project
.
files
.
sort
.
reject
{
|
f
|
f
.
build_files
.
empty?
}
disk_source_files
=
project
.
files
.
sort
.
reject
{
|
f
|
f
.
build_files
.
empty?
}
installer_source_files
=
installer
.
project
.
files
.
sort
.
reject
{
|
f
|
f
.
build_files
.
empty?
}
installer_source_files
=
installer
.
p
ods_p
roject
.
files
.
sort
.
reject
{
|
f
|
f
.
build_files
.
empty?
}
disk_source_files
.
should
==
installer_source_files
disk_source_files
.
should
==
installer_source_files
end
end
#--------------------------------------#
#--------------------------------------#
x
it
"creates a project with multiple targets"
do
it
"creates a project with multiple targets"
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
test_platform
platform
test_platform
pod
'ASIHTTPRequest'
pod
'ASIHTTPRequest'
...
@@ -423,7 +414,7 @@ module Pod
...
@@ -423,7 +414,7 @@ module Pod
workspace
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
temporary_directory
+
'ASIHTTPRequest.xcworkspace'
)
workspace
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
temporary_directory
+
'ASIHTTPRequest.xcworkspace'
)
workspace
.
projpaths
.
sort
.
should
==
[
'ASIHTTPRequest.xcodeproj'
,
'Pods/Pods.xcodeproj'
]
workspace
.
projpaths
.
sort
.
should
==
[
'ASIHTTPRequest.xcodeproj'
,
'Pods/Pods.xcodeproj'
]
project
=
Project
.
new
(
projpath
)
project
=
Xcodeproj
::
Project
.
new
(
projpath
)
libPods
=
project
.
files
.
find
{
|
f
|
f
.
name
==
'libPods.a'
}
libPods
=
project
.
files
.
find
{
|
f
|
f
.
name
==
'libPods.a'
}
target
=
project
.
targets
.
first
target
=
project
.
targets
.
first
...
@@ -436,7 +427,7 @@ module Pod
...
@@ -436,7 +427,7 @@ module Pod
#--------------------------------------#
#--------------------------------------#
x
it
"should prevent duplication cleaning headers symlinks with multiple targets"
do
it
"should prevent duplication cleaning headers symlinks with multiple targets"
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
test_platform
platform
test_platform
xcodeproj
'dummy'
xcodeproj
'dummy'
...
...
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