Sha256: 937fce15fafff5679949916eef50a2705d343720ca444cb33a4c519d5a9a6c87

Contents?: true

Size: 1.42 KB

Versions: 31

Compression:

Stored size: 1.42 KB

Contents

module Fastlane
  module Actions
    class CleanBuildArtifactsAction < Action
      def self.run(options)
        [
          Actions.lane_context[Actions::SharedValues::IPA_OUTPUT_PATH],
          Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH],
          Actions.lane_context[Actions::SharedValues::DSYM_OUTPUT_PATH],
        ].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 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.20.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.19.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.18.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.17.1 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.17.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.16.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.15.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.14.1 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.14.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.13.1 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.13.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.12.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.11.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.10.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.9.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.8.0 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.7.3 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.7.2 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.7.1 lib/fastlane/actions/clean_build_artifacts.rb
fastlane-1.7.0 lib/fastlane/actions/clean_build_artifacts.rb