fastlane-plugin-debug_file 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +61 -0
- data/lib/fastlane/plugin/debug_file/actions/dsym_action.rb +159 -0
- data/lib/fastlane/plugin/debug_file/actions/proguard_action.rb +170 -0
- data/lib/fastlane/plugin/debug_file/helper/debug_file_helper.rb +36 -0
- data/lib/fastlane/plugin/debug_file/version.rb +5 -0
- data/lib/fastlane/plugin/debug_file.rb +16 -0
- metadata +176 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: 32d867b8c00c73dbc4c6c11bee6d330574e993acb58fea78ed93e1a84f32eb45
         | 
| 4 | 
            +
              data.tar.gz: d344092f370bdaca14b4aff2fd9061ece8f18d2a375807d19a0bc59cb9c5ebe3
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: d7969e5a6c16ea58f817a404c7f34fed8dd470f3f1ad12ad4b5373f593845d6962c8aed097f3ce3f45d145b918d34a8793e74b14c60ba26898ac6e5efff77557
         | 
| 7 | 
            +
              data.tar.gz: 9c3230369026fa755edefcc26325a92c7815662986f1be9198a9acde734c2e06c7d5ccb59a6cdf7df581fa393fe1f935c7908b68a98656a7ea2fa4918df6b011
         | 
    
        data/LICENSE
    ADDED
    
    | @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            The MIT License (MIT)
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Copyright (c) 2019 icyleaf <icyleaf.cn@gmail.com>
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         | 
| 6 | 
            +
            of this software and associated documentation files (the "Software"), to deal
         | 
| 7 | 
            +
            in the Software without restriction, including without limitation the rights
         | 
| 8 | 
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         | 
| 9 | 
            +
            copies of the Software, and to permit persons to whom the Software is
         | 
| 10 | 
            +
            furnished to do so, subject to the following conditions:
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            The above copyright notice and this permission notice shall be included in all
         | 
