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
579c1a73
Commit
579c1a73
authored
Feb 10, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow specifications to have a local source that exists outside the Pods root (and doesn't
need downloading or copying).
parent
2ae6ddfb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
8 deletions
+48
-8
Rakefile
Rakefile
+3
-3
file_list.rb
lib/cocoapods/file_list.rb
+0
-2
installer.rb
lib/cocoapods/installer.rb
+4
-2
specification.rb
lib/cocoapods/specification.rb
+10
-0
downloader_spec.rb
spec/functional/downloader_spec.rb
+0
-1
specification_spec.rb
spec/unit/specification_spec.rb
+31
-0
No files found.
Rakefile
View file @
579c1a73
...
...
@@ -40,7 +40,7 @@ end
namespace
:gem
do
def
gem_version
require
'lib/cocoapods'
require
File
.
join
(
File
.
dirname
(
__FILE__
),
*
%w[lib cocoapods]
)
Pod
::
VERSION
end
...
...
@@ -55,8 +55,8 @@ namespace :gem do
desc
"Install a gem version of the current code"
task
:install
=>
:build
do
sh
"sudo
mac
gem install
#{
gem_filename
}
"
#sh "sudo
mac
gem compile cocoapods"
sh
"sudo gem install
#{
gem_filename
}
"
#sh "sudo gem compile cocoapods"
end
desc
"Run all specs, build and install gem, commit version change, tag version change, and push everything"
...
...
lib/cocoapods/file_list.rb
View file @
579c1a73
...
...
@@ -38,5 +38,3 @@ class Pathname
end
end
end
lib/cocoapods/installer.rb
View file @
579c1a73
...
...
@@ -55,8 +55,10 @@ module Pod
def
install_dependencies!
build_specifications
.
each
do
|
spec
|
if
spec
.
pod_destroot
.
exist?
puts
"Using
#{
spec
}
"
unless
config
.
silent?
if
spec
.
pod_destroot
.
exist?
||
spec
.
local?
message
=
"Using
#{
spec
}
"
message
+=
" [LOCAL]"
if
spec
.
local?
puts
message
unless
config
.
silent?
else
puts
"Installing
#{
spec
}
"
unless
config
.
silent?
spec
=
spec
.
part_of_specification
if
spec
.
part_of_other_pod?
...
...
lib/cocoapods/specification.rb
View file @
579c1a73
...
...
@@ -153,6 +153,14 @@ module Pod
include
Config
::
Mixin
def
local?
!
source
[
:local
].
nil?
end
def
local_path
Pathname
.
new
(
File
.
expand_path
(
source
[
:local
]))
end
def
wrapper?
source_files
.
empty?
&&
!
subspecs
.
empty?
end
...
...
@@ -195,6 +203,8 @@ module Pod
def
pod_destroot
if
part_of_other_pod?
part_of_specification
.
pod_destroot
elsif
local?
local_path
else
config
.
project_pods_root
+
@name
end
...
...
spec/functional/downloader_spec.rb
View file @
579c1a73
...
...
@@ -110,6 +110,5 @@ describe "Pod::Downloader" do
(
@dir
+
'README'
).
should
.
not
.
exist
end
end
end
spec/unit/specification_spec.rb
View file @
579c1a73
...
...
@@ -340,3 +340,34 @@ describe "A Pod::Specification subspec" do
@spec
.
subspec_by_name
(
'MainSpec/FirstSubSpec/SecondSubSpec'
).
should
==
@spec
.
subspecs
.
first
.
subspecs
.
first
end
end
describe
"A Pod::Specification with :local source"
do
before
do
@spec
=
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'MainSpec'
s
.
source
=
{
:local
=>
fixture
(
"integration/JSONKit"
)
}
s
.
source_files
=
"."
end
end
it
"is marked as local"
do
@spec
.
should
.
be
.
local
end
it
"it returns the expanded local path"
do
@spec
.
local_path
.
should
==
fixture
(
"integration/JSONKit"
)
end
it
"returns the list of files that the source_files pattern expand to within the local path"
do
files
=
fixture
(
"integration/JSONKit"
).
glob
(
'**/*.{h,m}'
)
files
=
files
.
map
{
|
file
|
file
.
relative_path_from
(
config
.
project_pods_root
)
}
@spec
.
expanded_source_files
.
sort
.
should
==
files
.
sort
end
it
"returns the list of headers that the source_files pattern expand to within the local path"
do
files
=
fixture
(
"integration/JSONKit"
).
glob
(
'**/*.{h}'
)
files
=
files
.
map
{
|
file
|
file
.
relative_path_from
(
config
.
project_pods_root
)
}
@spec
.
header_files
.
sort
.
should
==
files
.
sort
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