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
0011c395
Commit
0011c395
authored
Apr 24, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Pod::Command::Spec] preserve the values of Pod::Config::instance
parent
ad457f58
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
spec.rb
lib/cocoapods/command/spec.rb
+29
-17
No files found.
lib/cocoapods/command/spec.rb
View file @
0011c395
...
@@ -93,9 +93,7 @@ module Pod
...
@@ -93,9 +93,7 @@ module Pod
# It returns true if **all** the files passed validation
# It returns true if **all** the files passed validation
#
#
def
lint_specs_files
(
files
,
is_repo
)
def
lint_specs_files
(
files
,
is_repo
)
tmp_dir
=
Pathname
.
new
(
'/tmp/CocoaPods/Lint'
)
all_valid
=
true
all_valid
=
true
files
.
each
do
|
file
|
files
.
each
do
|
file
|
file
=
file
.
realpath
file
=
file
.
realpath
file_spec
=
Specification
.
from_file
(
file
)
file_spec
=
Specification
.
from_file
(
file
)
...
@@ -112,19 +110,19 @@ module Pod
...
@@ -112,19 +110,19 @@ module Pod
warnings
=
warnings_for_spec
(
spec
,
file
,
is_repo
)
warnings
=
warnings_for_spec
(
spec
,
file
,
is_repo
)
deprecations
=
deprecation_notices_for_spec
(
spec
,
file
,
is_repo
)
deprecations
=
deprecation_notices_for_spec
(
spec
,
file
,
is_repo
)
if
is_repo
||
@quick
if
is_repo
||
@quick
build_messages
,
file_errors
=
[],
[]
build_messages
,
file_
patterns_
errors
=
[],
[]
else
else
tmp_dir
.
mkpath
set_up_lint_environment
build_messages
=
Dir
.
chdir
(
tmp_dir
)
{
build_errors_for_spec
(
spec
,
file
,
is_repo
)
}
build_messages
=
build_errors_for_spec
(
spec
,
file
,
is_repo
)
file_
errors
=
Dir
.
chdir
(
tmp_dir
)
{
file_errors_for_spec
(
spec
,
file
,
is_repo
)
}
file_
patterns_errors
=
file_patterns_errors_for_spec
(
spec
,
file
,
is_repo
)
t
mp_dir
.
rmtree
t
ear_down_lint_environment
end
end
build_errors
=
build_messages
.
select
{
|
msg
|
msg
.
include?
(
'error'
)}
build_errors
=
build_messages
.
select
{
|
msg
|
msg
.
include?
(
'error'
)}
build_warnings
=
build_messages
-
build_errors
build_warnings
=
build_messages
-
build_errors
# Errors compromise the functionality of a spec, warnings can be ignored
# Errors compromise the functionality of a spec, warnings can be ignored
all
=
warnings
+
deprecations
+
build_messages
+
file_errors
all
=
warnings
+
deprecations
+
build_messages
+
file_
patterns_
errors
errors
=
file_errors
+
build_errors
errors
=
file_
patterns_
errors
+
build_errors
warnings
=
all
-
errors
warnings
=
all
-
errors
if
@only_errors
if
@only_errors
...
@@ -156,6 +154,25 @@ module Pod
...
@@ -156,6 +154,25 @@ module Pod
all_valid
all_valid
end
end
def
tmp_dir
Pathname
.
new
(
'/tmp/CocoaPods/Lint'
)
end
def
set_up_lint_environment
tmp_dir
.
mkpath
@original_config
=
Config
.
instance
.
clone
config
.
project_root
=
tmp_dir
config
.
project_pods_root
=
tmp_dir
+
'Pods'
config
.
silent
=
!
config
.
verbose
config
.
integrate_targets
=
false
config
.
doc_install
=
false
end
def
tear_down_lint_environment
tmp_dir
.
rmtree
Config
.
instance
=
@original_config
end
def
clean_duplicate_platfrom_messages
(
messages
)
def
clean_duplicate_platfrom_messages
(
messages
)
duplicate_candiates
=
messages
.
select
{
|
l
|
l
.
include?
(
"ios: "
)}
duplicate_candiates
=
messages
.
select
{
|
l
|
l
.
include?
(
"ios: "
)}
duplicated
=
duplicate_candiates
.
select
{
|
l
|
messages
.
include?
(
l
.
gsub
(
/ios: /
,
'osx: '
))
}
duplicated
=
duplicate_candiates
.
select
{
|
l
|
messages
.
include?
(
l
.
gsub
(
/ios: /
,
'osx: '
))
}
...
@@ -213,18 +230,13 @@ module Pod
...
@@ -213,18 +230,13 @@ module Pod
def
build_errors_for_spec
(
spec
,
file
,
is_repo
)
def
build_errors_for_spec
(
spec
,
file
,
is_repo
)
messages
=
[]
messages
=
[]
platform_names
(
spec
).
each
do
|
platform_name
|
platform_names
(
spec
).
each
do
|
platform_name
|
config
.
silent
=
!
config
.
verbose
config
.
integrate_targets
=
false
config
.
project_root
=
Pathname
.
pwd
podfile
=
podfile_from_spec
(
spec
,
file
,
platform_name
)
podfile
=
podfile_from_spec
(
spec
,
file
,
platform_name
)
Installer
.
new
(
podfile
).
install!
Installer
.
new
(
podfile
).
install!
config
.
silent
=
false
return
messages
if
`which xcodebuild`
.
strip
.
empty?
return
messages
if
`which xcodebuild`
.
strip
.
empty?
output
=
Dir
.
chdir
(
'Pods'
)
{
`xcodebuild 2>&1`
}
output
=
Dir
.
chdir
(
config
.
project_pods_root
)
{
`xcodebuild 2>&1`
}
clean_output
=
process_xcode_build_output
(
output
).
map
{
|
l
|
"
#{
platform_name
}
:
#{
l
}
"
}
clean_output
=
process_xcode_build_output
(
output
).
map
{
|
l
|
"
#{
platform_name
}
:
#{
l
}
"
}
messages
+=
clean_output
messages
+=
clean_output
puts
(
"
\n
"
+
output
)
if
config
.
verbose?
puts
(
"
\n
"
+
output
)
if
config
.
verbose?
end
end
messages
messages
...
@@ -254,8 +266,8 @@ module Pod
...
@@ -254,8 +266,8 @@ module Pod
#
#
# It returns a array of messages
# It returns a array of messages
#
#
def
file_errors_for_spec
(
spec
,
file
,
is_repo
)
def
file_
patterns_
errors_for_spec
(
spec
,
file
,
is_repo
)
Dir
.
chdir
(
'Pods/'
+
spec
.
name
)
do
Dir
.
chdir
(
config
.
project_pods_root
+
spec
.
name
)
do
messages
=
[]
messages
=
[]
messages
+=
check_spec_files_exists
(
spec
,
:source_files
)
messages
+=
check_spec_files_exists
(
spec
,
:source_files
)
messages
+=
check_spec_files_exists
(
spec
,
:resources
)
messages
+=
check_spec_files_exists
(
spec
,
:resources
)
...
...
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