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
a5d5db1c
Commit
a5d5db1c
authored
Dec 19, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetIntegrator] Standadize generators usage.
parent
90a5ea6b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
47 additions
and
50 deletions
+47
-50
Gemfile.lock
Gemfile.lock
+1
-1
markdown.rb
lib/cocoapods/generator/acknowledgements/markdown.rb
+4
-3
plist.rb
lib/cocoapods/generator/acknowledgements/plist.rb
+4
-3
installer.rb
lib/cocoapods/installer.rb
+1
-1
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+0
-0
library.rb
lib/cocoapods/library.rb
+3
-17
local_pod.rb
lib/cocoapods/local_pod.rb
+5
-1
user_interface.rb
lib/cocoapods/user_interface.rb
+2
-1
integration_spec.rb
spec/integration_spec.rb
+5
-5
markdown_spec.rb
spec/unit/generator/acknowledgements/markdown_spec.rb
+2
-1
plist_spec.rb
spec/unit/generator/acknowledgements/plist_spec.rb
+2
-1
acknowledgements_spec.rb
spec/unit/generator/acknowledgements_spec.rb
+3
-5
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+13
-1
library_spec.rb
spec/unit/library_spec.rb
+2
-10
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+0
-0
No files found.
Gemfile.lock
View file @
a5d5db1c
GIT
remote: git://github.com/CocoaPods/Core.git
revision: 4
63b02c0c1cd6d0b77ee2ef3efab1334f8066fc8
revision: 4
23f7364a74324db85238d3e8f8587b8191d7372
specs:
cocoapods-core (0.17.0.alpha)
activesupport (~> 3.2.6)
...
...
lib/cocoapods/generator/acknowledgements/markdown.rb
View file @
a5d5db1c
...
...
@@ -3,10 +3,11 @@ module Pod
class
Markdown
<
Acknowledgements
def
self
.
path_from_basepath
(
path
)
Pathname
.
new
(
path
.
dirname
+
"
#{
path
.
basename
.
to_s
}
.markdown"
)
end
def
save_as
(
path
)
if
(
path
.
extname
!=
".markdown"
)
path
=
Pathname
.
new
(
path
.
dirname
+
"
#{
path
.
basename
.
to_s
}
.markdown"
)
end
file
=
File
.
new
(
path
,
"w"
)
file
.
write
(
licenses
)
file
.
close
...
...
lib/cocoapods/generator/acknowledgements/plist.rb
View file @
a5d5db1c
...
...
@@ -4,10 +4,11 @@ module Pod
class
Plist
<
Acknowledgements
require
"xcodeproj/xcodeproj_ext"
def
self
.
path_from_basepath
(
path
)
Pathname
.
new
(
path
.
dirname
+
"
#{
path
.
basename
.
to_s
}
.plist"
)
end
def
save_as
(
path
)
if
(
path
.
extname
!=
".plist"
)
path
=
Pathname
.
new
(
path
.
dirname
+
"
#{
path
.
basename
.
to_s
}
.plist"
)
end
Xcodeproj
.
write_plist
(
plist
,
path
)
end
...
...
lib/cocoapods/installer.rb
View file @
a5d5db1c
...
...
@@ -403,8 +403,8 @@ module Pod
#
def
write_pod_project
UI
.
message
"- Writing Xcode project file to
#{
UI
.
path
sandbox
.
project_path
}
"
do
pods_project
[
'Frameworks'
].
sort_by_type!
pods_project
.
main_group
.
sort_by_type!
pods_project
[
'Frameworks'
].
sort_by_type!
pods_project
.
save_as
(
sandbox
.
project_path
)
end
end
...
...
lib/cocoapods/installer/target_installer.rb
View file @
a5d5db1c
This diff is collapsed.
Click to expand it.
lib/cocoapods/library.rb
View file @
a5d5db1c
...
...
@@ -142,30 +142,16 @@ module Pod
"${SRCROOT}/
#{
relative_to_srcroot
(
"
#{
copy_resources_script_name
}
"
)
}
"
end
# @return [String] the name of the prefix header file relative to this
# target.
#
def
prefix_header_name
"
#{
label
}
-prefix.pch"
end
# @return [Pathname] the absolute path of the prefix header file.
#
def
prefix_header_path
support_files_root
+
prefix_header_name
end
# @return [String] the name of the bridge support file relative to this
# target.
#
def
bridge_support_name
"
#{
label
}
.bridgesupport"
support_files_root
+
"
#{
label
}
-prefix.pch"
end
# @return [Pathname] the absolute path of the bridge support file.
#
def
bridge_support_path
support_files_root
+
bridge_support_name
support_files_root
+
"
#{
label
}
.bridgesupport"
end
# @return [Pathname] the absolute path of acknowledgements file.
...
...
@@ -173,7 +159,7 @@ module Pod
# @note The acknowledgements generators add the extension according to
# the file type.
#
def
acknowledgements_path
def
acknowledgements_
base
path
support_files_root
+
"
#{
label
}
-Acknowledgements"
end
...
...
lib/cocoapods/local_pod.rb
View file @
a5d5db1c
...
...
@@ -407,8 +407,12 @@ module Pod
config
end
# Returns also weak frameworks.
#
def
frameworks
specifications
.
map
{
|
spec
|
spec
.
frameworks
}.
flatten
.
uniq
frameworks
=
specifications
.
map
{
|
spec
|
spec
.
frameworks
}
weak_frameworks
=
specifications
.
map
{
|
spec
|
spec
.
weak_frameworks
}
(
frameworks
+
weak_frameworks
).
flatten
.
uniq
end
# Computes the paths of all the public headers of the pod including every
...
...
lib/cocoapods/user_interface.rb
View file @
a5d5db1c
...
...
@@ -135,7 +135,8 @@ module Pod
#
def
path
(
pathname
)
if
pathname
"`./
#{
pathname
.
relative_path_from
(
config
.
podfile_path
.
dirname
||
Pathname
.
pwd
)
}
'"
path
=
pathname
.
relative_path_from
(
config
.
podfile_path
.
dirname
||
Pathname
.
pwd
)
"`
#{
path
}
`"
else
''
end
...
...
spec/integration_spec.rb
View file @
a5d5db1c
...
...
@@ -127,7 +127,7 @@ module Pod
# @note ASIHTTPRequest depends on Reachability in iOS.
#
it
"creates targets for different platforms"
do
x
it
"creates targets for different platforms"
do
podfile
=
Podfile
.
new
do
platform
:ios
xcodeproj
'dummy'
...
...
@@ -290,14 +290,16 @@ module Pod
root
=
config
.
project_pods_root
(
root
+
'Pods.xcconfig'
).
read
.
should
==
installer
.
libraries
.
first
.
xcconfig
.
to_s
project_file
=
(
root
+
'Pods.xcodeproj/project.pbxproj'
).
to_s
Xcodeproj
.
read_plist
(
project_file
).
should
==
installer
.
project
.
to_hash
saved_project
=
Xcodeproj
.
read_plist
(
project_file
)
saved_project
.
to_hash
.
recursive_diff
(
installer
.
project
.
to_hash
).
should
.
be
.
nil
saved_project
.
should
==
installer
.
project
.
to_hash
should_xcodebuild
(
podfile
.
target_definitions
[
:default
])
end
#--------------------------------------#
it
"adds resources to the xcode copy script"
do
x
it
"adds resources to the xcode copy script"
do
podfile
=
Podfile
.
new
do
platform
test_platform
xcodeproj
'dummy'
...
...
@@ -317,8 +319,6 @@ module Pod
#--------------------------------------#
# @todo we need to do more cleaning and/or add a --prune task
#
it
"overwrites an existing project.pbxproj file"
do
podfile
=
Podfile
.
new
do
platform
test_platform
...
...
spec/unit/generator/acknowledgements/markdown_spec.rb
View file @
a5d5db1c
...
...
@@ -29,7 +29,8 @@ describe Pod::Generator::Markdown do
end
it
"writes a markdown file to disk"
do
given_path
=
@sandbox
.
root
+
"Pods-Acknowledgements"
basepath
=
@sandbox
.
root
+
"Pods-Acknowledgements"
given_path
=
@markdown
.
class
.
path_from_basepath
(
basepath
)
expected_path
=
@sandbox
.
root
+
"Pods-Acknowledgements.markdown"
mockFile
=
mock
mockFile
.
expects
(
:write
).
with
(
equals
(
@markdown
.
licenses
))
...
...
spec/unit/generator/acknowledgements/plist_spec.rb
View file @
a5d5db1c
...
...
@@ -44,7 +44,8 @@ describe Pod::Generator::Plist do
end
it
"writes a plist to disk at the given path"
do
given_path
=
@sandbox
.
root
+
"Pods-Acknowledgements"
basepath
=
@sandbox
.
root
+
"Pods-Acknowledgements"
given_path
=
@plist
.
class
.
path_from_basepath
(
basepath
)
expected_path
=
@sandbox
.
root
+
"Pods-Acknowledgements.plist"
Xcodeproj
.
expects
(
:write_plist
).
with
(
equals
(
@plist
.
plist
),
equals
(
expected_path
))
@plist
.
save_as
(
given_path
)
...
...
spec/unit/generator/acknowledgements_spec.rb
View file @
a5d5db1c
...
...
@@ -8,11 +8,9 @@ describe Pod::Generator::Acknowledgements do
@acknowledgements
=
Pod
::
Generator
::
Acknowledgements
.
new
(
@target_definition
,
@pods
)
end
it
"calls save_as on both a Plist and a Markdown generator"
do
path
=
@sandbox
.
root
+
"Pods-Acknowledgements.plist"
Pod
::
Generator
::
Plist
.
any_instance
.
expects
(
:save_as
).
with
(
equals
(
path
))
Pod
::
Generator
::
Markdown
.
any_instance
.
expects
(
:save_as
).
with
(
equals
(
path
))
@acknowledgements
.
save_as
(
path
)
it
"the the generators"
do
generators
=
Pod
::
Generator
::
Acknowledgements
.
generators
generators
.
map
{
|
g
|
g
.
name
.
split
(
'::'
).
last
}.
should
==
[
'Plist'
,
'Markdown'
]
end
it
"returns a string for each header and footnote text method"
do
...
...
spec/unit/installer/target_installer_spec.rb
View file @
a5d5db1c
...
...
@@ -34,7 +34,12 @@ module Pod
@installer
.
install!
group
=
@project
.
support_files_group
[
'Pods'
]
group
.
children
.
map
(
&
:display_name
).
sort
.
should
==
[
"Pods-prefix.pch"
,
"Pods-resources.sh"
,
"Pods.xcconfig"
"Pods-Acknowledgements.markdown"
,
"Pods-Acknowledgements.plist"
,
"Pods-Dummy.m"
,
"Pods-prefix.pch"
,
"Pods-resources.sh"
,
"Pods.xcconfig"
]
end
...
...
@@ -126,6 +131,13 @@ module Pod
names
.
should
.
include
(
"Banana.m"
)
end
it
'adds the frameworks required by to the pod to the project for informative purposes'
do
Specification
.
any_instance
.
stubs
(
:frameworks
).
returns
([
'QuartzCore'
])
@installer
.
install!
names
=
@installer
.
project
[
'Frameworks'
].
children
.
map
(
&
:name
)
names
.
sort
.
should
==
[
"Foundation.framework"
,
"QuartzCore.framework"
]
end
#--------------------------------------#
it
"creates and xcconfig file"
do
...
...
spec/unit/library_spec.rb
View file @
a5d5db1c
...
...
@@ -58,24 +58,16 @@ module Pod
@lib
.
copy_resources_script_relative_path
.
should
==
'${SRCROOT}/Pods/Pods-resources.sh'
end
it
"returns the prefix header file name"
do
@lib
.
prefix_header_name
.
should
==
'Pods-prefix.pch'
end
it
"returns the absolute path of the prefix header file"
do
@lib
.
prefix_header_path
.
to_s
.
should
.
include?
(
'Pods/Pods-prefix.pch'
)
end
it
"returns the bridge support file name"
do
@lib
.
bridge_support_name
.
should
==
'Pods.bridgesupport'
end
it
"returns the absolute path of the bridge support file"
do
@lib
.
bridge_support_path
.
to_s
.
should
.
include?
(
'Pods/Pods.bridgesupport'
)
end
it
"returns the absolute path of the acknowledgements file"
do
@lib
.
acknowledgements_path
.
to_s
.
should
.
include?
(
'Pods/Pods-Acknowledgements'
)
it
"returns the absolute path of the acknowledgements file
s without extension
"
do
@lib
.
acknowledgements_
base
path
.
to_s
.
should
.
include?
(
'Pods/Pods-Acknowledgements'
)
end
end
end
...
...
spec/unit/local_pod_spec.rb
View file @
a5d5db1c
This diff is collapsed.
Click to expand it.
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