| 13 | 
            +
            copies or substantial portions of the Software.
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         | 
| 16 | 
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         | 
| 17 | 
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         | 
| 18 | 
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         | 
| 19 | 
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         | 
| 20 | 
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         | 
| 21 | 
            +
            SOFTWARE.
         | 
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,61 @@ | |
| 1 | 
            +
            # debug_file plugin
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            [](https://rubygems.org/gems/fastlane-plugin-debug_file)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            ## Getting Started
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-debug_file`, add it to your project by running:
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            ```bash
         | 
| 10 | 
            +
            fastlane add_plugin debug_file
         | 
| 11 | 
            +
            ```
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            ## About debug_file
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            debug_file plugin includes two actions:
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            - `dsym`: Find iOS/macOS app dSYM and compress automatically
         | 
| 18 | 
            +
            - `proguard`: Find Android proguard and compress automatically
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            ### dsym
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            Why another `dsym` action? fastlane was built-in simlar action named [dsym_zip](https://docs.fastlane.tools/actions/dsym_zip/) which it only accepts spetical path, our `dsym` it counld find dSYM
         | 
| 23 | 
            +
            file automatically, even accpets multiple dSYM to compress.
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            ### proguard
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            If Android app set `minifyEnabled = true`, it called proguard, `proguard` could find `mapping.txt`,
         | 
| 28 | 
            +
            `R.txt` and `AndroidManifest.xml` automatically.
         | 
| 29 | 
            +
             | 
| 30 | 
            +
            ## Example
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            ## Run tests for this plugin
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            To run both the tests, and code style validation, run
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            ```
         | 
| 39 | 
            +
            rake
         | 
| 40 | 
            +
            ```
         | 
| 41 | 
            +
             | 
| 42 | 
            +
            To automatically fix many of the styling issues, use
         | 
| 43 | 
            +
            ```
         | 
| 44 | 
            +
            rubocop -a
         | 
| 45 | 
            +
            ```
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            ## Issues and Feedback
         | 
| 48 | 
            +
             | 
| 49 | 
            +
            For any other issues and feedback about this plugin, please submit it to this repository.
         | 
| 50 | 
            +
             | 
| 51 | 
            +
            ## Troubleshooting
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            ## Using _fastlane_ Plugins
         | 
| 56 | 
            +
             | 
| 57 | 
            +
            For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
         | 
| 58 | 
            +
             | 
| 59 | 
            +
            ## About _fastlane_
         | 
| 60 | 
            +
             | 
| 61 | 
            +
            _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
         | 
| @@ -0,0 +1,159 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'fastlane/action'
         | 
| 4 | 
            +
            require_relative '../helper/debug_file_helper'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            module Fastlane
         | 
| 7 | 
            +
              module Actions
         | 
| 8 | 
            +
                module SharedValues
         | 
| 9 | 
            +
                  DF_DSYM_ZIP_PATH = :DF_DSYM_ZIP_PATH
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                class DsymAction < Action
         | 
| 13 | 
            +
                  ARCHIVE_PATH = File.expand_path('~/Library/Developer/Xcode/Archives')
         | 
| 14 | 
            +
                  OUTPUT_PATH = '.'
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  def self.run(params)
         | 
| 17 | 
            +
                    archive_path = File.expand_path(params[:archive_path])
         | 
| 18 | 
            +
                    scheme = params[:scheme]
         | 
| 19 | 
            +
                    overwrite = params[:overwrite]
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                    app_dsym_filename = "#{scheme}.app.dsym"
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                    output_path = params[:output_path]
         | 
| 24 | 
            +
                    output_file = File.join(output_path, "#{app_dsym_filename}.zip")
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                    Helper::DebugFileHelper.determine_output_file(output_file, overwrite)
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                    archive_dsym_path = last_created_dsym(scheme, archive_path)
         | 
| 29 | 
            +
                    if archive_dsym_path && !Dir.exist?(archive_dsym_path)
         | 
| 30 | 
            +
                      UI.user_error! "Not matched any archive with scheme: #{scheme}"
         | 
| 31 | 
            +
                    end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                    UI.success "Selected dSYM archive path: #{File.basename(File.dirname(archive_dsym_path))}"
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                    extra_dsym = params[:extra_dsym] || []
         | 
| 36 | 
            +
                    dsym_files = [app_dsym_filename].concat(extra_dsym).uniq
         | 
| 37 | 
            +
                    dsym_files.each_with_index do |filename, i|
         | 
| 38 | 
            +
                      path = File.join(archive_dsym_path, filename)
         | 
| 39 | 
            +
                      if Dir.exist?(path)
         | 
| 40 | 
            +
                        dsym_files[i] = path
         | 
| 41 | 
            +
                      else
         | 
| 42 | 
            +
                        dsym_files.delete_at(i)
         | 
| 43 | 
            +
                      end
         | 
| 44 | 
            +
                    end
         | 
| 45 | 
            +
                    UI.success "Prepare #{dsym_files.size} dSYM file(s) compressing"
         | 
| 46 | 
            +
                    Helper::DebugFileHelper.compress(dsym_files, output_file)
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                    UI.success "Compressed proguard files: #{output_file}"
         | 
| 49 | 
            +
                    Helper::DebugFileHelper.store_shard_value SharedValues::DF_DSYM_ZIP_PATH, output_file
         | 
| 50 | 
            +
                  end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                  def self.last_created_dsym(scheme, archive_path)
         | 
| 53 | 
            +
                    info_path = File.join(archive_path, '**', '*.xcarchive', 'Info.plist')
         | 
| 54 | 
            +
                    matched_paths = []
         | 
| 55 | 
            +
                    Dir.glob(info_path) do |path|
         | 
| 56 | 
            +
                      name = get_plist_value(path, 'Name')
         | 
| 57 | 
            +
                      if scheme == name
         | 
| 58 | 
            +
                        matched_paths << path
         | 
| 59 | 
            +
                      end
         | 
| 60 | 
            +
                    end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                    return if matched_paths.empty?
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                    UI.verbose "Found #{matched_paths.size} matched dSYM archive(s)"
         | 
| 65 | 
            +
                    last_created_path = matched_paths.size == 1 ? matched_paths.first : matched_paths.max_by { |p| File.stat(p).mtime }
         | 
| 66 | 
            +
                    File.join(File.dirname(last_created_path), 'dSYMs')
         | 
| 67 | 
            +
                  end
         | 
| 68 | 
            +
                  private_class_method :last_created_dsym
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                  def self.get_plist_value(file, key)
         | 
| 71 | 
            +
                    plist = read_plist(file)
         | 
| 72 | 
            +
                    plist[key.to_s]
         | 
| 73 | 
            +
                  end
         | 
| 74 | 
            +
                  private_class_method :get_plist_value
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                  def self.read_plist(file)
         | 
| 77 | 
            +
                    require 'plist'
         | 
| 78 | 
            +
                    Plist.parse_xml(file)
         | 
| 79 | 
            +
                  end
         | 
| 80 | 
            +
                  private_class_method :read_plist
         | 
| 81 | 
            +
             | 
| 82 | 
            +
                  #####################################################
         | 
| 83 | 
            +
                  # @!group Documentation
         | 
| 84 | 
            +
                  #####################################################
         | 
| 85 | 
            +
             | 
| 86 | 
            +
                  def self.description
         | 
| 87 | 
            +
                    'Find and generate iOS/MacOS dSYM file(s) to zip file'
         | 
| 88 | 
            +
                  end
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                  def self.available_options
         | 
| 91 | 
            +
                    [
         | 
| 92 | 
            +
                      FastlaneCore::ConfigItem.new(key: :archive_path,
         | 
| 93 | 
            +
                                                   env_name: 'DF_DSYM_ARCHIVE_PATH',
         | 
| 94 | 
            +
                                                   description: 'The archive path of xcode',
         | 
| 95 | 
            +
                                                   type: String,
         | 
| 96 | 
            +
                                                   default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE] || ARCHIVE_PATH,
         | 
| 97 | 
            +
                                                   optional: true),
         | 
| 98 | 
            +
                      FastlaneCore::ConfigItem.new(key: :scheme,
         | 
| 99 | 
            +
                                                   env_name: 'DF_DSYM_SCHEME',
         | 
| 100 | 
            +
                                                   description: 'The scheme name of app',
         | 
| 101 | 
            +
                                                   type: String),
         | 
| 102 | 
            +
                      FastlaneCore::ConfigItem.new(key: :extra_dsym,
         | 
| 103 | 
            +
                                                   env_name: 'DF_DSYM_EXTRA_DSYM',
         | 
| 104 | 
            +
                                                   description: 'A set file name of dSYM',
         | 
| 105 | 
            +
                                                   optional: true,
         | 
| 106 | 
            +
                                                   default_value: [],
         | 
| 107 | 
            +
                                                   type: Array),
         | 
| 108 | 
            +
                      FastlaneCore::ConfigItem.new(key: :output_path,
         | 
| 109 | 
            +
                                                   env_name: 'DF_DSYM_OUTPUT_PATH',
         | 
| 110 | 
            +
                                                   description: "The output path of compressed dSYM file",
         | 
| 111 | 
            +
                                                   default_value: OUTPUT_PATH,
         | 
| 112 | 
            +
                                                   optional: true,
         | 
| 113 | 
            +
                                                   type: String),
         | 
| 114 | 
            +
                      FastlaneCore::ConfigItem.new(key: :overwrite,
         | 
| 115 | 
            +
                                                   env_name: 'DF_DSYM_OVERWRITE',
         | 
| 116 | 
            +
                                                   description: "Overwrite output compressed file if it existed",
         | 
| 117 | 
            +
                                                   default_value: false,
         | 
| 118 | 
            +
                                                   type: Boolean)
         | 
| 119 | 
            +
                    ]
         | 
| 120 | 
            +
                  end
         | 
| 121 | 
            +
             | 
| 122 | 
            +
                  def self.example_code
         | 
| 123 | 
            +
                    [
         | 
| 124 | 
            +
                      'dsym',
         | 
| 125 | 
            +
                      'dsym(
         | 
| 126 | 
            +
                        archive_path: "~/Library/Developer/Xcode/Archives",
         | 
| 127 | 
            +
                        overwrite: true,
         | 
| 128 | 
            +
                        extra_dsym: [
         | 
| 129 | 
            +
                          "AFNetworking.framework.dSYM",
         | 
| 130 | 
            +
                          "Masonry.framework.dSYM"
         | 
| 131 | 
            +
                        ]
         | 
| 132 | 
            +
                      )'
         | 
| 133 | 
            +
                    ]
         | 
| 134 | 
            +
                  end
         | 
| 135 | 
            +
             | 
| 136 | 
            +
                  def self.category
         | 
| 137 | 
            +
                    :misc
         | 
| 138 | 
            +
                  end
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                  def self.return_value
         | 
| 141 | 
            +
                    String
         | 
| 142 | 
            +
                  end
         | 
| 143 | 
            +
             | 
| 144 | 
            +
                  def self.output
         | 
| 145 | 
            +
                    [
         | 
| 146 | 
            +
                      ['DF_DSYM_ZIP_PATH', 'the path of compressed proguard file']
         | 
| 147 | 
            +
                    ]
         | 
| 148 | 
            +
                  end
         | 
| 149 | 
            +
             | 
| 150 | 
            +
                  def self.authors
         | 
| 151 | 
            +
                    ['icyleaf']
         | 
| 152 | 
            +
                  end
         | 
| 153 | 
            +
             | 
| 154 | 
            +
                  def self.is_supported?(platform)
         | 
| 155 | 
            +
                    [:ios, :mac].include?(platform)
         | 
| 156 | 
            +
                  end
         | 
| 157 | 
            +
                end
         | 
| 158 | 
            +
              end
         | 
| 159 | 
            +
            end
         | 
| @@ -0,0 +1,170 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'fastlane/action'
         | 
| 4 | 
            +
            require_relative '../helper/debug_file_helper'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            module Fastlane
         | 
| 7 | 
            +
              module Actions
         | 
| 8 | 
            +
                module SharedValues
         | 
| 9 | 
            +
                  DF_PROGUARD_ZIP_PATH = :DF_PROGUARD_ZIP_PATH
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                class ProguardAction < Action
         | 
| 13 | 
            +
                  MATCHES_FILES = {
         | 
| 14 | 
            +
                    mapping: {
         | 
| 15 | 
            +
                      name: 'mapping.txt',
         | 
| 16 | 
            +
                      path: 'build/outputs/mapping'
         | 
| 17 | 
            +
                    },
         | 
| 18 | 
            +
                    manifest: {
         | 
| 19 | 
            +
                      name: 'AndroidManifest.xml',
         | 
| 20 | 
            +
                      path: 'build/intermediates/manifests/full'
         | 
| 21 | 
            +
                    },
         | 
| 22 | 
            +
                    symbol: {
         | 
| 23 | 
            +
                      name: 'R.txt',
         | 
| 24 | 
            +
                      path: 'build/intermediates/symbols'
         | 
| 25 | 
            +
                    }
         | 
| 26 | 
            +
                  }
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                  APP_PATH = 'app'
         | 
| 29 | 
            +
                  RELEASE_TYPE = 'release'
         | 
| 30 | 
            +
                  OUTPUT_PATH = '.'
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                  def self.run(params)
         | 
| 33 | 
            +
                    app_path = params[:app_path]
         | 
| 34 | 
            +
                    build_type = params[:build_type]
         | 
| 35 | 
            +
                    flavor = params[:flavor]
         | 
| 36 | 
            +
                    overwrite = params[:overwrite]
         | 
| 37 | 
            +
                    extra_files = params[:extra_files]
         | 
| 38 | 
            +
                    output_path = params[:output_path]
         | 
| 39 | 
            +
                    output_file = File.join(output_path, zip_filename(build_type, flavor))
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                    Helper::DebugFileHelper.determine_output_file(output_file, overwrite)
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                    src_files = find_proguard_files(app_path, build_type, flavor, extra_files)
         | 
| 44 | 
            +
                    UI.user_error! 'No found any proguard file' if src_files.empty?
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                    UI.success "Found #{src_files.size} debug information files"
         | 
| 47 | 
            +
                    Helper::DebugFileHelper.compress(src_files, output_file)
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                    UI.success "Compressed proguard files: #{output_file}"
         | 
| 50 | 
            +
                    Helper::DebugFileHelper.store_shard_value SharedValues::DF_PROGUARD_ZIP_PATH, output_file
         | 
| 51 | 
            +
                  end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                  def self.find_proguard_files(app_path, build_type, flavor, extra_files)
         | 
| 54 | 
            +
                    src_files = []
         | 
| 55 | 
            +
                    MATCHES_FILES.each do |_, file|
         | 
| 56 | 
            +
                      path, existed = find_file(app_path, file, build_type, flavor)
         | 
| 57 | 
            +
                      UI.verbose("File path `#{path}` exist: #{existed}")
         | 
| 58 | 
            +
                      next unless existed
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                      src_files << path
         | 
| 61 | 
            +
                    end
         | 
| 62 | 
            +
             | 
| 63 | 
            +
                    extra_files.each do |file|
         | 
| 64 | 
            +
                      existed = File.exist?(file)
         | 
| 65 | 
            +
                      UI.verbose("File path `#{file}` exist: #{existed}")
         | 
| 66 | 
            +
                      next unless existed
         | 
| 67 | 
            +
             | 
| 68 | 
            +
                      src_files << file
         | 
| 69 | 
            +
                    end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
                    src_files.uniq
         | 
| 72 | 
            +
                  end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                  def self.find_file(app_path, file, build_type, flavor)
         | 
| 75 | 
            +
                    flavor ||= ''
         | 
| 76 | 
            +
                    path = File.join(app_path, file[:path], flavor, build_type, file[:name])
         | 
| 77 | 
            +
                    [path, File.exist?(path)]
         | 
| 78 | 
            +
                  end
         | 
| 79 | 
            +
                  private_class_method :find_file
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                  def self.zip_filename(build_type, flavor = nil)
         | 
| 82 | 
            +
                    flavor = flavor.to_s.empty? ? '' : "#{flavor}-"
         | 
| 83 | 
            +
                    "#{flavor}#{build_type}-proguard.zip"
         | 
| 84 | 
            +
                  end
         | 
| 85 | 
            +
                  private_class_method :zip_filename
         | 
| 86 | 
            +
             | 
| 87 | 
            +
                  #####################################################
         | 
| 88 | 
            +
                  # @!group Documentation
         | 
| 89 | 
            +
                  #####################################################
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                  def self.description
         | 
| 92 | 
            +
                    'Find and generate Android proguard file(s) to zip file'
         | 
| 93 | 
            +
                  end
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                  def self.available_options
         | 
| 96 | 
            +
                    [
         | 
| 97 | 
            +
                      FastlaneCore::ConfigItem.new(key: :app_path,
         | 
| 98 | 
            +
                                                   env_name: 'DF_PROGUARD_PATH',
         | 
| 99 | 
            +
                                                   description: 'The path of app project',
         | 
| 100 | 
            +
                                                   default_value: APP_PATH,
         | 
| 101 | 
            +
                                                   type: String),
         | 
| 102 | 
            +
                      FastlaneCore::ConfigItem.new(key: :build_type,
         | 
| 103 | 
            +
                                                   env_name: 'DF_PROGUARD_BUILD_TYPE',
         | 
| 104 | 
            +
                                                   description: 'The build type of app',
         | 
| 105 | 
            +
                                                   default_value: RELEASE_TYPE,
         | 
| 106 | 
            +
                                                   type: String),
         | 
| 107 | 
            +
                      FastlaneCore::ConfigItem.new(key: :flavor,
         | 
| 108 | 
            +
                                                   env_name: 'DF_PROGUARD_FLAVOR',
         | 
| 109 | 
            +
                                                   description: 'The product flavor of app',
         | 
| 110 | 
            +
                                                   optional: true,
         | 
| 111 | 
            +
                                                   type: String),
         | 
| 112 | 
            +
                      FastlaneCore::ConfigItem.new(key: :extra_files,
         | 
| 113 | 
            +
                                                   env_name: 'DF_PROGUARD_EXTRA_FILES',
         | 
| 114 | 
            +
                                                   description: 'The extra files of app project',
         | 
| 115 | 
            +
                                                   optional: true,
         | 
| 116 | 
            +
                                                   default_value: [],
         | 
| 117 | 
            +
                                                   type: Array),
         | 
| 118 | 
            +
                      FastlaneCore::ConfigItem.new(key: :output_path,
         | 
| 119 | 
            +
                                                   env_name: 'DF_PROGUARD_OUTPUT_PATH',
         | 
| 120 | 
            +
                                                   description: "The output path of compressed proguard file",
         | 
| 121 | 
            +
                                                   default_value: OUTPUT_PATH,
         | 
| 122 | 
            +
                                                   optional: true,
         | 
| 123 | 
            +
                                                   type: String),
         | 
| 124 | 
            +
                      FastlaneCore::ConfigItem.new(key: :overwrite,
         | 
| 125 | 
            +
                                                   env_name: 'DF_PROGUARD_OVERWRITE',
         | 
| 126 | 
            +
                                                   description: "Overwrite output compressed file if it existed",
         | 
| 127 | 
            +
                                                   default_value: false,
         | 
| 128 | 
            +
                                                   type: Boolean)
         | 
| 129 | 
            +
                    ]
         | 
| 130 | 
            +
                  end
         | 
| 131 | 
            +
             | 
| 132 | 
            +
                  def self.example_code
         | 
| 133 | 
            +
                    [
         | 
| 134 | 
            +
                      'proguard',
         | 
| 135 | 
            +
                      'proguard(
         | 
| 136 | 
            +
                        build_type: "release",
         | 
| 137 | 
            +
                        flavor: "full"
         | 
| 138 | 
            +
                      )',
         | 
| 139 | 
            +
                      'proguard(
         | 
| 140 | 
            +
                        extra_files: [
         | 
| 141 | 
            +
                          "app/src/main/AndroidManifest.xml"
         | 
| 142 | 
            +
                        ]
         | 
| 143 | 
            +
                      )'
         | 
