cocoapods-alexandria 0.1.3 → 0.2.1
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-alexandria/env_local/pre_install.rb +27 -4
 - data/lib/cocoapods-alexandria/gem_version.rb +1 -1
 - data/lib/cocoapods-alexandria/helper/user_options.rb +6 -0
 - data/lib/cocoapods-alexandria/rome/framework_cache.rb +4 -4
 - data/lib/cocoapods-alexandria/xcodegen/dependencies_generator.rb +9 -4
 - data/lib/cocoapods-alexandria/xcodegen/dependency.rb +2 -2
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 27616506322af399e0045f19891817ae5ec87f1023fc1c66121b617e6b62fc2c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 900b0c88287e32f8c96db19fca25ab6c3eccc7ed314c29a996b9cc3734bb3670
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e005c66afc5ea2a076dbeb60cbbc9582713b2fd133abbd539fb993c385ffe0b27f28dea850d28e957311ab710293c248cc5f8218bc49113795719be99ed1ad6e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 648ba30e5d6834466f13a8370eb90dd0fd4125f7d93121c6e785e15d9af869509a8904825fea66fbb892d2bef378f3bfb184ac2efe913d10d268e1ad36bbe6ed
         
     | 
| 
         @@ -8,17 +8,40 @@ module PodAlexandria 
     | 
|
| 
       8 
8 
     | 
    
         
             
                end
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                def run
         
     | 
| 
       11 
     | 
    
         
            -
                  Pod::UI.puts  
     | 
| 
      
 11 
     | 
    
         
            +
                  Pod::UI.puts 'Cocoapods Alexandria running in local mode.'
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                   
     | 
| 
      
 13 
     | 
    
         
            +
                  if should_predownload_dep
         
     | 
| 
      
 14 
     | 
    
         
            +
                    Pod::UI.title 'Pre-downloading dependency for XcodeGen'
         
     | 
| 
      
 15 
     | 
    
         
            +
                    predownload_dep
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                  Pod::UI.title 'Generating project using XcodeGen'
         
     | 
| 
       14 
19 
     | 
    
         
             
                  XcodeGen::cleanupRome
         
     | 
| 
       15 
20 
     | 
    
         
             
                  XcodeGen::clearDependencies(options.xcodegen_dependencies_file)
         
     | 
| 
       16 
21 
     | 
    
         
             
                  XcodeGen::generate
         
     | 
| 
       17 
22 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                  Pod::UI.title  
     | 
| 
      
 23 
     | 
    
         
            +
                  Pod::UI.title 'Preparing environment...'
         
     | 
| 
       19 
24 
     | 
    
         
             
                  podfile.prepare_for_xcodegen
         
     | 
| 
       20 
25 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                  Pod::UI.title  
     | 
| 
      
 26 
     | 
    
         
            +
                  Pod::UI.title 'Continuing with normal CocoaPods'
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                private
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                def should_predownload_dep
         
     | 
| 
      
 32 
     | 
    
         
            +
                  File.readlines('project.yml').grep(/Pods\/AppwiseCore\/XcodeGen/).any? &&
         
     | 
| 
      
 33 
     | 
    
         
            +
                    !File.directory?('Pods/AppwiseCore/XcodeGen')
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                def predownload_dep
         
     | 
| 
      
 37 
     | 
    
         
            +
                  system(
         
     | 
| 
      
 38 
     | 
    
         
            +
                    'rm -rf Pods/AppwiseCore && '\
         
     | 
| 
      
 39 
     | 
    
         
            +
                    'mkdir -p Pods && '\
         
     | 
| 
      
 40 
     | 
    
         
            +
                    'rm -f /tmp/ac.zip && '\
         
     | 
| 
      
 41 
     | 
    
         
            +
                    'curl -L "https://github.com/appwise-labs/AppwiseCore/archive/master.zip" > /tmp/ac.zip && '\
         
     | 
| 
      
 42 
     | 
    
         
            +
                    'unzip -q -d Pods /tmp/ac.zip && '\
         
     | 
| 
      
 43 
     | 
    
         
            +
                    'mv Pods/AppwiseCore-master Pods/AppwiseCore'
         
     | 
| 
      
 44 
     | 
    
         
            +
                  )
         
     | 
| 
       22 
45 
     | 
    
         
             
                end
         
     | 
| 
       23 
46 
     | 
    
         
             
              end
         
     | 
| 
       24 
47 
     | 
    
         
             
            end
         
     | 
| 
         @@ -3,17 +3,23 @@ module PodAlexandria 
     | 
|
| 
       3 
3 
     | 
    
         
             
                attr_reader :environment_configs
         
     | 
