cocoapods-tdf-bin 0.0.12 → 0.0.16
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/cocoapods-tdf-bin/command/bin/auto.rb +1 -0
 - data/lib/cocoapods-tdf-bin/config/config.rb +4 -4
 - data/lib/cocoapods-tdf-bin/gem_version.rb +1 -1
 - data/lib/cocoapods-tdf-bin/helpers/framework_builder.rb +22 -2
 - data/lib/cocoapods-tdf-bin/helpers/spec_creator.rb +1 -3
 - data/lib/cocoapods-tdf-bin/helpers/spec_source_creator.rb +18 -2
 - data/lib/cocoapods-tdf-bin/native/resolver.rb +19 -4
 - 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: cf063e0d4570d17654e501c087cd63ae676b990238bb720cf5ff5303972a6984
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c230891ecb4fbaacf6dcdedcb70f1c92610a164c31f75965a125fac8a49034de
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e682d524e2a7ab92f8be63fd9aafa1ec1fb190b2397d5991e9e7873294d1cee4390c510390ef240a772580685633098970af651772289464323c0c3cd8cbe2b4
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 7a6c7498c6fc74a2972c157b92c6cf7181350e936ddf03e6c43defd9f4ed4063f67dd6b0ce3f03d6843f40c57fee36fbb086f13f91058e83cee1aa78727f52b2
         
     | 
| 
         @@ -12,10 +12,10 @@ module CBin 
     | 
|
| 
       12 
12 
     | 
    
         
             
                def template_hash
         
     | 
| 
       13 
13 
     | 
    
         
             
                  {
         
     | 
| 
       14 
14 
     | 
    
         
             
                      'configuration_env' => { description: '编译环境', default: 'dev', selection: %w[dev debug_iphoneos release_iphoneos] },
         
     | 
| 
       15 
     | 
    
         
            -
                      'code_repo_url' => { description: '源码私有源 Git 地址', default: 'git@ 
     | 
| 
       16 
     | 
    
         
            -
                      'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@ 
     | 
| 
       17 
     | 
    
         
            -
                      'binary_download_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http:// 
     | 
| 
       18 
     | 
    
         
            -
                      'binary_upload_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http:// 
     | 
| 
      
 15 
     | 
    
         
            +
                      'code_repo_url' => { description: '源码私有源 Git 地址', default: 'git@git.2dfire.net:ios/cocoapods-spec.git' },
         
     | 
| 
      
 16 
     | 
    
         
            +
                      'binary_repo_url' => { description: '二进制私有源 Git 地址', default: 'git@git.2dfire.net:ios/cocoapods-spec-binary.git' },
         
     | 
| 
      
 17 
     | 
    
         
            +
                      'binary_download_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://iosframeworkserver-shopkeeperclient.app.2dfire.com/download/%s/%s.zip' },
         
     | 
| 
      
 18 
     | 
    
         
            +
                      'binary_upload_url' => { description: '二进制下载地址,内部会依次传入组件名称与版本,替换字符串中的 %s ', default: 'http://iosframeworkserver-shopkeeperclient.app.2dfire.com/upload/%s/%s.zip' },
         
     | 
| 
       19 
19 
     | 
    
         
             
                      # 'binary_type' => { description: '二进制打包类型', default: 'framework', selection: %w[framework library] },
         
     | 
| 
       20 
20 
     | 
    
         
             
                      'download_file_type' => { description: '下载二进制文件类型', default: 'zip', selection: %w[zip tgz tar tbz txz dmg] }
         
     | 
| 
       21 
21 
     | 
    
         
             
                  }
         
     | 
| 
         @@ -258,8 +258,17 @@ module CBin 
     | 
|
| 
       258 
258 
     | 
    
         
             
                      resources.each do |source|
         
     | 
| 
       259 
259 
     | 
    
         
             
                        escape_resource << Shellwords.join(source)
         
     | 
| 
       260 
260 
     | 
    
         
             
                      end
         
     | 
| 
       261 
     | 
    
         
            -
             
     | 
| 
       262 
     | 
    
         
            -
                       
     | 
| 
      
 261 
     | 
    
         
            +
             
     | 
| 
      
 262 
     | 
    
         
            +
                      escape_resource_str = escape_resource.join(' ')
         
     | 
| 
      
 263 
     | 
    
         
            +
                      escape_resource_arr = escape_resource_str.split(' ')
         
     | 
| 
      
 264 
     | 
    
         
            +
             
     | 
| 
      
 265 
     | 
    
         
            +
                      escape_resource_arr = escape_resource_arr.select do | source |
         
     | 