| 144 | 
            +
                    ]
         | 
| 145 | 
            +
                  end
         | 
| 146 | 
            +
             | 
| 147 | 
            +
                  def self.category
         | 
| 148 | 
            +
                    :misc
         | 
| 149 | 
            +
                  end
         | 
| 150 | 
            +
             | 
| 151 | 
            +
                  def self.return_value
         | 
| 152 | 
            +
                    String
         | 
| 153 | 
            +
                  end
         | 
| 154 | 
            +
             | 
| 155 | 
            +
                  def self.output
         | 
| 156 | 
            +
                    [
         | 
| 157 | 
            +
                      ['DF_PROGUARD_ZIP_PATH', 'the path of compressed proguard file']
         | 
| 158 | 
            +
                    ]
         | 
| 159 | 
            +
                  end
         | 
| 160 | 
            +
             | 
| 161 | 
            +
                  def self.authors
         | 
| 162 | 
            +
                    ['icyleaf']
         | 
| 163 | 
            +
                  end
         | 
| 164 | 
            +
             | 
| 165 | 
            +
                  def self.is_supported?(platform)
         | 
| 166 | 
            +
                    platform == :android
         | 
| 167 | 
            +
                  end
         | 
| 168 | 
            +
                end
         | 
| 169 | 
            +
              end
         | 
