class Pod::PodfileTemplate

Constants

IOS_VERSION

Attributes

baseline_version[R]
componentsList[R]
sources[R]

Public Class Methods

new(baseline_version, componentsList, sources) click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 10
def initialize(baseline_version, componentsList, sources)
  @baseline_version = baseline_version
  @componentsList = componentsList
  @sources = sources
end

Public Instance Methods

platform() click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 32
    def platform
      <<-SPEC
platform :ios, #{IOS_VERSION}
inhibit_all_warnings!
      SPEC
    end
post_install_setup() click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 73
    def post_install_setup
      <<-SPEC
def update_deployment_config(config = nil)
  return if config.nil?
  config.build_settings['ENABLE_BITCODE'] = 'NO'
  if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
  end
end

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    update_deployment_config(config)
  end
  
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      update_deployment_config(config)
    end
  end
  ## for generate_multiple_pod_projects = true
  installer.generated_projects.each do |project|
    project.build_configurations.each do |config|
      update_deployment_config(config)
    end
    
    project.targets.each do |target|
      target.build_configurations.each do |config|
        update_deployment_config(config)
      end
    end
  end

end
      SPEC
    end
releasePod() click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 44
    def releasePod
      <<-SPEC
      
def release_pod
  #baseline version #{baseline_version}
  #{@componentsList.map { |component|
        result = "\tpod '#{component.name}'"
        if !component.version.nil? 
          result = result + ", '#{component.version}'"
        end
        
        if !component.subspecs.nil?
          result = result + ", :subspecs => #{component.subspecs}"
        end
        result
  }.join("\n")}
end
      SPEC
    end
source_template() click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 39
def source_template
  source_urls = sources.split(",")
  "#{source_urls.map{ |url| "source '#{url}'"}.join("\n")}"
end
target() click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 64
    def target
      <<-SPEC
target 'Template_InHouse' do
  release_pod
  pod 'App/Debug', :path => './../DevPods/', :inhibitat_warnings => false
end
      SPEC
    end
to_dsl() click to toggle source
# File lib/cocoapods-vemars/hook/podfile_template.rb, line 16
    def to_dsl
      <<-SPEC

 #{platform}

#plugin 'cocoapods-vemars'
install! 'cocoapods', :deterministic_uuids => false

#{source_template}

#{releasePod}
#{target}
#{post_install_setup}
      SPEC
    end