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
f369d321
Unverified
Commit
f369d321
authored
Jul 26, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Allow skipping import validation
parent
eef5ab33
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+21
-3
lint.rb
lib/cocoapods/command/lib/lint.rb
+3
-0
push.rb
lib/cocoapods/command/repo/push.rb
+3
-0
lint.rb
lib/cocoapods/command/spec/lint.rb
+3
-0
validator.rb
lib/cocoapods/validator.rb
+12
-3
No files found.
lib/cocoapods/command/lib/lint.rb
View file @
f369d321
...
...
@@ -21,6 +21,7 @@ module Pod
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'Multiple sources must be comma-delimited.'
],
[
'--private'
,
'Lint skips checks that apply only to public specs'
],
[
'--skip-import-validation'
,
'Lint skips validating that the pod can be imported'
],
].
concat
(
super
)
end
...
...
@@ -34,6 +35,7 @@ module Pod
@use_frameworks
=
!
argv
.
flag?
(
'use-libraries'
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@private
=
argv
.
flag?
(
'private'
,
false
)
@skip_import_validation
=
argv
.
flag?
(
'skip-import-validation'
,
false
)
@podspecs_paths
=
argv
.
arguments!
super
end
...
...
@@ -55,6 +57,7 @@ module Pod
validator
.
only_subspec
=
@only_subspec
validator
.
use_frameworks
=
@use_frameworks
validator
.
ignore_public_only_results
=
@private
validator
.
skip_import_validation
=
@skip_import_validation
validator
.
validate
unless
@clean
...
...
lib/cocoapods/command/repo/push.rb
View file @
f369d321
...
...
@@ -29,6 +29,7 @@ module Pod
'Multiple sources must be comma-delimited.'
],
[
'--local-only'
,
'Does not perform the step of pushing REPO to its remote'
],
[
'--no-private'
,
'Lint includes checks that apply only to public repos'
],
[
'--skip-import-validation'
,
'Lint skips validating that the pod can be imported'
],
[
'--commit-message="Fix bug in pod"'
,
'Add custom commit message. '
\
'Opens default editor if no commit message is specified.'
],
[
'--use-json'
,
'Push JSON spec to repo'
],
...
...
@@ -47,6 +48,7 @@ module Pod
@message
=
argv
.
option
(
'commit-message'
)
@commit_message
=
argv
.
flag?
(
'commit-message'
,
false
)
@use_json
=
argv
.
flag?
(
'use-json'
)
@skip_import_validation
=
argv
.
flag?
(
'skip-import-validation'
,
false
)
super
end
...
...
@@ -123,6 +125,7 @@ module Pod
validator
.
allow_warnings
=
@allow_warnings
validator
.
use_frameworks
=
@use_frameworks
validator
.
ignore_public_only_results
=
@private
validator
.
skip_import_validation
=
@skip_import_validation
begin
validator
.
validate
rescue
=>
e
...
...
lib/cocoapods/command/spec/lint.rb
View file @
f369d321
...
...
@@ -27,6 +27,7 @@ module Pod
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'Multiple sources must be comma-delimited.'
],
[
'--private'
,
'Lint skips checks that apply only to public specs'
],
[
'--skip-import-validation'
,
'Lint skips validating that the pod can be imported'
],
].
concat
(
super
)
end
...
...
@@ -40,6 +41,7 @@ module Pod
@use_frameworks
=
!
argv
.
flag?
(
'use-libraries'
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@private
=
argv
.
flag?
(
'private'
,
false
)
@skip_import_validation
=
argv
.
flag?
(
'skip-import-validation'
,
false
)
@podspecs_paths
=
argv
.
arguments!
super
end
...
...
@@ -57,6 +59,7 @@ module Pod
validator
.
only_subspec
=
@only_subspec
validator
.
use_frameworks
=
@use_frameworks
validator
.
ignore_public_only_results
=
@private
validator
.
skip_import_validation
=
@skip_import_validation
validator
.
validate
failure_reasons
<<
validator
.
failure_reason
...
...
lib/cocoapods/validator.rb
View file @
f369d321
...
...
@@ -194,6 +194,9 @@ module Pod
#
attr_accessor
:ignore_public_only_results
attr_accessor
:skip_import_validation
alias_method
:skip_import_validation?
,
:skip_import_validation
#-------------------------------------------------------------------------#
# !@group Lint results
...
...
@@ -377,7 +380,6 @@ module Pod
app_project
.
new_target
(
:application
,
'App'
,
consumer
.
platform_name
,
deployment_target
)
app_project
.
save
app_project
.
recreate_user_schemes
Xcodeproj
::
XCScheme
.
share_scheme
(
app_project
.
path
,
'App'
)
end
def
add_app_project_import
...
...
@@ -390,6 +392,8 @@ module Pod
app_target
.
add_file_references
([
source_file_ref
])
add_xctest
(
app_target
)
if
@installer
.
pod_targets
.
any?
{
|
pt
|
pt
.
spec_consumers
.
any?
{
|
c
|
c
.
frameworks
.
include?
(
'XCTest'
)
}
}
app_project
.
save
Xcodeproj
::
XCScheme
.
share_scheme
(
app_project
.
path
,
'App'
)
Xcodeproj
::
XCScheme
.
share_scheme
(
@installer
.
pods_project
.
path
,
pod_target
.
label
)
end
def
add_xctest
(
app_target
)
...
...
@@ -424,7 +428,7 @@ module Pod
f
<<
"@import Foundation;
\n
"
f
<<
"@import UIKit;
\n
"
if
consumer
.
platform_name
==
:ios
||
consumer
.
platform_name
==
:tvos
f
<<
"@import Cocoa;
\n
"
if
consumer
.
platform_name
==
:osx
f
<<
"
#{
import_statement
}
int main() {}
\n
"
f
<<
import_statement
end
end
source_file
...
...
@@ -718,7 +722,12 @@ module Pod
#
def
xcodebuild
require
'fourflusher'
command
=
%w(clean build -workspace App.xcworkspace -scheme App -configuration Release)
scheme
=
if
skip_import_validation?
@installer
.
pod_targets
.
find
{
|
pt
|
pt
.
pod_name
==
spec
.
root
.
name
}.
label
else
'App'
end
command
=
%W(clean build -workspace App.xcworkspace -scheme
#{
scheme
}
-configuration Release)
case
consumer
.
platform_name
when
:ios
command
+=
%w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
...
...
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