| 
       4 
4 
     | 
    
         
             
                attr_reader :force_bitcode
         
     | 
| 
       5 
5 
     | 
    
         
             
                attr_reader :xcodegen_dependencies_file
         
     | 
| 
      
 6 
     | 
    
         
            +
                attr_reader :do_not_embed_dependencies_in_targets
         
     | 
| 
       6 
7 
     | 
    
         | 
| 
       7 
8 
     | 
    
         
             
                def initialize(installer_context, user_options)
         
     | 
| 
       8 
9 
     | 
    
         
             
                  @environment_configs = user_options.fetch('environment_configs', default_configurations(installer_context))
         
     | 
| 
       9 
10 
     | 
    
         
             
                  @force_bitcode = user_options.fetch('force_bitcode', true)
         
     | 
| 
       10 
11 
     | 
    
         
             
                  @xcodegen_dependencies_file = user_options.fetch('xcodegen_dependencies_file', 'projectDependencies.yml')
         
     | 
| 
      
 12 
     | 
    
         
            +
                  @do_not_embed_dependencies_in_targets = user_options.fetch('do_not_embed_dependencies_in_targets', [])
         
     | 
| 
       11 
13 
     | 
    
         
             
                end
         
     | 
| 
       12 
14 
     | 
    
         | 
| 
       13 
15 
     | 
    
         
             
                def environment_configs_for(target)
         
     | 
| 
       14 
16 
     | 
    
         
             
                  environment_configs[normalize_target(target)]
         
     | 
| 
       15 
17 
     | 
    
         
             
                end
         
     | 
| 
       16 
18 
     | 
    
         | 
| 
      
 19 
     | 
    
         
            +
                def allow_embed_dependencies_for(target)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  !do_not_embed_dependencies_in_targets.include?(normalize_target(target))
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
       17 
23 
     | 
    
         
             
                private
         
     | 
| 
       18 
24 
     | 
    
         | 
| 
       19 
25 
     | 
    
         
             
                def default_configurations(installer_context)
         
     | 
| 
         @@ -90,12 +90,12 @@ module PodAlexandria 
     | 
|
| 
       90 
90 
     | 
    
         | 
| 
       91 
91 
     | 
    
         
             
                def delete(spec)
         
     | 
| 
       92 
92 
     | 
    
         
             
                  name = spec_modules[spec] || module_name(spec)
         
     | 
| 
       93 
     | 
    
         
            -
                   
     | 
| 
      
 93 
     | 
    
         
            +
                  paths = Dir["#{destination}/#{name}.{framework,xcframework}"]
         
     | 
| 
       94 
94 
     | 
    
         | 
| 
       95 
     | 
    
         
            -
                  if  
     | 
| 
       96 
     | 
    
         
            -
                    FileUtils.remove_dir(path, true)
         
     | 
| 
      
 95 
     | 
    
         
            +
                  if !paths.empty?
         
     | 
| 
      
 96 
     | 
    
         
            +
                    paths.each { |path| FileUtils.remove_dir(path, true) }
         
     | 
| 
       97 
97 
     | 
    
         
             
                  else
         
     | 
| 
       98 
     | 
    
         
            -
                    Pod::UI.warn "🤔  Could not delete #{ 
     | 
| 
      
 98 
     | 
    
         
            +
                    Pod::UI.warn "🤔  Could not delete #{destination}/#{name}.(xc)framework, it does not exist! (this is normal for newly added pods)"
         
     | 
| 
       99 
99 
     | 
    
         
             
                  end
         
     | 
| 
       100 
100 
     | 
    
         
             
                end
         
     | 
| 
       101 
101 
     | 
    
         | 
| 
         @@ -6,7 +6,12 @@ module PodAlexandria 
     | 
|
| 
       6 
6 
     | 
    
         
             
                # and also checking if they are linked dynamically or not.
         
     | 
| 
       7 
7 
     | 
    
         
             
                def self.generate_dependencies(installer_context, options)
         
     | 
| 
       8 
