Method: Pod::Lockfile.generate

Defined in:
lib/cocoapods-core/lockfile.rb

.generate(podfile, specs, checkout_options, spec_repos = {}) ⇒ Lockfile

Generates a hash representation of the Lockfile generated from a given Podfile and the list of resolved Specifications. This representation is suitable for serialization.

Parameters:

  • podfile (Podfile)

    the podfile that should be used to generate the lockfile.

  • specs (Array<Specification>)

    an array containing the podspec that were generated by resolving the given podfile.

Returns:



421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/cocoapods-core/lockfile.rb', line 421

def generate(podfile, specs, checkout_options, spec_repos = {})
  hash = {
    'PODS'             => generate_pods_data(specs),
    'DEPENDENCIES'     => generate_dependencies_data(podfile),
    'SPEC REPOS'       => generate_spec_repos(spec_repos),
    'EXTERNAL SOURCES' => generate_external_sources_data(podfile),
    'CHECKOUT OPTIONS' => checkout_options,
    'SPEC CHECKSUMS'   => generate_checksums(specs),
    'PODFILE CHECKSUM' => podfile.checksum,
    'COCOAPODS'        => CORE_VERSION,
  }
  Lockfile.new(hash)
end