Skip to content

Commit

Permalink
Add no_validate option to external sources
Browse files Browse the repository at this point in the history
  • Loading branch information
petercv committed Jul 6, 2016
1 parent 298279c commit ccb0f08
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/cocoapods-deploy/command/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 77,28 @@ def dependencies_for(specification)
end
end
end

# Applies patch to external sources to add a no_validate option which
# can be used to disable validation of downloaded podspecs. A normal install
# doesn't validate the podspecs of non-external pods even though certain
# podspecs are not entirely valid (for example an invalid license file type).
# This would mean the normal install command can install certain pods that deploy
# doesn't because of the validation. This patch makes sure validation doesn't
# happen when deploy is being used.
#
# TODO: BDD
def apply_external_sources_patch
ExternalSources::AbstractExternalSource.class_eval do
attr_accessor :no_validate

old_validate_podspec = instance_method(:validate_podspec)

def validate_podspec(podspec)
return if no_validate
old_validate_podspec(podspec)
end
end
end

# Installs required sources for lockfile - TODO: Simplify code
def install_sources_for_lockfile
Expand Down Expand Up @@ -115,6 137,7 @@ def run

# TODO: BDD Patch
apply_resolver_patch
apply_external_sources_patch

install_sources_for_lockfile
install(transform_podfile)
Expand Down

0 comments on commit ccb0f08

Please sign in to comment.