fastlane-plugin-zhuixi_build_app 1.0.1 → 1.0.4
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 +4 -4
- data/lib/fastlane/plugin/zhuixi_build_app/actions/get_pack_config_action.rb +1 -0
- data/lib/fastlane/plugin/zhuixi_build_app/actions/read_config_action.rb +2 -0
- data/lib/fastlane/plugin/zhuixi_build_app/actions/xcodeproj_merge_action.rb +56 -23
- data/lib/fastlane/plugin/zhuixi_build_app/actions/zhuixi_build_app_action.rb +7 -0
- data/lib/fastlane/plugin/zhuixi_build_app/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1ed82fabd117eb842bdfcbfb1418d0d418799c10227e34f9ca92f60471fc9ee2
         | 
| 4 | 
            +
              data.tar.gz: f2a9685986d37b8b21f4cc23fa6d05d07ae76dc646bb6fa0c266ec7a7947265b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 0a05523cfe5087b00e9ef4adfa747f423820dde113cacbedb09d714b94c4193f9506fdbb0cd9cd6b3913023c67c5ef0bc82fd55e19bcc05eaa3c53f63215f5b7
         | 
| 7 | 
            +
              data.tar.gz: 071d3dff11119c500f50cc149769bcc6adb981074273d23520f49b04fafbe15873609924bfa44c6f7b30da62c4324468c4d20f28f91bc0a6c5e862585e154e88
         | 
| @@ -15,6 +15,8 @@ module Fastlane | |
| 15 15 | 
             
                    lane_context[:selectGameName] = app_file_config[:selectGameName]
         | 
| 16 16 | 
             
                    lane_context[:selectPlatformName] = app_file_config[:platform]
         | 
| 17 17 | 
             
                    lane_context[:ori_xcodeproj_path] = app_file_config[:ori_xcodeproj_path]
         | 
| 18 | 
            +
                    lane_context[:export_method] = app_file_config[:export_method]
         | 
| 19 | 
            +
                    lane_context[:provisioning_profile_name] = app_file_config[:provisioning_profile_name]
         | 
| 18 20 | 
             
                    UI.message("ZHUIXI---读取配置成功!app_file_path:\n#{app_file_path}")
         | 
| 19 21 | 
             
                    # 返回 account 和 password
         | 
| 20 22 | 
             
                    return { account: account, password: password }
         | 
| @@ -89,6 +89,10 @@ module Fastlane | |
| 89 89 |  | 
| 90 90 | 
             
                  def self.add_channel_sdk_resources()
         | 
| 91 91 |  | 
| 92 | 
            +
                    # 设置DEBUG_INFORMATION_FORMAT
         | 
| 93 | 
            +
                    lane_context[:target].build_configuration_list.build_configurations.each do |config|
         | 
| 94 | 
            +
                      config.build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf"
         | 
| 95 | 
            +
                    end
         | 
| 92 96 | 
             
                    # 获取 Info.plist 文件的 Build Setting
         | 
| 93 97 | 
             
                    info_plist_build_setting = lane_context[:target].build_configuration_list.get_setting("INFOPLIST_FILE")
         | 
| 94 98 |  | 
| @@ -104,7 +108,9 @@ module Fastlane | |
| 104 108 |  | 
| 105 109 | 
             
                    # 如果 info_plist_data 没有 LSApplicationQueriesSchemes 配置,先创建一个空数组
         | 
| 106 110 | 
             
                    info_plist_data["LSApplicationQueriesSchemes"] ||= []
         | 
| 107 | 
            -
             | 
| 111 | 
            +
                    # 修改 Bundle Identifier 和 Display Name
         | 
| 112 | 
            +
                    info_plist_data["CFBundleIdentifier"] = lane_context[:configParams]["gamePackageName"]
         | 
| 113 | 
            +
                    info_plist_data["CFBundleDisplayName"] = lane_context[:configParams]["gamename"]
         | 
| 108 114 | 
             
                    # 3. 读取 TempInfo.plist 文件
         | 
| 109 115 | 
             
                    temp_info_plist_data = Plist.parse_xml(File.join(lane_context[:zhuixi_path], "TempInfo.plist"))
         | 
| 110 116 |  | 
| @@ -156,21 +162,39 @@ module Fastlane | |
| 156 162 | 
             
                    add_channel_sdk_library()
         | 
| 157 163 | 
             
                  end
         | 
| 158 164 | 
             
                  # 是否在动态库集合
         | 
