Sha256: 41b0a9d37becebe5b1c08ac6464a2dd0d53cfd1345b548a6dc8287653ceba338

Contents?: true

Size: 1.75 KB

Versions: 18

Compression:

Stored size: 1.75 KB

Contents

module Fastlane
  module Actions
    class InstallXcodePluginAction < Action
      def self.run(params)
        require 'fileutils'

        zip_path = File.join(Dir.tmpdir, 'plugin.zip')
        sh "curl -Lso #{zip_path} #{params[:url]}"
        plugins_path = "#{ENV['HOME']}/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
        FileUtils.mkdir_p(plugins_path)
        Action.sh "unzip -qo '#{zip_path}' -d '#{plugins_path}'"

        Helper.log.info("Plugin #{File.basename(params[:url], '.zip')} installed successfully".green)
        Helper.log.info("Please restart Xcode to use the newly installed plugin")
      end

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

      def self.description
        "Install an Xcode plugin for the current user"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :url,
                                       env_name: "FL_XCODE_PLUGIN_URL",
                                       description: "URL for Xcode plugin ZIP file",
                                       verify_block: proc do |value|
                                         raise "No URL for InstallXcodePluginAction given, pass using `url: 'url'`".red if value.to_s.length == 0
                                         raise "URL doesn't use HTTPS".red unless value.start_with?("https://")
                                       end)
        ]
      end

      def self.output
      end

      def self.return_value
      end

      def self.authors
        ["NeoNachoSoto"]
      end

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fastlane-1.66.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.65.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.64.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.63.1 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.63.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.62.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.61.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.60.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.59.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.58.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.57.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.56.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.55.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.54.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.53.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.52.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.51.0 lib/fastlane/actions/install_xcode_plugin.rb
fastlane-1.50.0 lib/fastlane/actions/install_xcode_plugin.rb