| 170 | 
            +
            end
         | 
| @@ -0,0 +1,36 @@ | |
| 1 | 
            +
            require 'fastlane_core/ui/ui'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Fastlane
         | 
| 4 | 
            +
              UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              module Helper
         | 
| 7 | 
            +
                class DebugFileHelper
         | 
| 8 | 
            +
                  def self.compress(src_files, desc_file)
         | 
| 9 | 
            +
                    require 'zip'
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    output_path = File.dirname(desc_file)
         | 
| 12 | 
            +
                    FileUtils.mkdir_p output_path unless Dir.exist?(output_path)
         | 
| 13 | 
            +
                    ::Zip::File.open(desc_file, ::Zip::File::CREATE) do |zipfile|
         | 
| 14 | 
            +
                      src_files.each do |file|
         | 
| 15 | 
            +
                        zipfile.add File.basename(file), file
         | 
| 16 | 
            +
                      end
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  def self.determine_output_file(output_file, overwrite)
         | 
| 21 | 
            +
                    if File.exist?(output_file)
         | 
| 22 | 
            +
                      if overwrite
         | 
| 23 | 
            +
                        FileUtils.rm_f output_file
         | 
| 24 | 
            +
                      else
         | 
| 25 | 
            +
                        UI.user_error! "Compressed file was existed: #{output_file}"
         | 
