cocoapods-deintegrate 1.0.1 → 1.0.5

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
- SHA1:
3
- metadata.gz: 4e5f3c887dc27f68850da1cc1033196dddcef2f7
4
- data.tar.gz: f59a5c8a1f79702aa10852ab5588c85051b5485f
2
+ SHA256:
3
+ metadata.gz: 930de52d74b76bea712792f3a840dc412415f5d44b77d6144399976c89b3bf5b
4
+ data.tar.gz: 682b46780e5a42d244986f5921a305b6f0211c6ef1b7cfeb39429c2ae6633404
5
5
  SHA512:
6
- metadata.gz: 11cab2ab5eb4c1e7546d13ae5991e1344d06a65ecfed06f170a29ca51562bd8dc9742839333326a3dd117339ba207a2943a6fd8770c8e6395e0caa1a47c94e2e
7
- data.tar.gz: 66eae301893f51564380bd1aff11edce413c5dfa0fdf8b2a4ff92be3e707b81eaaec8a74927bd7bd5d7b99fc5cfb3614e4d8eb5e7b1fbe3c4dbdcb27d277ba8f
6
+ metadata.gz: f3a0bf2046522590f818ec4de0966eb9e0328b3b6685c6d42d67e956fc86846f9a00d270d2f729ef11b5422742718a322bdfac383752da4d4f3e0820ce5e4706
7
+ data.tar.gz: 842a10f95c0ebbd4dfdbd856ee4fba3a5ba45f718dfcfc0f5e634ddcbc159566f903586382613605e5a131203bb343e9baf519d112e6404f6c8e8607505b93d4
@@ -1,3 +1,3 @@
1
1
  module CocoapodsDeintegrate
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.5'.freeze
3
3
  end
@@ -2,6 +2,9 @@ module Pod
2
2
  class Deintegrator
3
3
  include Config::Mixin
4
4
 
5
+ FRAMEWORK_NAMES = /^(libPods.*\.a)|(Pods.*\.framework)$/i
6
+ XCCONFIG_NAMES = /^Pods.*\.xcconfig$/i
7
+
5
8
  def deintegrate_project(project)
6
9
  UI.section("Deintegrating #{UI.path project.path}") do
7
10
  project.native_targets.each do |target|
@@ -22,6 +25,7 @@ module Pod
22
25
  deintegrate_shell_script_phase(target, 'Copy Pods Resources')
23
26
  deintegrate_shell_script_phase(target, 'Check Pods Manifest.lock')
24
27
  deintegrate_shell_script_phase(target, 'Embed Pods Frameworks')
28
+ deintegrate_user_shell_script_phases(target)
25
29
  deintegrate_pods_libraries(target)
26
30
  deintegrate_configuration_file_references(target)
27
31
  end
@@ -36,22 +40,44 @@ module Pod
36
40
  end
37
41
 
38
42
  def deintegrate_pods_libraries(target)
39
- frameworks_build_phase = target.frameworks_build_phase
43
+ # `frameworks_build_phases` returns but does not automatically create this build phase
44
+ # when we are deinitegrating. Its a bit of a weird API but thats what Xcodeproj gives
45
+ # us.
46
+ frameworks_build_phase = target.frameworks_build_phases
47
+ return if frameworks_build_phase.nil?
40
48
 
41
49
  pods_build_files = frameworks_build_phase.files.select do |build_file|
42
- build_file.display_name =~ /^(libPods.*\.a)|(Pods.*\.framework)$/i
50
+ build_file.display_name =~ FRAMEWORK_NAMES
43
51
  end
44
52
 
45
53
  unless pods_build_files.empty?
46
54
  UI.section('Removing Pod libraries from build phase:') do
47
55
  pods_build_files.each do |build_file|
48
56
  UI.puts("- #{build_file.display_name}")
57
+ if build_file.file_ref.build_files.count == 1
58
+ build_file.file_ref.remove_from_project
59
+ end
49
60
  frameworks_build_phase.remove_build_file(build_file)
50
61
  end
51
62
  end
52
63
  end
53
64
  end
54
65
 
66
+ def deintegrate_user_shell_script_phases(target)
67
+ user_script_phases = target.shell_script_build_phases.select do |phase|
68
+ next unless phase.name
69
+ phase.name.start_with?('[CP-User] ')
70
+ end
71
+
72
+ unless user_script_phases.empty?
73
+ user_script_phases.each do |phase|
74
+ target.build_phases.delete(phase)
75
+ end
76
+
77
+ UI.puts("Deleted #{user_script_phases.count} user build phases.")
78
+ end
79
+ end
80
+
55
81
  def deintegrate_shell_script_phase(target, phase_name)
56
82
  phases = target.shell_script_build_phases.select do |phase|
57
83
  phase.name && phase.name =~ /#{Regexp.escape(phase_name)}\z$/
@@ -80,7 +106,7 @@ module Pod
80
106
  def deintegrate_configuration_file_references(target)
81
107
  config_files = target.build_configurations.map do |config|
82
108
  config_file = config.base_configuration_reference
83
- config_file if config_file && config_file.name =~ /^Pods.*\.xcconfig$/i
109
+ config_file if config_file && config_file.name =~ XCCONFIG_NAMES
84
110
  end.compact
85
111
  unless config_files.empty?
86
112
  UI.section('Deleting configuration file references') do
@@ -101,7 +127,7 @@ module Pod
101
127
 
102
128
  pod_files = groups.flat_map do |group|
103
129
  group.files.select do |obj|
104
- obj.name =~ /^Pods.*\.xcconfig$/i ||
130
+ obj.name =~ XCCONFIG_NAMES ||
105
131
  obj.path =~ /^(libPods.*\.a)|(Pods_.*\.framework)$/i
106
132
  end
107
133
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-deintegrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Fuller
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-30 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - kyle@fuller.li
16
16
  executables: []
@@ -28,7 +28,7 @@ homepage: https://github.com/kylef/cocoapods-deintegrate
28
28
  licenses:
29
29
  - MIT
30
30
  metadata: {}
31
- post_install_message:
31
+ post_install_message:
32
32
  rdoc_options: []
33
33
  require_paths:
34
34
  - lib
@@ -43,9 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubyforge_project:
47
- rubygems_version: 2.4.5.1
48
- signing_key:
46
+ rubygems_version: 3.1.3
47
+ signing_key:
49
48
  specification_version: 4
50
49
  summary: A CocoaPods plugin to remove and de-integrate CocoaPods from your project.
51
50
  test_files: []