8 
     | 
    
         
             
                  targets = installer_context.umbrella_targets.map { |target|
         
     | 
| 
       9 
     | 
    
         
            -
                    generate_for_target( 
     | 
| 
      
 9 
     | 
    
         
            +
                    generate_for_target(
         
     | 
| 
      
 10 
     | 
    
         
            +
                      installer_context,
         
     | 
| 
      
 11 
     | 
    
         
            +
                      target,
         
     | 
| 
      
 12 
     | 
    
         
            +
                      options.environment_configs_for(target.cocoapods_target_label),
         
     | 
| 
      
 13 
     | 
    
         
            +
                      options.allow_embed_dependencies_for(target.cocoapods_target_label)
         
     | 
| 
      
 14 
     | 
    
         
            +
                    )
         
     | 
| 
       10 
15 
     | 
    
         
             
                  }.to_h
         
     | 
| 
       11 
16 
     | 
    
         | 
| 
       12 
17 
     | 
    
         
             
                  File.open(options.xcodegen_dependencies_file, 'w') { |file|
         
     | 
| 
         @@ -16,7 +21,7 @@ module PodAlexandria 
     | 
|
| 
       16 
21 
     | 
    
         | 
| 
       17 
22 
     | 
    
         
             
                private
         
     | 
| 
       18 
23 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
                def self.generate_for_target(installer_context, target, configurations)
         
     | 
| 
      
 24 
     | 
    
         
            +
                def self.generate_for_target(installer_context, target, configurations, allow_embed)
         
     | 
| 
       20 
25 
     | 
    
         
             
                  target_name = target.cocoapods_target_label.sub(/^Pods-/, '')
         
     | 
| 
       21 
26 
     | 
    
         
             
                  xcconfig = config_file_for_target(installer_context, target)
         
     | 
| 
       22 
27 
     | 
    
         | 
| 
         @@ -24,13 +29,13 @@ module PodAlexandria 
     | 
|
| 
       24 
29 
     | 
    
         
             
                    target_name,
         
     | 
| 
       25 
30 
     | 
    
         
             
                    {
         
     | 
| 
       26 
31 
     | 
    
         
             
                      'configFiles' => configurations,
         
     | 
| 
       27 
     | 
    
         
            -
                      'dependencies' => get_dependencies_from_xcconfig(xcconfig).map( 
     | 
| 
      
 32 
     | 
    
         
            +
                      'dependencies' => get_dependencies_from_xcconfig(xcconfig).map { |d| d.xcodegen_info(allow_embed) }
         
     | 
| 
       28 
33 
     | 
    
         
             
                    }
         
     | 
| 
       29 
34 
     | 
    
         
             
                  ]
         
     | 
| 
       30 
35 
     | 
    
         
             
                end
         
     | 
| 
       31 
36 
     | 
    
         | 
| 
       32 
37 
     | 
    
         
             
                def self.config_file_for_target(installer_context, target)
         
     | 
| 
       33 
     | 
    
         
            -
                  Dir["#{installer_context.sandbox_root}/Target Support Files/#{target.cocoapods_target_label}/#{target.cocoapods_target_label} 
     | 
| 
      
 38 
     | 
    
         
            +
                  Dir["#{installer_context.sandbox_root}/Target Support Files/#{target.cocoapods_target_label}/#{target.cocoapods_target_label}.*-release.xcconfig"]
         
     | 
| 
       34 
39 
     | 
    
         
             
                    .first
         
     | 
| 
       35 
40 
     | 
    
         
             
                end
         
     | 
| 
       36 
41 
     | 
    
         | 
| 
         @@ -8,11 +8,11 @@ module PodAlexandria 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  @module_name = value.delete_prefix('-l').delete_prefix('-f').delete_prefix('-wf')
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                def xcodegen_info
         
     | 
| 
      
 11 
     | 
    
         
            +
                def xcodegen_info(allow_embed)
         
     | 
| 
       12 
12 
     | 
    
         
             
                  if exists?
         
     | 
| 
       13 
13 
     | 
    
         
             
                    {
         
     | 
| 
       14 
14 
     | 
    
         
             
                      'framework' => path,
         
     | 
| 
       15 
     | 
    
         
            -
                      'embed' => is_dynamic 
     | 
| 
      
 15 
     | 
    
         
            +
                      'embed' => is_dynamic? && allow_embed,
         
     | 
| 
       16 
16 
     | 
    
         
             
                      'weak' => is_weak?
         
     | 
| 
       17 
17 
     | 
    
         
             
                    }
         
     | 
| 
       18 
18 
     | 
    
         
             
                  else
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: cocoapods-alexandria
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - David Jennes
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-05-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: cocoapods
         
     | 
| 
         @@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       97 
97 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       98 
98 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       99 
99 
     | 
    
         
             
            requirements: []
         
     | 
| 
       100 
     | 
    
         
            -
            rubygems_version: 3.0.3
         
     | 
| 
      
 100 
     | 
    
         
            +
            rubygems_version: 3.0.3.1
         
     | 
| 
       101 
101 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       102 
102 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       103 
103 
     | 
    
         
             
            summary: Alexandria allows for easier integration with XcodeGen, and automatically
         
     |