| 26 | 
            +
                      end
         | 
| 27 | 
            +
                    end
         | 
| 28 | 
            +
                  end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  def self.store_shard_value(key, value)
         | 
| 31 | 
            +
                    Actions.lane_context[key] = value
         | 
| 32 | 
            +
                    ENV[key.to_s] = value
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
            end
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            require 'fastlane/plugin/debug_file/version'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Fastlane
         | 
| 4 | 
            +
              module DebugFile
         | 
| 5 | 
            +
                # Return all .rb files inside the "actions" and "helper" directory
         | 
| 6 | 
            +
                def self.all_classes
         | 
| 7 | 
            +
                  Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
              end
         | 
| 10 | 
            +
            end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            # By default we want to import all available actions and helpers
         | 
| 13 | 
            +
            # A plugin can contain any number of actions and plugins
         | 
| 14 | 
            +
            Fastlane::DebugFile.all_classes.each do |current|
         | 
| 15 | 
            +
              require current
         | 
| 16 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,176 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: fastlane-plugin-debug_file
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - icyleaf
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2020-01-03 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: pry
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - ">="
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '0'
         | 
| 20 | 
            +
              type: :development
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - ">="
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '0'
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: bundler
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - ">="
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '0'
         | 
| 34 | 
            +
              type: :development
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - ">="
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '0'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: rspec
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - ">="
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '0'
         | 