| 
      
 266 
     | 
    
         
            +
                        suffix = File.extname(source)
         
     | 
| 
      
 267 
     | 
    
         
            +
                        not expand_suffix(suffix)
         
     | 
| 
      
 268 
     | 
    
         
            +
                      end
         
     | 
| 
      
 269 
     | 
    
         
            +
             
     | 
| 
      
 270 
     | 
    
         
            +
                      UI.message "Copying resources #{escape_resource_arr}"
         
     | 
| 
      
 271 
     | 
    
         
            +
                      `cp -rp #{escape_resource_arr.join(' ')} #{resource_target_dir}`
         
     | 
| 
       263 
272 
     | 
    
         
             
                    end
         
     | 
| 
       264 
273 
     | 
    
         
             
                  end
         
     | 
| 
       265 
274 
     | 
    
         | 
| 
         @@ -269,6 +278,17 @@ module CBin 
     | 
|
| 
       269 
278 
     | 
    
         
             
                    end
         
     | 
| 
       270 
279 
     | 
    
         
             
                  end
         
     | 
| 
       271 
280 
     | 
    
         | 
| 
      
 281 
     | 
    
         
            +
                  def expand_suffix(suffix)
         
     | 
| 
      
 282 
     | 
    
         
            +
                    case suffix
         
     | 
| 
      
 283 
     | 
    
         
            +
                    when '.storyboard'        then true
         
     | 
| 
      
 284 
     | 
    
         
            +
                    when '.xib'               then true
         
     | 
| 
      
 285 
     | 
    
         
            +
                    when '.xcdatamodel'       then true
         
     | 
| 
      
 286 
     | 
    
         
            +
                    when '.xcdatamodeld'      then true
         
     | 
| 
      
 287 
     | 
    
         
            +
                    when '.xcmappingmodel'    then true
         
     | 
| 
      
 288 
     | 
    
         
            +
                    else                      false
         
     | 
| 
      
 289 
     | 
    
         
            +
                    end
         
     | 
| 
      
 290 
     | 
    
         
            +
                  end
         
     | 
| 
      
 291 
     | 
    
         
            +
             
     | 
| 
       272 
292 
     | 
    
         
             
                  def framework
         
     | 
| 
       273 
293 
     | 
    
         
             
                    @framework ||= begin
         
     | 
| 
       274 
294 
     | 
    
         
             
                                     framework = Framework.new(@spec.name, @platform.name.to_s)
         
     | 
| 
         @@ -119,8 +119,6 @@ module CBin 
     | 
|
| 
       119 
119 
     | 
    
         | 
| 
       120 
120 
     | 
    
         
             
                    @spec.resources = binary_resources if @spec.attributes_hash.keys.include?("resources")
         
     | 
| 
       121 
121 
     | 
    
         | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
122 
     | 
    
         
             
                    @spec
         
     | 
| 
       125 
123 
     | 
    
         
             
                  end
         
     | 
| 
       126 
124 
     | 
    
         | 
| 
         @@ -133,7 +131,7 @@ module CBin 
     | 
|
| 
       133 
131 
     | 
    
         
             
                  end
         
     | 
| 
       134 
132 
     | 
    
         | 
| 
       135 
133 
     | 
    
         
             
                  def framework_contents(name)
         
     | 
