Sha256: 1f671f462dee7122843db01599c2d354d388445d3d54c542e84c018acbe6ed82

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 KB

Contents

module Fastlane
  module Actions
    class VersionGetPodspecAction < Action
      def self.run(params)
        podspec_path = params[:path]

        UI.user_error!("Could not find podspec file at path '#{podspec_path}'") unless File.exist? podspec_path

        version_podspec_file = Helper::PodspecHelper.new(podspec_path)

        Actions.lane_context[SharedValues::PODSPEC_VERSION_NUMBER] = version_podspec_file.version_value
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Receive the version number from a podspec file"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :path,
                                       env_name: "FL_VERSION_PODSPEC_PATH",
                                       description: "You must specify the path to the podspec file",
                                       is_string: true,
                                       default_value: Dir["*.podspec"].last,
                                       verify_block: proc do |value|
                                         UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0
                                       end)
        ]
      end

      def self.output
        [
          ['PODSPEC_VERSION_NUMBER', 'The podspec version number']
        ]
      end

      def self.authors
        ["Liquidsoul", "KrauseFx"]
      end

      def self.is_supported?(platform)
        [:ios, :mac].include? platform
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastlane-1.104.0 lib/fastlane/actions/version_get_podspec.rb
fastlane-1.103.0 lib/fastlane/actions/version_get_podspec.rb