cocoapods 0.39.0.beta.1 → 0.39.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/cocoapods/gem_version.rb +1 -1
  4. metadata +35 -63
  5. data/lib/cocoapods/command/cache/clean.rb +0 -90
  6. data/lib/cocoapods/command/cache/list.rb +0 -69
  7. data/lib/cocoapods/command/repo/add.rb +0 -53
  8. data/lib/cocoapods/command/repo/lint.rb +0 -77
  9. data/lib/cocoapods/command/repo/list.rb +0 -93
  10. data/lib/cocoapods/command/repo/push.rb +0 -223
  11. data/lib/cocoapods/command/repo/remove.rb +0 -36
  12. data/lib/cocoapods/command/repo/update.rb +0 -27
  13. data/lib/cocoapods/command/spec/cat.rb +0 -51
  14. data/lib/cocoapods/command/spec/create.rb +0 -279
  15. data/lib/cocoapods/command/spec/edit.rb +0 -94
  16. data/lib/cocoapods/command/spec/lint.rb +0 -119
  17. data/lib/cocoapods/command/spec/which.rb +0 -43
  18. data/lib/cocoapods/generator/acknowledgements/markdown.rb +0 -38
  19. data/lib/cocoapods/generator/acknowledgements/plist.rb +0 -80
  20. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +0 -260
  21. data/lib/cocoapods/generator/xcconfig/pod_xcconfig.rb +0 -83
  22. data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +0 -213
  23. data/lib/cocoapods/installer/analyzer/analysis_result.rb +0 -46
  24. data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +0 -79
  25. data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +0 -262
  26. data/lib/cocoapods/installer/analyzer/specs_state.rb +0 -76
  27. data/lib/cocoapods/installer/analyzer/target_inspection_result.rb +0 -41
  28. data/lib/cocoapods/installer/analyzer/target_inspector.rb +0 -203
  29. data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +0 -186
  30. data/lib/cocoapods/installer/target_installer/pod_target_installer.rb +0 -297
  31. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +0 -318
  32. data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +0 -173