| 48 | 
            +
              type: :development
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - ">="
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '0'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: rspec_junit_formatter
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - ">="
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '0'
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - ">="
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '0'
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: rake
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - ">="
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: '0'
         | 
| 76 | 
            +
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - ">="
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: '0'
         | 
| 83 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            +
              name: rubocop
         | 
| 85 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 | 
            +
                requirements:
         | 
| 87 | 
            +
                - - '='
         | 
| 88 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            +
                    version: 0.49.1
         | 
| 90 | 
            +
              type: :development
         | 
| 91 | 
            +
              prerelease: false
         | 
| 92 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 | 
            +
                requirements:
         | 
| 94 | 
            +
                - - '='
         | 
| 95 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            +
                    version: 0.49.1
         | 
| 97 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            +
              name: rubocop-require_tools
         | 
| 99 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 | 
            +
                requirements:
         | 
| 101 | 
            +
                - - ">="
         | 
| 102 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            +
                    version: '0'
         | 
| 104 | 
            +
              type: :development
         | 
| 105 | 
            +
              prerelease: false
         | 
| 106 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 | 
            +
                requirements:
         | 
| 108 | 
            +
                - - ">="
         | 
| 109 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            +
                    version: '0'
         | 
| 111 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 112 | 
            +
              name: simplecov
         | 