| 159 | 
            -
                  def self.isEmbedFramework(filename | 
| 160 | 
            -
                     | 
| 165 | 
            +
                  def self.isEmbedFramework(filename)
         | 
| 166 | 
            +
                    framework_path = filename.to_s
         | 
| 167 | 
            +
                    framework_name = File.basename(framework_path, ".*") # 提取 .framework 文件的名称
         | 
| 168 | 
            +
                    if lane_context[:platform_id] == 59 && framework_name == "boRanSDK"
         | 
| 169 | 
            +
                      # 在 .framework 目录中搜索与文件名相同的文件
         | 
| 170 | 
            +
                      file_path = Dir.glob("#{framework_path}/#{framework_name}").first
         | 
| 171 | 
            +
             | 
| 172 | 
            +
                      if file_path.nil?
         | 
| 173 | 
            +
                        UI.error("File not found for #{framework_name}.")
         | 
| 174 | 
            +
                        return false
         | 
| 175 | 
            +
                      end
         | 
| 161 176 |  | 
| 162 | 
            -
             | 
| 163 | 
            -
                       | 
| 164 | 
            -
             | 
| 165 | 
            -
                       | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 168 | 
            -
                       | 
| 169 | 
            -
             | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 177 | 
            +
                      # 使用 file 命令查看文件类型
         | 
| 178 | 
            +
                      file_output = sh("file #{file_path}")
         | 
| 179 | 
            +
             | 
| 180 | 
            +
                      # 检查文件类型中是否包含 "dynamic" 或 "shared",表示动态库
         | 
| 181 | 
            +
                      is_dynamic_library = file_output.include?("dynamic") || file_output.include?("shared")
         | 
| 182 | 
            +
             | 
| 183 | 
            +
                      if is_dynamic_library
         | 
| 184 | 
            +
                        # 文件是动态库
         | 
| 185 | 
            +
                        # 执行相应的操作
         | 
| 186 | 
            +
                        # ...
         | 
| 187 | 
            +
                        puts "文件是动态库 #{framework_name}"
         | 
| 188 | 
            +
                        return true
         | 
| 189 | 
            +
                      else
         | 
| 190 | 
            +
                        # 文件是静态库
         | 
| 191 | 
            +
                        # 执行其他操作
         | 
| 192 | 
            +
                        # ...
         | 
| 193 | 
            +
                        puts "文件是静态库 #{framework_name}"
         | 
| 194 | 
            +
                        return false
         | 
| 195 | 
            +
                      end
         | 
| 173 196 | 
             
                    end
         | 
| 197 | 
            +
                    return false
         | 
| 174 198 | 
             
                  end
         | 
| 175 199 |  | 
| 176 200 | 
             
                  def self.add_channel_sdk_library()
         | 
| @@ -231,7 +255,7 @@ module Fastlane | |
| 231 255 | 
             
                        end
         | 
| 232 256 | 
             
                        #项目中可能有多个copy files build phases,找到刚刚创建的那个,然后把xx.framework引入
         | 
| 233 257 |  | 
| 234 | 
            -
                        if !"".eql? lib_real_path and isEmbedFramework(filename | 
| 258 | 
            +
                        if !"".eql? lib_real_path and isEmbedFramework(filename)
         | 
| 235 259 | 
             
                          lane_context[:target].copy_files_build_phases.each do |item|
         | 
| 236 260 | 
             
                            if item.name == "Embed Frameworks"
         | 
| 237 261 | 
             
                              #引入xx.framework
         | 
| @@ -241,10 +265,8 @@ module Fastlane | |
| 241 265 | 
             
                              item.dst_subfolder_spec = "10"
         | 
| 242 266 | 
             
                              #勾上code sign on copy选项(默认是没勾上的)
         | 
| 243 267 | 
             
                              item.files.each do |e|
         | 
| 244 | 
            -
                                 | 
| 245 | 
            -
             | 
| 246 | 
            -
                                  e.settings["ATTRIBUTES"] = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
         | 
| 247 | 
            -
                                end
         | 
| 268 | 
            +
                                e.settings = Hash.new
         | 
| 269 | 
            +
                                e.settings["ATTRIBUTES"] = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
         | 
| 248 270 | 
             
                              end
         | 
| 249 271 | 
             
                            end
         | 
| 250 272 | 
             
                          end
         | 
| @@ -299,22 +321,33 @@ module Fastlane | |
| 299 321 | 
             
                        schemefile = File.basename(new_schemefilepath, ".xcscheme")
         | 
| 300 322 | 
             
                      end
         | 
| 301 323 | 
             
                    end
         | 
| 302 | 
            -
                    lane_context[:project].save()
         | 
| 324 | 
            +
                    # lane_context[:project].save()
         | 
| 303 325 | 
             
                    # Find.find(File.join(lane_context[:cha_project_path], "xcuserdata")) do |schemefilepath|
         | 
| 304 326 | 
             
                    #   if schemefilepath.include? ".xcscheme"
         | 
| 305 327 | 
             
                    #     schemefile = schemefilepath
         | 
| 306 328 | 
             
                    #   end
         | 
| 307 329 | 
             
                    # end
         | 
| 308 | 
            -
             | 
| 309 330 | 
             
                    # 执行 fastlane gym
         | 
| 331 | 
            +
                    # other_action.update_plist( # Updates the CLIENT_ID and GOOGLE_APP_ID string entries in the plist-file
         | 
| 332 | 
            +
                    #   plist_path: File.join(lane_context[:zhuixi_path], "Info.plist"),
         | 
| 333 | 
            +
                    #   block: proc do |plist|
         | 
| 334 | 
            +
                    #     plist["CFBundleDisplayName"] = lane_context[:configParams]["gamename"]
         | 
| 335 | 
            +
                    #     plist["CFBundleIdentifier"] = lane_context[:configParams]["gamePackageName"]
         | 
| 336 | 
            +
                    #   end,
         | 
| 337 | 
            +
                    # )
         | 
| 338 | 
            +
                    lane_context[:project].save()
         | 
| 310 339 | 
             
                    puts lane_context[:configParams]
         | 
| 311 340 | 
             
                    timestamp = Time.now.strftime("%Y%m%d%H%M%S")
         | 
| 312 341 | 
             
                    output_name = lane_context[:configParams]["gamename"] + "_" + lane_context[:platform_id].to_s + "_" + lane_context[:selectPlatformName] + "_" + timestamp
         | 
| 313 342 | 
             
                    other_action.gym(
         | 
| 314 343 | 
             
                      project: lane_context[:cha_project_path],
         | 
| 315 | 
            -
                      silent: true,
         | 
| 316 344 | 
             
                      output_name: output_name,
         | 
| 317 | 
            -
                       | 
| 345 | 
            +
                      export_method: lane_context[:export_method],
         | 
| 346 | 
            +
                      export_options: {
         | 
| 347 | 
            +
                        provisioningProfiles: {
         | 
| 348 | 
            +
                          lane_context[:configParams]["gamePackageName"] => lane_context[:provisioning_profile_name],
         | 
| 349 | 
            +
                        },
         | 
| 350 | 
            +
                      },
         | 
| 318 351 | 
             
                    )
         | 
| 319 352 | 
             
                  end
         | 
| 320 353 | 
             
                end
         | 
| @@ -14,6 +14,8 @@ module Fastlane | |
| 14 14 | 
             
                    resourcesUrl = other_action.get_pack_config(game_id: game_id.to_s)
         | 
| 15 15 | 
             
                    other_action.download_resources(resourcesUrl: resourcesUrl)
         | 
| 16 16 | 
             
                    other_action.xcodeproj_merge
         | 
| 17 | 
            +
                    current_directory = Dir.pwd
         | 
| 18 | 
            +
                    puts "当前工作目录:#{current_directory}"
         | 
| 17 19 | 
             
                  end
         | 
| 18 20 | 
             
                  def self.return_value
         | 
| 19 21 | 
             
                    # If your method provides a return value, you can describe here what it does
         | 
| @@ -28,6 +30,11 @@ module Fastlane | |
| 28 30 | 
             
                                                   type: String),
         | 
| 29 31 | 
             
                    ]
         | 
| 30 32 | 
             
                  end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  def self.obfuscate_code(source_directory)
         | 
| 35 | 
            +
                    # 在这里添加源码混淆的命令
         | 
| 36 | 
            +
                    sh("ruby-minify --source-dir #{source_directory}")
         | 
| 37 | 
            +
                  end
         | 
| 31 38 | 
             
                end
         | 
| 32 39 | 
             
              end
         | 
| 33 40 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: fastlane-plugin-zhuixi_build_app
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - RedSevenMale
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023- | 
| 11 | 
            +
            date: 2023-08-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |