Sha256: d8a85cc0af1f4ee8adcec1751b8e62b4502f559e4b17e2f95f491fc874aea1ea

Contents?: true

Size: 1.99 KB

Versions: 550

Compression:

Stored size: 1.99 KB

Contents

require 'fastlane_core/core_ext/cfpropertylist'

module Fastlane
  module Actions
    class ClearDerivedDataAction < Action
      def self.run(options)
        path = File.expand_path(options[:derived_data_path])
        UI.message("Derived Data path located at: #{path}")
        FileUtils.rm_rf(path) if File.directory?(path)
        UI.success("Successfully cleared Derived Data ♻️")
      end

      # Helper Methods
      def self.xcode_preferences
        file = File.expand_path("~/Library/Preferences/com.apple.dt.Xcode.plist")
        if File.exist?(file)
          plist = CFPropertyList::List.new(file: file).value
          return CFPropertyList.native_types(plist) unless plist.nil?
        end
        return nil
      end

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

      def self.description
        "Deletes the Xcode Derived Data"
      end

      def self.details
        "Deletes the Derived Data from path set on Xcode or a supplied path"
      end

      def self.available_options
        path = xcode_preferences ? xcode_preferences['IDECustomDerivedDataLocation'] : nil
        path ||= "~/Library/Developer/Xcode/DerivedData"
        [
          FastlaneCore::ConfigItem.new(key: :derived_data_path,
                                       env_name: "DERIVED_DATA_PATH",
                                       description: "Custom path for derivedData",
                                       default_value_dynamic: true,
                                       default_value: path)
        ]
      end

      def self.output
      end

      def self.authors
        ["KrauseFx"]
      end

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

      def self.example_code
        [
          'clear_derived_data',
          'clear_derived_data(derived_data_path: "/custom/")'
        ]
      end

      def self.category
        :building
      end
    end
  end
end

Version data entries

550 entries across 550 versions & 5 rubygems

Version Path
fastlane-2.225.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.224.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.223.1 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.223.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.222.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.221.1 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.221.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.220.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.219.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.218.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-security-patched-2.216.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.217.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.216.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.215.1 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.215.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-mercafacil-2.214.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.214.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.213.0 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane-2.212.2 fastlane/lib/fastlane/actions/clear_derived_data.rb
fastlane_pricing_fix-2.212.1 fastlane/lib/fastlane/actions/clear_derived_data.rb