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
1d7b4e76
Commit
1d7b4e76
authored
May 11, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LocalPod] Clean all the unused files.
parent
b568f82b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
23 deletions
+31
-23
documentation.rb
lib/cocoapods/generator/documentation.rb
+1
-1
installer.rb
lib/cocoapods/installer.rb
+1
-1
local_pod.rb
lib/cocoapods/local_pod.rb
+29
-21
No files found.
lib/cocoapods/generator/documentation.rb
View file @
1d7b4e76
...
...
@@ -42,7 +42,7 @@ module Pod
end
def
files
@pod
.
absolute_source_files
.
map
(
&
:to_s
)
@pod
.
source_files
(
false
)
.
map
(
&
:to_s
)
end
def
index_file
...
...
lib/cocoapods/installer.rb
View file @
1d7b4e76
...
...
@@ -57,7 +57,7 @@ module Pod
downloader
=
Downloader
.
for_pod
(
pod
)
downloader
.
download
if
config
.
clean
downloader
.
clean
#
downloader.clean
pod
.
clean
end
end
...
...
lib/cocoapods/local_pod.rb
View file @
1d7b4e76
...
...
@@ -8,7 +8,7 @@ module Pod
def
initialize
(
specification
,
sandbox
,
platform
)
@top_specification
,
@sandbox
=
specification
,
sandbox
@top_specification
.
activate_platform
(
platform
)
@specifications
=
[]
<<
specification
@specifications
=
[]
end
def
self
.
from_podspec
(
podspec
,
sandbox
,
platform
)
...
...
@@ -32,7 +32,7 @@ module Pod
def
to_s
result
=
top_specification
.
to_s
#
result << " [LOCAL]" if top_specification.local?
result
<<
" [LOCAL]"
if
top_specification
.
local?
result
end
...
...
@@ -62,8 +62,14 @@ module Pod
end
def
clean
# TODO: nuke everything that is not used
# clean_paths.each { |path| FileUtils.rm_rf(path) }
clean_paths
.
each
{
|
path
|
FileUtils
.
rm_rf
(
path
)
}
# remove empty diretories
Dir
.
glob
(
"
#{
root
}
/**/{*,.*}"
).
sort_by
(
&
:length
).
reverse
.
# Clean the deepest paths first
reject
{
|
d
|
d
=~
/\/\.\.?$/
}
.
# Remove the `.` and `..` paths
select
{
|
d
|
File
.
directory?
d
}
.
# Get only directories
each
{
|
d
|
Dir
.
rmdir
d
if
(
Dir
.
entries
(
d
)
==
%w[ . .. ]
)
}
# Remove the paths only if it is empty
end
def
prefix_header_file
...
...
@@ -72,23 +78,34 @@ module Pod
end
end
def
source_files
chained_expanded_paths
(
:source_files
,
:glob
=>
'*.{h,m,mm,c,cpp}'
,
:relative_to_sandbox
=>
tru
e
)
def
source_files
(
relative
=
true
)
chained_expanded_paths
(
:source_files
,
:glob
=>
'*.{h,m,mm,c,cpp}'
,
:relative_to_sandbox
=>
relativ
e
)
end
def
absolute_source_files
chained_expanded_paths
(
:
source_files
,
:glob
=>
'*.{h,m,mm,c,cpp}'
)
def
resources
(
relative
=
true
)
chained_expanded_paths
(
:
resources
,
:relative_to_sandbox
=>
relative
)
end
def
clean_paths
# TODO: delete
# chained_expanded_paths(:clean_paths)
paths
=
expanded_paths
(
'**/*'
).
reject
{
|
p
|
p
.
directory?
}
# TODO: deprecate Specification#clean_paths
paths
=
@top_specification
.
clean_paths
unless
@top_specification
.
clean_paths
.
empty?
paths
-
used_files
end
def
used_files
source_files
(
false
)
+
resources
(
false
)
+
readme_file
+
license_file
+
[
prefix_header_file
]
end
def
readme_file
expanded_paths
(
'README.*'
)
end
def
resources
chained_expanded_paths
(
:resources
,
:relative_to_sandbox
=>
true
)
def
license_file
expanded_paths
(
%w[ LICENSE licence.txt ]
)
end
def
header_files
source_files
.
select
{
|
f
|
f
.
extname
==
'.h'
}
end
...
...
@@ -99,15 +116,6 @@ module Pod
end
end
def
readme_file
expanded_paths
(
'README.*'
,
options
=
{})
end
def
license
#TODO: merge with the work of will and return the text
expanded_paths
(
%w[ LICENSE licence.txt ]
,
options
=
{})
end
def
add_to_target
(
target
)
implementation_files
.
each
do
|
file
|
target
.
add_source_file
(
file
,
nil
,
specification
.
compiler_flags
.
strip
)
...
...
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