cocoapods-alexandria 0.1.3 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78e151c7ffabfa1fbd96664cb624d48be0f71951cfaed1f9fec9e100cc89cf1d
4
- data.tar.gz: 8d587ba944d86a928421700b9a46f4aabebd1282ea44db6fc8bdc41628dd59df
3
+ metadata.gz: 27616506322af399e0045f19891817ae5ec87f1023fc1c66121b617e6b62fc2c
4
+ data.tar.gz: 900b0c88287e32f8c96db19fca25ab6c3eccc7ed314c29a996b9cc3734bb3670
5
5
  SHA512:
6
- metadata.gz: c6dc83e067aabe9c0e890f1ad579e7abcd546c234fe2dbd692e9614a238f38809181ea47d892f65e567f6cbdaf50b2eba9e93feb61749d7ad02bb83d29c3af76
7
- data.tar.gz: e035c88b38adbb67c12c42b753cdf7de4670842d342f26c7eb87e405a085ff54e8c849b35b65f469aac347fb02003610cec93f3234d28fff9a8990544e72e559
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 "Cocoapods Alexandria running in local mode."
11
+ Pod::UI.puts 'Cocoapods Alexandria running in local mode.'
12
12
 
13
- Pod::UI.title "Generating project using XcodeGen"
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 "Preparing environment..."
23
+ Pod::UI.title 'Preparing environment...'
19
24
  podfile.prepare_for_xcodegen
20
25
 
21
- Pod::UI.title "Continuing with normal CocoaPods"
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
@@ -1,3 +1,3 @@
1
1
  module CocoapodsAlexandria
2
- VERSION = '0.1.3'
2
+ VERSION = '0.2.1'
3
3
  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
- path = "#{destination}/#{name}.framework"
93
+ paths = Dir["#{destination}/#{name}.{framework,xcframework}"]
94
94
 
95
- if File.directory?(path)
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 #{path}, it does not exist! (this is normal for newly added pods)"
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(installer_context, target, options.environment_configs_for(target.cocoapods_target_label))
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(&:xcodegen_info)
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}.*.xcconfig"]
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.3
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: 2021-02-17 00:00:00.000000000 Z
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