Sha256: 547d7c4f84752c13cd755b77981384dfeea2787dfb8743b69bd0578864b87f06

Contents?: true

Size: 1.47 KB

Versions: 31

Compression:

Stored size: 1.47 KB

Contents

module Fastlane
  module Actions
    class CleanBuildArtifactsAction < Action
      def self.run(options)
        paths = [
          Actions.lane_context[Actions::SharedValues::IPA_OUTPUT_PATH],
          Actions.lane_context[Actions::SharedValues::DSYM_OUTPUT_PATH]
        ]

        paths += Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATHS] || []
        paths = paths.uniq

        paths.reject { |file| file.nil? || !File.exist?(file) }.each do |file|
          if options[:exclude_pattern]
            next if file.match(options[:exclude_pattern])
          end

          Helper.log.debug "Cleaning up '#{file}'".yellow
          File.delete(file)
        end

        Helper.log.info 'Cleaned up build artifacts 🐙'.green
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :exclude_pattern,
                                       env_name: "FL_CLEAN_BUILD_ARTIFACTS_EXCLUDE_PATTERN",
                                       description: "Exclude all files from clearing that match the given Regex pattern: e.g. '.*\.mobileprovision'",
                                       default_value: nil,
                                       optional: true)
        ]
      end

      def self.description
        "Deletes files created as result of running ipa or sigh"
      end

      def self.author
        "lmirosevic"
      end

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

Version data entries

31 entries across 31 versions & 1 rubygems

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