| 113 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 114 | 
            +
                requirements:
         | 
| 115 | 
            +
                - - ">="
         | 
| 116 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 117 | 
            +
                    version: '0'
         | 
| 118 | 
            +
              type: :development
         | 
| 119 | 
            +
              prerelease: false
         | 
| 120 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 121 | 
            +
                requirements:
         | 
| 122 | 
            +
                - - ">="
         | 
| 123 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 124 | 
            +
                    version: '0'
         | 
| 125 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 126 | 
            +
              name: fastlane
         | 
| 127 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 128 | 
            +
                requirements:
         | 
| 129 | 
            +
                - - ">="
         | 
| 130 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 131 | 
            +
                    version: 2.139.0
         | 
| 132 | 
            +
              type: :development
         | 
| 133 | 
            +
              prerelease: false
         | 
| 134 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 135 | 
            +
                requirements:
         | 
| 136 | 
            +
                - - ">="
         | 
| 137 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 138 | 
            +
                    version: 2.139.0
         | 
| 139 | 
            +
            description: 
         | 
| 140 | 
            +
            email: icyleaf.cn@gmail.com
         | 
| 141 | 
            +
            executables: []
         | 
| 142 | 
            +
            extensions: []
         | 
| 143 | 
            +
            extra_rdoc_files: []
         | 