| 
       136 
     | 
    
         
            -
                    ["#{code_spec.root.name}.framework" 
     | 
| 
      
 134 
     | 
    
         
            +
                    ["#{code_spec.root.name}.framework"].map { |path| "#{path}/#{name}" }
         
     | 
| 
       137 
135 
     | 
    
         
             
                  end
         
     | 
| 
       138 
136 
     | 
    
         | 
| 
       139 
137 
     | 
    
         
             
                  def binary_source_files
         
     | 
| 
         @@ -140,8 +140,15 @@ module CBin 
     | 
|
| 
       140 
140 
     | 
    
         
             
                    if code_spec_consumer.resources.any?
         
     | 
| 
       141 
141 
     | 
    
         
             
                      extnames += code_spec_consumer.resources.map { |r| File.basename(r) }
         
     | 
| 
       142 
142 
     | 
    
         
             
                    end
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                    extnames = extnames.select do | extname |
         
     | 
| 
      
 145 
     | 
    
         
            +
                      not expand_suffix(extname)
         
     | 
| 
      
 146 
     | 
    
         
            +
                    end
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
       143 
148 
     | 
    
         
             
                    if extnames.any?
         
     | 
| 
       144 
     | 
    
         
            -
                       
     | 
| 
      
 149 
     | 
    
         
            +
                      resources = framework_contents('Resources').flat_map { |r| extnames.map { |e| "#{r}/#{e}" } }
         
     | 
| 
      
 150 
     | 
    
         
            +
                      resources << "#{code_spec.root.name}.framework/*.{storyboardc,nib,mom,momd,cdm}"
         
     | 
| 
      
 151 
     | 
    
         
            +
                      @spec.resources = resources
         
     | 
| 
       145 
152 
     | 
    
         
             
                    end
         
     | 
| 
       146 
153 
     | 
    
         | 
| 
       147 
154 
     | 
    
         
             
                    # Source Location
         
     | 
| 
         @@ -182,6 +189,16 @@ module CBin 
     | 
|
| 
       182 
189 
     | 
    
         
             
                    @spec
         
     | 
| 
       183 
190 
     | 
    
         
             
                  end
         
     | 
| 
       184 
191 
     | 
    
         | 
| 
      
 192 
     | 
    
         
            +
                  def expand_suffix(suffix)
         
     | 
| 
      
 193 
     | 
    
         
            +
                    if suffix.end_with?('.storyboard') ||
         
     | 
| 
      
 194 
     | 
    
         
            +
                      suffix.end_with?('.xib') ||
         
     | 
| 
      
 195 
     | 
    
         
            +
                      suffix.end_with?('.xcdatamodel') ||
         
     | 
| 
      
 196 
     | 
    
         
            +
                      suffix.end_with?('.xcdatamodeld') ||
         
     | 
| 
      
 197 
     | 
    
         
            +
                      suffix.end_with?('.xcmappingmodel')
         
     | 
| 
      
 198 
     | 
    
         
            +
                      return true
         
     | 
| 
      
 199 
     | 
    
         
            +
                    end
         
     | 
| 
      
 200 
     | 
    
         
            +
                    false
         
     | 
| 
      
 201 
     | 
    
         
            +
                  end
         
     | 
| 
       185 
202 
     | 
    
         | 
| 
       186 
203 
     | 
    
         
             
                  def binary_source
         
     | 
| 
       187 
204 
     | 
    
         
             
                    { http: format(CBin.config.binary_download_url, code_spec.root.name, code_spec.version), type: CBin.config.download_file_type }
         
     | 
| 
         @@ -192,7 +209,6 @@ module CBin 
     | 
|
| 
       192 
209 
     | 
    
         
             
                  end
         
     | 
| 
       193 
210 
     | 
    
         | 
| 
       194 
211 
     | 
    
         
             
                  def framework_contents(name)
         
     | 
| 
       195 
     | 
    
         
            -
                    # ["#{code_spec.root.name}.framework", "#{code_spec.root.name}.framework/Versions/A"].map { |path| "#{path}/#{name}" }
         
     | 
| 
       196 
212 
     | 
    
         
             
                    ["#{code_spec.root.name}.framework"].map { |path| "#{path}/#{name}" }
         
     | 
| 
       197 
213 
     | 
    
         
             
                  end
         
     | 
| 
       198 
214 
     | 
    
         | 
| 
         @@ -11,8 +11,12 @@ require 'cocoapods-tdf-bin/command/bin/archive' 
     | 
|
| 
       11 
11 
     | 
    
         
             
            module Pod
         
     | 
| 
       12 
12 
     | 
    
         
             
              class Resolver
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
      
 14 
     | 
    
         
            +
                # 仅仅只是编译出产物,不上传
         
     | 
| 
       14 
15 
     | 
    
         
             
                @@build_dependencies_only_build = false
         
     | 
| 
       15 
16 
     | 
    
         | 
| 
      
 17 
     | 
    
         
            +
                # 是否是在进行二进制打包处理,没有的话一些步奏需要省略掉
         
     | 
| 
      
 18 
     | 
    
         
            +
                @@build_dependencies_bin = false
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
       16 
20 
     | 
    
         
             
                if Pod.match_version?('~> 1.6')
         
     | 
| 
       17 
21 
     | 
    
         
             
                  # 其实不用到 resolver_specs_by_target 再改 spec
         
     | 
| 
       18 
22 
     | 
    
         
             
                  # 在这个方法里面,通过修改 dependency 的 source 应该也可以
         
     | 
| 
         @@ -97,6 +101,11 @@ module Pod 
     | 
|
| 
       97 
101 
     | 
    
         
             
                  def Resolver.build_dependencies_only_build(only_build)
         
     | 
| 
       98 
102 
     | 
    
         
             
                    @@build_dependencies_only_build = only_build
         
     | 
| 
       99 
103 
     | 
    
         
             
                  end
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                  def Resolver.build_dependencies_bin(bin)
         
     | 
| 
      
 106 
     | 
    
         
            +
                    @@build_dependencies_bin = bin
         
     | 
| 
      
 107 
     | 
    
         
            +
                  end
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
       100 
109 
     | 
    
         
             
                end
         
     | 
| 
       101 
110 
     | 
    
         | 
| 
       102 
111 
     | 
    
         
             
                  # >= 1.4.0 才有 resolver_specs_by_target 以及 ResolverSpecification
         
     | 
| 
         @@ -138,8 +147,11 @@ module Pod 
     | 
|
| 
       138 
147 
     | 
    
         
             
                        source = use_binary ? sources_manager.binary_source : sources_manager.code_source
         
     | 
| 
       139 
148 
     | 
    
         | 
| 
       140 
149 
     | 
    
         
             
                        spec_version = rspec.spec.version
         
     | 
| 
       141 
     | 
    
         
            -
             
     | 
| 
       142 
     | 
    
         
            -
                         
     | 
| 
      
 150 
     | 
    
         
            +
             
     | 
| 
      
 151 
     | 
    
         
            +
                        if use_binary
         
     | 
| 
      
 152 
     | 
    
         
            +
                          UI.message 'cocoapods-tdf-bin 插件'
         
     | 
| 
      
 153 
     | 
    
         
            +
                          UI.message "- 开始处理 #{rspec.spec.name} #{spec_version} 组件."
         
     | 
| 
      
 154 
     | 
    
         
            +
                        end
         
     | 
| 
       143 
155 
     | 
    
         | 
| 
       144 
156 
     | 
    
         
             
                        if @@build_dependencies_only_build
         
     | 
| 
       145 
157 
     | 
    
         
             
                          missing_binary_specs << rspec.spec
         
     | 
| 
         @@ -163,14 +175,13 @@ module Pod 
     | 
|
| 
       163 
175 
     | 
    
         
             
                                           end
         
     | 
| 
       164 
176 
     | 
    
         
             
                            # used_by_only = rspec.respond_to?(:used_by_tests_only) ? rspec.used_by_tests_only : rspec.used_by_non_library_targets_only
         
     | 
| 
       165 
177 
     | 
    
         
             
                            # 组装新的 rspec ,替换原 rspec
         
     | 
| 
       166 
     | 
    
         
            -
                            if  
     | 
| 
      
 178 
     | 
    
         
            +
                            if rspec.source != false
         
     | 
| 
       167 
179 
     | 
    
         
             
                              rspec = if Pod.match_version?('~> 1.4.0')
         
     | 
| 
       168 
180 
     | 
    
         
             
                                        ResolverSpecification.new(specification, used_by_only)
         
     | 
| 
       169 
181 
     | 
    
         
             
                                      else
         
     | 
| 
       170 
182 
     | 
    
         
             
                                        ResolverSpecification.new(specification, used_by_only, source)
         
     | 
| 
       171 
183 
     | 
    
         
             
                                      end
         
     | 
| 
       172 
184 
     | 
    
         
             
                              UI.message "组装新的 rspec ,替换原 rspec #{rspec.root.name} #{spec_version} \r\n specification =#{specification} \r\n #{rspec} "
         
     | 
| 
       173 
     | 
    
         
            -
             
     | 
| 
       174 
185 
     | 
    
         
             
                            end
         
     | 
| 
       175 
186 
     | 
    
         | 
| 
       176 
187 
     | 
    
         
             
                          rescue Pod::StandardError => e
         
     | 
| 
         @@ -186,6 +197,10 @@ module Pod 
     | 
|
| 
       186 
197 
     | 
    
         
             
                      end.compact
         
     | 
| 
       187 
198 
     | 
    
         
             
                    end
         
     | 
| 
       188 
199 
     | 
    
         | 
| 
      
 200 
     | 
    
         
            +
                    unless @@build_dependencies_bin
         
     | 
| 
      
 201 
     | 
    
         
            +
                      return specs_by_target
         
     | 
| 
      
 202 
     | 
    
         
            +
                    end
         
     | 
| 
      
 203 
     | 
    
         
            +
             
     | 
| 
       189 
204 
     | 
    
         
             
                    if missing_binary_specs.any?
         
     | 
| 
       190 
205 
     | 
    
         
             
                      missing_binary_specs.uniq.each do |spec|
         
     | 
| 
       191 
206 
     | 
    
         
             
                        UI.message "【#{spec.name} | #{spec.version}】组件无对应二进制版本 , 将采用源码依赖."
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: cocoapods-tdf-bin
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.16
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - gaijiaofan
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-07-19 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: parallel
         
     |