@@ -1,173 +0,0 @@
1
- module Pod
2
- class Installer
3
- class UserProjectIntegrator
4
- class TargetIntegrator
5
- # Configures an user target to use the CocoaPods xcconfigs which allow
6
- # lo link against the Pods.
7
- #
8
- class XCConfigIntegrator
9
- # Integrates the user target.
10
- #
11
- # @param [Target::AggregateTarget] pod_bundle
12
- # The Pods bundle.
13
- #
14
- # @param [Array<PBXNativeTarget>] targets
15
- # The native targets associated which should be integrated
16
- # with the Pod bundle.
17
- #
18
- # @return [Bool] whether any changes to the project were made.
19
- #
20
- def self.integrate(pod_bundle, targets)
21
- changes = false
22
- targets.each do |target|
23
- target.build_configurations.each do |config|
24
- changes = true if update_to_cocoapods_0_34(pod_bundle, targets)
25
- changes = true if set_target_xcconfig(pod_bundle, target, config)
26
- end
27
- end
28
- changes
29
- end
30
-
31
- private
32
-
33
- # @!group Integration steps
34
- #-------------------------------------------------------------------#
35
-
36
- # Removes the xcconfig used up to CocoaPods 0.33 from the project and
37
- # deletes the file if it exists.
38
- #
39
- # @param [Target::AggregateTarget] pod_bundle
40
- # The Pods bundle.
41
- #
42
- # @param [Array<XcodeProj::PBXNativeTarget>] targets
43
- # The native targets.
44
- #
45
- # @return [Bool] whether any changes to the project were made.
46
- #
47
- # @todo This can be removed for CocoaPods 1.0
48
- #
49
- def self.update_to_cocoapods_0_34(pod_bundle, targets)
50
- sandbox = pod_bundle.sandbox
51
- changes = false
52
- targets.map(&:project).uniq.each do |project|
53
- file_refs = project.files.select do |file_ref|
54
- path = file_ref.path.to_s
55
- if File.extname(path) == '.xcconfig'
56
- absolute_path = file_ref.real_path.to_s
57
- absolute_path.start_with?(sandbox.root.to_s) &&
58
- !absolute_path.start_with?(sandbox.target_support_files_root.to_s)
59
- end
60
- end
61
-
62
- file_refs.uniq.each do |file_ref|
63
- UI.message "- Removing (#{file_ref.path})" do
64
- file_ref.remove_from_project
65
- end
66
- end
67
-
68
- changes = true unless file_refs.empty?
69
- end
70
- changes
71
- end
72
-
73
- # Creates a file reference to the xcconfig generated by
74
- # CocoaPods (if needed) and sets it as the base configuration of
75
- # build configuration of the user target.
76
- #
77
- # @param [Target::AggregateTarget] pod_bundle
78
- # The Pods bundle.
79
- #
80
- # @param [PBXNativeTarget] target
81
- # The native target.
82
- #
83
- # @param [Xcodeproj::XCBuildConfiguration] config
84
- # The build configuration.
85
- #
86
- # @return [Boolean] Indicates whether or not any changes were made.
87
- #
88
- def self.set_target_xcconfig(pod_bundle, target, config)
89
- path = pod_bundle.xcconfig_relative_path(config.name)
90
- group = config.project['Pods'] || config.project.new_group('Pods')
91
- file_ref = group.files.find { |f| f.path == path }
92
- if config.base_configuration_reference &&
93
- config.base_configuration_reference != file_ref
94
- unless xcconfig_includes_target_xcconfig?(config.base_configuration_reference, path)
95
- UI.warn 'CocoaPods did not set the base configuration of your ' \
96
- 'project because your project already has a custom ' \
97
- 'config set. In order for CocoaPods integration to work at ' \
98
- 'all, please either set the base configurations of the target ' \
99
- "`#{target.name}` to `#{path}` or include the `#{path}` in your " \
100
- 'build configuration.'
101
- end
102
- elsif config.base_configuration_reference.nil? || file_ref.nil?
103
- file_ref ||= group.new_file(path)
104
- config.base_configuration_reference = file_ref
105
- return true
106
- end
107
- false
108
- end
109
-
110
- private
111
-
112
- # @!group Private helpers
113
- #-------------------------------------------------------------------#
114
-
115
- # Prints a warning informing the user that a build configuration of
116
- # the integrated target is overriding the CocoaPods build settings.
117
- #
118
- # @param [Target::AggregateTarget] pod_bundle
119
- # The Pods bundle.
120
- #
121
- # @param [XcodeProj::PBXNativeTarget] target
122
- # The native target.
123
- #
124
- # @param [Xcodeproj::XCBuildConfiguration] config
125
- # The build configuration.
126
- #
127
- # @param [String] key
128
- # The key of the overridden build setting.
129
- #
130
- def self.print_override_warning(pod_bundle, target, config, key)
131
- actions = [
132
- 'Use the `$(inherited)` flag, or',
133
- 'Remove the build settings from the target.',
134
- ]
135
- message = "The `#{target.name} [#{config.name}]` " \
136
- "target overrides the `#{key}` build setting defined in " \
137
- "`#{pod_bundle.xcconfig_relative_path(config.name)}'. " \
138
- 'This can lead to problems with the CocoaPods installation'
139
- UI.warn(message, actions)
140
- end
141
-
142
- # Naively checks to see if a given PBXFileReference imports a given
143
- # path.
144
- #
145
- # @param [PBXFileReference] base_config_ref
146
- # A file reference to an `.xcconfig` file.
147
- #
148
- # @param [String] target_config_path
149
- # The path to check for.
150
- #
151
- SILENCE_WARNINGS_STRING = '// @COCOAPODS_SILENCE_WARNINGS@ //'
152
- def self.xcconfig_includes_target_xcconfig?(base_config_ref, target_config_path)
153
- return unless base_config_ref && base_config_ref.real_path.file?
154
- regex = /
155
- ^(
156
- (\s* # Possible, but unlikely, space before include statement
157
- \#include\s+ # Include statement
158
- ['"] # Open quote
159
- (.*\/)? # Possible prefix to path
160
- #{Regexp.quote(target_config_path)} # The path should end in the target_config_path
161
- ['"] # Close quote
162
- )
163
- |
164
- (#{Regexp.quote(SILENCE_WARNINGS_STRING)}) # Token to treat xcconfig as good and silence pod install warnings
165
- )
166
- /x
167
- base_config_ref.real_path.readlines.find { |line| line =~ regex }
168
- end
169
- end
170
- end
171
- end
172
- end
173
- end