From ccb0f08a6cb6c25fb99e1edc8545b8458062e126 Mon Sep 17 00:00:00 2001 From: Peter Verhage Date: Wed, 6 Jul 2016 17:15:09 +0200 Subject: [PATCH] Add no_validate option to external sources --- lib/cocoapods-deploy/command/deploy.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/cocoapods-deploy/command/deploy.rb b/lib/cocoapods-deploy/command/deploy.rb index 8e4c20a..2fa70f9 100644 --- a/lib/cocoapods-deploy/command/deploy.rb +++ b/lib/cocoapods-deploy/command/deploy.rb @@ -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 @@ -115,6 +137,7 @@ def run # TODO: BDD Patch apply_resolver_patch + apply_external_sources_patch install_sources_for_lockfile install(transform_podfile)