| 144 | 
            +
            files:
         | 
| 145 | 
            +
            - LICENSE
         | 
| 146 | 
            +
            - README.md
         | 
| 147 | 
            +
            - lib/fastlane/plugin/debug_file.rb
         | 
| 148 | 
            +
            - lib/fastlane/plugin/debug_file/actions/dsym_action.rb
         | 
| 149 | 
            +
            - lib/fastlane/plugin/debug_file/actions/proguard_action.rb
         | 
| 150 | 
            +
            - lib/fastlane/plugin/debug_file/helper/debug_file_helper.rb
         | 
| 151 | 
            +
            - lib/fastlane/plugin/debug_file/version.rb
         | 
| 152 | 
            +
            homepage: https://github.com/icyleaf/fastlane-plugin-debug_file
         | 
| 153 | 
            +
            licenses:
         | 
| 154 | 
            +
            - MIT
         | 
| 155 | 
            +
            metadata: {}
         | 
| 156 | 
            +
            post_install_message: 
         | 
| 157 | 
            +
            rdoc_options: []
         | 
| 158 | 
            +
            require_paths:
         | 
| 159 | 
            +
            - lib
         | 
| 160 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 161 | 
            +
              requirements:
         | 
| 162 | 
            +
              - - ">="
         | 
| 163 | 
            +
                - !ruby/object:Gem::Version
         | 
| 164 | 
            +
                  version: '0'
         | 
| 165 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 166 | 
            +
              requirements:
         | 
| 167 | 
            +
              - - ">="
         | 
| 168 | 
            +
                - !ruby/object:Gem::Version
         | 
| 169 | 
            +
                  version: '0'
         | 
| 170 | 
            +
            requirements: []
         | 
| 171 | 
            +
            rubygems_version: 3.0.6
         | 
| 172 | 
            +
            signing_key: 
         | 
| 173 | 
            +
            specification_version: 4
         | 
| 174 | 
            +
            summary: Compress iOS/macApp dSYM or Android Proguard(mapping/R/AndroidManifest) to
         | 
| 175 | 
            +
              zip file
         | 
| 176 | 
            +
            test_files: []
         |