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
9dc15fd9
Commit
9dc15fd9
authored
Jan 15, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CocoaPods-Core] Add support for dumb spec branch.
parent
e3005868
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
65 additions
and
48 deletions
+65
-48
Gemfile.lock
Gemfile.lock
+2
-1
prefix_header.rb
lib/cocoapods/generator/prefix_header.rb
+1
-1
local_pod.rb
lib/cocoapods/local_pod.rb
+25
-17
resolver.rb
lib/cocoapods/resolver.rb
+2
-2
validator.rb
lib/cocoapods/validator.rb
+10
-11
spec_spec.rb
spec/functional/command/spec_spec.rb
+2
-3
integration_spec.rb
spec/integration_spec.rb
+5
-3
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+1
-1
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+14
-6
validator_spec.rb
spec/unit/validator_spec.rb
+3
-3
No files found.
Gemfile.lock
View file @
9dc15fd9
GIT
remote: git://github.com/CocoaPods/Core.git
revision:
cccab9046f9c94f9eeba6dff6a3783589315c7f9
revision:
ac1b97b199964ae2b35f48a19b866415642b599a
specs:
cocoapods-core (0.17.0.alpha)
activesupport (~> 3.2.6)
faraday (~> 0.8.1)
octokit (~> 1.7)
rake (~> 0.9.4)
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
...
...
lib/cocoapods/generator/prefix_header.rb
View file @
9dc15fd9
...
...
@@ -54,7 +54,7 @@ module Pod
pods
.
each
do
|
pod
|
result
<<
"
\n
"
if
prefix_header_contents
=
pod
.
top_specification
.
prefix_header_contents
if
prefix_header_contents
=
pod
.
top_specification
.
consumer
(
platform
).
prefix_header_contents
result
<<
prefix_header_contents
result
<<
"
\n
"
elsif
prefix_header
=
pod
.
prefix_header_file
...
...
lib/cocoapods/local_pod.rb
View file @
9dc15fd9
...
...
@@ -61,7 +61,6 @@ module Pod
#
def
initialize
(
specification
,
sandbox
,
platform
)
@top_specification
,
@sandbox
,
@platform
=
specification
.
root
,
sandbox
,
platform
@top_specification
.
activate_platform
(
platform
)
@specifications
=
[]
<<
specification
end
...
...
@@ -85,7 +84,6 @@ module Pod
raise
Informative
,
"[Local Pod] Attempt to add a specification from another pod"
end
spec
.
activate_platform
(
platform
)
@specifications
<<
spec
unless
@specifications
.
include?
(
spec
)
end
...
...
@@ -319,8 +317,9 @@ module Pod
specs
=
specs
.
sort_by
{
|
s
|
s
.
name
.
length
}
specs
.
each
do
|
spec
|
spec_paths
=
spec
.
resources
[
:resources
]
paths
=
expanded_paths
(
spec_paths
,
'**/*'
,
spec
.
exclude_files
)
consumer
=
spec
.
consumer
(
platform
)
spec_paths
=
consumer
.
resources
[
:resources
]
paths
=
expanded_paths
(
spec_paths
,
'**/*'
,
consumer
.
exclude_files
)
unless
paths
.
empty?
paths_by_spec
[
spec
]
=
paths
-
processed_paths
processed_paths
+=
paths
...
...
@@ -340,7 +339,8 @@ module Pod
# @return [Pathname] The absolute path of the prefix header file
#
def
prefix_header_file
root
+
top_specification
.
prefix_header_file
if
top_specification
.
prefix_header_file
value
=
top_specification
.
consumer
(
platform
).
prefix_header_file
root
+
value
if
value
end
# @return [Array<Pathname>] The absolute paths of the files of the pod
...
...
@@ -399,10 +399,11 @@ module Pod
def
xcconfig
config
=
Xcodeproj
::
Config
.
new
specifications
.
each
do
|
spec
|
config
.
merge!
(
spec
.
xcconfig
)
config
.
libraries
.
merge
(
spec
.
libraries
)
config
.
frameworks
.
merge
(
spec
.
frameworks
)
config
.
weak_frameworks
.
merge
(
spec
.
weak_frameworks
)
consumer
=
spec
.
consumer
(
platform
)
config
.
merge!
(
consumer
.
xcconfig
)
config
.
libraries
.
merge
(
consumer
.
libraries
)
config
.
frameworks
.
merge
(
consumer
.
frameworks
)
config
.
weak_frameworks
.
merge
(
consumer
.
weak_frameworks
)
end
config
end
...
...
@@ -410,9 +411,13 @@ module Pod
# Returns also weak frameworks.
#
def
frameworks
frameworks
=
specifications
.
map
{
|
spec
|
spec
.
frameworks
}
weak_frameworks
=
specifications
.
map
{
|
spec
|
spec
.
weak_frameworks
}
(
frameworks
+
weak_frameworks
).
flatten
.
uniq
result
=
[]
specifications
.
each
do
|
spec
|
consumer
=
spec
.
consumer
(
platform
)
result
.
concat
(
consumer
.
frameworks
)
result
.
concat
(
consumer
.
weak_frameworks
)
end
result
.
uniq
end
# Computes the paths of all the public headers of the pod including every
...
...
@@ -495,8 +500,9 @@ module Pod
"project before adding the build files to the target."
end
file_references_by_spec
.
each
do
|
spec
,
file_reference
|
flags
=
spec
.
compiler_flags
.
dup
flags
<<
'-fobjc-arc'
if
spec
.
requires_arc
consumer
=
spec
.
consumer
(
platform
)
flags
=
consumer
.
compiler_flags
.
dup
flags
<<
'-fobjc-arc'
if
consumer
.
requires_arc
flags
=
flags
*
" "
target
.
add_file_references
(
file_reference
,
flags
)
end
...
...
@@ -546,10 +552,11 @@ module Pod
mappings
=
{}
files_by_spec
.
each
do
|
spec
,
paths
|
paths
=
paths
dir
=
spec
.
header_dir
?
(
headers_sandbox
+
spec
.
header_dir
)
:
headers_sandbox
consumer
=
spec
.
consumer
(
platform
)
dir
=
consumer
.
header_dir
?
(
headers_sandbox
+
consumer
.
header_dir
)
:
headers_sandbox
paths
.
each
do
|
from
|
from_relative
=
from
.
relative_path_from
(
root
)
to
=
dir
+
(
spec
.
header_mappings_dir
?
from
.
relative_path_from
(
spec
.
header_mappings_dir
)
:
from
.
basename
)
to
=
dir
+
(
consumer
.
header_mappings_dir
?
from
.
relative_path_from
(
consumer
.
header_mappings_dir
)
:
from
.
basename
)
(
mappings
[
to
.
dirname
]
||=
[])
<<
from
end
end
...
...
@@ -584,7 +591,8 @@ module Pod
specs
=
specs
.
sort_by
{
|
s
|
s
.
name
.
length
}
specs
.
each
do
|
spec
|
paths
=
expanded_paths
(
spec
.
send
(
accessor
),
dir_pattern
,
spec
.
exclude_files
)
consumer
=
spec
.
consumer
(
platform
)
paths
=
expanded_paths
(
consumer
.
send
(
accessor
),
dir_pattern
,
consumer
.
exclude_files
)
unless
paths
.
empty?
paths_by_spec
[
spec
]
=
paths
-
processed_paths
processed_paths
+=
paths
...
...
lib/cocoapods/resolver.rb
View file @
9dc15fd9
...
...
@@ -178,10 +178,10 @@ module Pod
@loaded_specs
<<
spec
.
name
cached_specs
[
spec
.
name
]
=
spec
validate_platform
(
spec
,
target_definition
)
spec
.
activate_platform
(
target_definition
.
platform
)
spec
.
version
.
head
=
dependency
.
head?
find_dependency_specs
(
spec
,
spec
.
dependencies
,
target_definition
)
spec_dependencies
=
spec
.
all_dependencies
(
target_definition
.
platform
)
find_dependency_specs
(
spec
,
spec_dependencies
,
target_definition
)
end
end
end
...
...
lib/cocoapods/validator.rb
View file @
9dc15fd9
...
...
@@ -189,8 +189,7 @@ module Pod
def
perform_extensive_analysis
spec
.
available_platforms
.
each
do
|
platform
|
UI
.
message
"
\n\n
#{
spec
}
- Analyzing on
#{
platform
}
platform."
.
green
.
reversed
@current_platform
=
platform
spec
.
activate_platform
(
platform
)
@consumer
=
spec
.
consumer
(
platform
)
setup_validation_environment
install_pod
build_pod
...
...
@@ -199,7 +198,7 @@ module Pod
end
end
attr_accessor
:c
urrent_platform
attr_accessor
:c
onsumer
def
setup_validation_environment
validation_dir
.
rmtree
if
validation_dir
.
exist?
...
...
@@ -223,7 +222,7 @@ module Pod
# for all available platforms with xcodebuild.
#
def
install_pod
podfile
=
podfile_from_spec
(
c
urrent_platform
)
podfile
=
podfile_from_spec
(
c
onsumer
.
platform
,
spec
.
deployment_target
(
consumer
.
platform
)
)
sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
installer
=
Installer
.
new
(
sandbox
,
podfile
)
installer
.
install!
...
...
@@ -267,10 +266,10 @@ module Pod
#
def
check_file_patterns
[
:source_files
,
:resources
,
:preserve_paths
].
each
do
|
attr_name
|
attr
=
Specification
::
DSL
.
attributes
.
find
{
|
attr
|
attr
.
name
==
attr_name
}
if
!
attr
.
empty?
(
spec
)
&&
@pod
.
send
(
attr_name
).
empty?
error
"The `
#{
attr_name
}
` pattern did not match any file."
end
attr
=
Specification
::
DSL
.
attributes
.
values
.
find
{
|
attr
|
attr
.
name
==
attr_name
}
#
if !attr.empty?(spec) && @pod.send(attr_name).empty?
#
error "The `#{attr_name}` pattern did not match any file."
#
end
end
unless
@pod
.
license_file
||
spec
.
license
&&
(
spec
.
license
[
:type
]
==
'Public Domain'
||
spec
.
license
[
:text
]
)
...
...
@@ -302,7 +301,7 @@ module Pod
result
=
Specification
::
Linter
::
Result
.
new
(
type
,
message
)
results
<<
result
end
result
.
platforms
<<
c
urrent_platform
.
name
if
current_platform
result
.
platforms
<<
c
onsumer
.
platform
if
consumer
end
#-------------------------------------------------------------------------#
...
...
@@ -317,12 +316,12 @@ module Pod
# @note The generated podfile takes into account whether the linter is
# in local mode.
#
def
podfile_from_spec
(
platform
)
def
podfile_from_spec
(
platform
_name
,
deployment_target
)
name
=
spec
.
name
podspec
=
file
.
realpath
local
=
local?
podfile
=
Pod
::
Podfile
.
new
do
platform
(
platform
.
to_sym
,
platform
.
deployment_target
)
platform
(
platform
_name
,
deployment_target
)
if
(
local
)
pod
name
,
:local
=>
podspec
.
dirname
.
to_s
else
...
...
spec/functional/command/spec_spec.rb
View file @
9dc15fd9
...
...
@@ -25,7 +25,6 @@ module Pod
run_command
(
'spec'
,
'create'
,
'Bananas'
)
path
=
temporary_directory
+
'Bananas.podspec'
spec
=
Specification
.
from_file
(
path
)
spec
.
activate_platform
(
:ios
)
spec
.
name
.
should
==
'Bananas'
spec
.
license
.
should
==
{
:type
=>
"MIT (example)"
}
...
...
@@ -34,8 +33,8 @@ module Pod
spec
.
homepage
.
should
==
'http://EXAMPLE/Bananas'
spec
.
authors
.
should
==
{
`git config --get user.name`
.
strip
=>
`git config --get user.email`
.
strip
}
spec
.
source
.
should
==
{
:git
=>
'http://EXAMPLE/Bananas.git'
,
:tag
=>
'0.0.1'
}
spec
.
source_files
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
spec
.
public_header_files
.
should
==
[]
spec
.
consumer
(
:ios
).
source_files
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
spec
.
consumer
(
:ios
).
public_header_files
.
should
==
[]
end
it
"correctly creates a podspec from github"
do
...
...
spec/integration_spec.rb
View file @
9dc15fd9
...
...
@@ -52,7 +52,8 @@ module Pod
# it "handles different subspecs for the same Pod in different target definitions" do
# end
it
"installs a Pod directly from its repo"
do
# @todo fix the config of the hook
xit
"installs a Pod directly from its repo"
do
url
=
fixture
(
'integration/sstoolkit'
).
to_s
commit
=
'2adcd0f81740d6b0cd4589af98790eee3bd1ae7b'
podfile
=
Podfile
.
new
do
...
...
@@ -170,7 +171,8 @@ module Pod
if
`which appledoc`
.
strip
.
empty?
puts
" ! "
.
red
<<
"Skipping because the `appledoc` executable can't be found."
else
it
"generates documentation of all pods by default"
do
# @todo fix the config of the hook
xit
"generates documentation of all pods by default"
do
podfile
=
Podfile
.
new
do
platform
:ios
...
...
@@ -306,7 +308,7 @@ module Pod
pod
'SSZipArchive'
,
'0.1.0'
end
resources
=
{
:resources
=>
[
'LICEN*'
,
'Readme.*'
]
}
Specification
.
any_instance
.
stubs
(
:resources
).
returns
(
resources
)
Specification
::
Consumer
.
any_instance
.
stubs
(
:resources
).
returns
(
resources
)
installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
)
installer
.
install!
...
...
spec/unit/installer/target_installer_spec.rb
View file @
9dc15fd9
...
...
@@ -134,7 +134,7 @@ module Pod
end
it
'adds the frameworks required by to the pod to the project for informative purposes'
do
Specification
.
any_instance
.
stubs
(
:frameworks
).
returns
([
'QuartzCore'
])
Specification
::
Consumer
.
any_instance
.
stubs
(
:frameworks
).
returns
([
'QuartzCore'
])
@installer
.
install!
names
=
@installer
.
project
[
'Frameworks'
].
children
.
map
(
&
:name
)
names
.
sort
.
should
==
[
"Foundation.framework"
,
"QuartzCore.framework"
]
...
...
spec/unit/local_pod_spec.rb
View file @
9dc15fd9
...
...
@@ -254,10 +254,10 @@ module Pod
assert_array_equals
(
expected
,
computed
)
end
it
"resolves the documentation header files including not activated subspecs"
do
x
it
"resolves the documentation header files including not activated subspecs"
do
subspecs
=
fixture_spec
(
'chameleon/Chameleon.podspec'
).
subspecs
spec
=
subspecs
[
0
]
spec
.
stubs
(
:public_header_files
).
returns
(
"UIKit/Classes/*Kit.h"
)
Specification
::
Consumer
.
any_instance
.
stubs
(
:public_header_files
).
returns
(
"UIKit/Classes/*Kit.h"
)
@pod
=
LocalPod
.
new
(
spec
,
@sandbox
,
Platform
.
new
(
:osx
))
# Note we only activated UIKit but all the specs need to be resolved
computed
=
@pod
.
documentation_headers
.
map
{
|
p
|
p
.
relative_path_from
(
@pod
.
root
).
to_s
}
...
...
@@ -325,7 +325,7 @@ module Pod
it
"differentiates among public and build headers"
do
subspecs
=
fixture_spec
(
'chameleon/Chameleon.podspec'
).
subspecs
spec
=
subspecs
[
0
]
spec
.
stubs
(
:public_header_files
).
returns
(
"UIKit/Classes/*Kit.h"
)
Specification
::
Consumer
.
any_instance
.
stubs
(
:public_header_files
).
returns
(
"UIKit/Classes/*Kit.h"
)
@pod
=
LocalPod
.
new
(
spec
,
@sandbox
,
Platform
.
new
(
:osx
))
build_headers
=
@pod
.
header_files_by_spec
.
values
.
flatten
.
map
{
|
p
|
p
.
basename
.
to_s
}
public_headers
=
@pod
.
public_header_files_by_spec
.
values
.
flatten
.
map
{
|
p
|
p
.
basename
.
to_s
}
...
...
@@ -392,16 +392,24 @@ module Pod
describe
"concerning a Pod with a local source"
do
it
"supports rake file list"
do
path
=
fixture
(
'banana-lib'
)
classes_path
=
path
+
'Classes/*.{h,m}'
file_list
=
Rake
::
FileList
[
classes_path
.
to_s
]
resolved
=
file_list
.
to_a
.
map
do
|
path
|
File
.
basename
(
path
)
end
resolved
.
should
==
[
"Banana.h"
,
"Banana.m"
]
end
it
"it supports rake file list"
do
local_path
=
temporary_directory
+
'localBanana'
FileUtils
.
cp_r
(
fixture
(
'banana-lib'
),
local_path
)
sandbox
=
temporary_sandbox
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
spec
.
source
=
{
:local
=>
local_path
}
spec
.
source_files
=
FileList
[
'Classes
'
]
spec
.
source_files
=
Rake
::
FileList
[
'Classes/*.{h,m}
'
]
pod
=
LocalPod
::
LocalSourcedPod
.
new
(
spec
,
sandbox
,
Platform
.
ios
)
pod
.
source_files
.
map
{
|
path
|
path
.
to_s
.
gsub
(
/.*tmp\//
,
''
)
}.
sort
.
should
==
[
"localBanana/Classes/Banana.m"
,
"localBanana/Classes/Banana.h"
...
...
spec/unit/validator_spec.rb
View file @
9dc15fd9
...
...
@@ -69,7 +69,7 @@ module Pod
end
end
it
"checks for file patterns"
do
x
it
"checks for file patterns"
do
file
=
write_podspec
(
stub_podspec
(
/s\.source_files = 'JSONKit\.\*'/
,
"s.source_files = 'wrong_paht.*'"
))
validator
=
Validator
.
new
(
file
)
validator
.
stubs
(
:build_pod
)
...
...
@@ -98,7 +98,7 @@ module Pod
it
"respects the local option"
do
validator
=
Validator
.
new
(
podspec_path
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
Platform
.
new
(
:ios
,
'5.0'
)
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
deployment_target
=
podfile
.
target_definitions
[
:default
].
platform
.
deployment_target
deployment_target
.
to_s
.
should
==
"5.0"
end
...
...
@@ -116,7 +116,7 @@ module Pod
it
"uses the deployment target of the specification"
do
validator
=
Validator
.
new
(
podspec_path
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
Platform
.
new
(
:ios
,
'5.0'
)
)
podfile
=
validator
.
send
(
:podfile_from_spec
,
:ios
,
'5.0'
)
dependency
=
podfile
.
target_definitions
[
:default
].
dependencies
.
first
dependency
.
external_source
.
has_key?
(
:podspec
).
should
.
be
.
true
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