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
f3c1318c
Unverified
Commit
f3c1318c
authored
Aug 23, 2016
by
Danielle Tomlinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Validator] Use .swift-version when applicable
parent
36ea5e72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
validator.rb
lib/cocoapods/validator.rb
+15
-2
validator_spec.rb
spec/unit/validator_spec.rb
+5
-0
No files found.
lib/cocoapods/validator.rb
View file @
f3c1318c
...
...
@@ -395,7 +395,7 @@ module Pod
def
add_swift_version
(
app_target
)
app_target
.
build_configurations
.
each
do
|
configuration
|
configuration
.
build_settings
[
'SWIFT_VERSION'
]
=
'2.3'
configuration
.
build_settings
[
'SWIFT_VERSION'
]
=
swift_version
end
end
...
...
@@ -452,7 +452,7 @@ module Pod
next
unless
native_target
=
pod_target
.
native_target
native_target
.
build_configuration_list
.
build_configurations
.
each
do
|
build_configuration
|
(
build_configuration
.
build_settings
[
'OTHER_CFLAGS'
]
||=
'$(inherited)'
)
<<
' -Wincomplete-umbrella'
build_configuration
.
build_settings
[
'SWIFT_VERSION'
]
=
'2.3'
if
pod_target
.
uses_swift?
build_configuration
.
build_settings
[
'SWIFT_VERSION'
]
=
swift_version
if
pod_target
.
uses_swift?
end
end
if
target
.
pod_targets
.
any?
(
&
:uses_swift?
)
&&
consumer
.
platform_name
==
:ios
&&
...
...
@@ -656,6 +656,19 @@ module Pod
# !@group Helpers
# @return [String] the SWIFT_VERSION to use for validation.
#
def
swift_version
dot_swift_version
||
'2.3'
end
# @return [String] the SWIFT_VERSION in the .swift-version file or nil.
#
def
dot_swift_version
swift_version_path
=
file
.
dirname
+
'.swift-version'
File
.
read
(
swift_version_path
)
if
File
.
exists?
(
swift_version_path
)
end
# @return [Array<String>] an array of source URLs used to create the
# {Podfile} used in the linting process
#
...
...
spec/unit/validator_spec.rb
View file @
f3c1318c
...
...
@@ -784,6 +784,7 @@ module Pod
validator
=
Validator
.
new
(
file
,
config
.
sources_manager
.
master
.
map
(
&
:url
))
validator
.
stubs
(
:build_pod
)
validator
.
stubs
(
:validate_url
)
validator
.
stubs
(
:swift_version
).
returns
(
'2.3'
)
validator
.
validate
validator
end
...
...
@@ -809,6 +810,10 @@ module Pod
validator
.
results
.
count
.
should
==
0
end
it
'defaults to Swift 2.3'
do
validator
=
test_swiftpod
end
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