cocoapods 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 089fd601f4b77b13ce571371163234e74681fc6a
4
- data.tar.gz: 2ba921d00ae8b35bad6446d8d86bc4437766dcec
3
+ metadata.gz: eeda2d6ab232bd8f105714f6a51b3986ca80b775
4
+ data.tar.gz: 5fbdf86b804049c847b316843922500fd3d187d7
5
5
  SHA512:
6
- metadata.gz: dc073ce49be6c7c75b2e80f4eb888bb68d623f9041721129877a1a074eafa231e984f3ff93b25756784cf43e0bb741a1e7405ceb7d177799f14b920d1c64afcc
7
- data.tar.gz: b21370ae05fa41e645bcf4d7ce27ee6e2b13507098ce5b4540f54cdd2b042ff26981cea047169379d911eac0835a72575842195ff5acfd0c7699142fdbf235ff
6
+ metadata.gz: 871f362cd52240407bf82ae6d82c120fb44e4d00c2cf5d0c6ce1f71c05eea7efccbfa046224600b8a268357992bab0603e6d66b13544ef573427e49ef8fc3d69
7
+ data.tar.gz: 74971c13eded91890a16897f00dfab17a1d9d3248ba7e2a1b19fbb924ced964f76f711ff607cb065790b552d906c8d6ab6d476c05fb1fc302d465e51500f4e42
data/CHANGELOG.md CHANGED
@@ -4,6 +4,50 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
4
4
 
5
5
  To install release candidates run `[sudo] gem install cocoapods --pre`
6
6
 
7
+ ## 1.0.1 (2016-06-02)
8
+
9
+ ##### Enhancements
10
+
11
+ * None.
12
+
13
+ ##### Bug Fixes
14
+
15
+ * Symlink the header folders in the framework bundle's root directory
16
+ by a new shell script build phase if `header_mappings_dir` is used
17
+ with frameworks.
18
+ [Marius Rackwitz](https://github.com/mrackwitz)
19
+ [#5313](https://github.com/CocoaPods/CocoaPods/issues/5313)
20
+
21
+ * Removed emojis in Build Phases names — as it seems that some third party tools have trouble with them.
22
+ [Olivier Halligon](https://github.com/AliSoftware)
23
+ [#5382](https://github.com/CocoaPods/CocoaPods/pull/5382)
24
+
25
+ * Ensure `Set` is defined before using it.
26
+ [Samuel Giddins](https://github.com/segiddins)
27
+ [#5287](https://github.com/CocoaPods/CocoaPods/issues/5287)
28
+
29
+ * Add --target-device to ibtool invocation for XIBs
30
+ [Juan Civile](https://github.com/champo)
31
+ [#5282](https://github.com/CocoaPods/CocoaPods/issues/5282)
32
+
33
+ * Fix error when executables cannot be found.
34
+ [Jan Berkel](https://github.com/jberkel)
35
+ [#5319](https://github.com/CocoaPods/CocoaPods/pull/5319)
36
+
37
+ * Avoid removing all files when root directory contains unicode characters.
38
+ [Marc Boquet](https://github.com/marcboquet)
39
+ [#5294](https://github.com/CocoaPods/CocoaPods/issues/5294)
40
+
41
+ * Guarding from crash if pod lib create has a + character in the name.
42
+ [William Entriken](https://github.com/fulldecent)
43
+ [CocoaPods/pod-template#69](https://github.com/CocoaPods/pod-template/issues/69)
44
+
45
+ * Use target product types to determine whether a target is a test target when
46
+ running `pod init`.
47
+ [Samuel Giddins](https://github.com/segiddins)
48
+ [#5378](https://github.com/CocoaPods/CocoaPods/issues/5378)
49
+
50
+
7
51
  ## 1.0.0 (2016-05-10)
8
52
 
9
53
  ##### Enhancements
@@ -22,7 +22,7 @@ module Pod
22
22
  require 'cocoapods/command/env'
23
23
  require 'cocoapods/command/init'
24
24
  require 'cocoapods/command/install'
25
- require 'cocoapods/command/inter_process_communication'
25
+ require 'cocoapods/command/ipc'
26
26
  require 'cocoapods/command/lib'
27
27
  require 'cocoapods/command/list'
28
28
  require 'cocoapods/command/outdated'
@@ -63,7 +63,7 @@ module Pod
63
63
  # Split out the targets into app and test targets
64
64
  test_targets, app_targets = project.native_targets.
65
65
  sort_by { |t| t.name.downcase }.
66
- partition { |t| t.name =~ /test/i }
66
+ partition(&:test_target_type?)
67
67
 
68
68
  app_targets.each do |app_target|
69
69
  test_targets_for_app = test_targets.select do |target|
@@ -0,0 +1,18 @@
1
+ require 'cocoapods/command/ipc/list'
2
+ require 'cocoapods/command/ipc/podfile'
3
+ require 'cocoapods/command/ipc/repl'
4
+ require 'cocoapods/command/ipc/spec'
5
+ require 'cocoapods/command/ipc/update_search_index'
6
+
7
+ module Pod
8
+ class Command
9
+ class IPC < Command
10
+ self.abstract_command = true
11
+ self.summary = 'Inter-process communication'
12
+
13
+ def output_pipe
14
+ STDOUT
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,40 @@
1
+ module Pod
2
+ class Command
3
+ class IPC < Command
4
+ class List < IPC
5
+ self.summary = 'Lists the specifications known to CocoaPods'
6
+ self.description = <<-DESC
7
+ Prints to STDOUT a YAML dictionary where the keys are the name of the
8
+ specifications and each corresponding value is a dictionary with
9
+ the following keys:
10
+ - defined_in_file
11
+ - version
12
+ - authors
13
+ - summary
14
+ - description
15
+ - platforms
16
+ DESC
17
+
18
+ def run
19
+ require 'yaml'
20
+ sets = config.sources_manager.aggregate.all_sets
21
+ result = {}
22
+ sets.each do |set|
23
+ begin
24
+ spec = set.specification
25
+ result[spec.name] = {
26
+ 'authors' => spec.authors.keys,
27
+ 'summary' => spec.summary,
28
+ 'description' => spec.description,
29
+ 'platforms' => spec.available_platforms.map { |p| p.name.to_s },
30
+ }
31
+ rescue DSLError
32
+ next
33
+ end
34
+ end
35
+ output_pipe.puts result.to_yaml
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,31 @@
1
+ module Pod
2
+ class Command
3
+ class IPC < Command
4
+ class Podfile < IPC
5
+ include ProjectDirectory
6
+
7
+ self.summary = 'Converts a Podfile to YAML'
8
+ self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
9
+ self.arguments = [
10
+ CLAide::Argument.new('PATH', true),
11
+ ]
12
+
13
+ def initialize(argv)
14
+ @path = argv.shift_argument
15
+ super
16
+ end
17
+
18
+ def validate!
19
+ super
20
+ help! 'A Podfile path is required.' unless @path
21
+ end
22
+
23
+ def run
24
+ require 'yaml'
25
+ podfile = Pod::Podfile.from_file(@path)
26
+ output_pipe.puts podfile.to_yaml
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,51 @@
1
+ module Pod
2
+ class Command
3
+ class IPC < Command
4
+ class Repl < IPC
5
+ include ProjectDirectory
6
+
7
+ END_OF_OUTPUT_SIGNAL = "\n\r".freeze
8
+
9
+ self.summary = 'The repl listens to commands on standard input'
10
+ self.description = <<-DESC
11
+ The repl listens to commands on standard input and prints their
12
+ result to standard output.
13
+ It accepts all the other ipc subcommands. The repl will signal the
14
+ end of output with the the ASCII CR+LF `\\n\\r`.
15
+ DESC
16
+
17
+ def run
18
+ print_version
19
+ signal_end_of_output
20
+ listen
21
+ end
22
+
23
+ def print_version
24
+ output_pipe.puts "version: '#{Pod::VERSION}'"
25
+ end
26
+
27
+ def signal_end_of_output
28
+ output_pipe.puts(END_OF_OUTPUT_SIGNAL)
29
+ STDOUT.flush
30
+ end
31
+
32
+ def listen
33
+ while repl_command = STDIN.gets
34
+ execute_repl_command(repl_command)
35
+ end
36
+ end
37
+
38
+ def execute_repl_command(repl_command)
39
+ unless repl_command == '\n'
40
+ repl_commands = repl_command.split
41
+ subcommand = repl_commands.shift.capitalize
42
+ arguments = repl_commands
43
+ subcommand_class = Pod::Command::IPC.const_get(subcommand)
44
+ subcommand_class.new(CLAide::ARGV.new(arguments)).run
45
+ signal_end_of_output
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,29 @@
1
+ module Pod
2
+ class Command
3
+ class IPC < Command
4
+ class Spec < IPC
5
+ self.summary = 'Converts a podspec to JSON'
6
+ self.description = 'Converts a podspec to JSON and prints it to STDOUT.'
7
+ self.arguments = [
8
+ CLAide::Argument.new('PATH', true),
9
+ ]
10
+
11
+ def initialize(argv)
12
+ @path = argv.shift_argument
13
+ super
14
+ end
15
+
16
+ def validate!
17
+ super
18
+ help! 'A specification path is required.' unless @path
19
+ end
20
+
21
+ def run
22
+ require 'json'
23
+ spec = Specification.from_file(@path)
24
+ output_pipe.puts(spec.to_pretty_json)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,24 @@
1
+ module Pod
2
+ class Command
3
+ class IPC < Command
4
+ class UpdateSearchIndex < IPC
5
+ self.summary = 'Updates the search index'
6
+ self.description = <<-DESC
7
+ Updates the search index and prints its path to standard output.
8
+ The search index is a YAML encoded dictionary where the keys
9
+ are the names of the Pods and the values are a dictionary containing
10
+ the following information:
11
+ - version
12
+ - summary
13
+ - description
14
+ - authors
15
+ DESC
16
+
17
+ def run
18
+ config.sources_manager.updated_search_index
19
+ output_pipe.puts(config.sources_manager.search_index_path)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,215 +1,11 @@
1
+ require 'cocoapods/command/lib/create'
2
+ require 'cocoapods/command/lib/lint'
3
+
1
4
  module Pod
2
5
  class Command
3
6
  class Lib < Command
4
7
  self.abstract_command = true
5
8
  self.summary = 'Develop pods'
6
-
7
- #-----------------------------------------------------------------------#
8
-
9
- class Create < Lib
10
- self.summary = 'Creates a new Pod'
11
-
12
- self.description = <<-DESC
13
- Creates a scaffold for the development of a new Pod named `NAME`
14
- according to the CocoaPods best practices.
15
- If a `TEMPLATE_URL`, pointing to a git repo containing a compatible
16
- template, is specified, it will be used in place of the default one.
17
- DESC
18
-
19
- self.arguments = [
20
- CLAide::Argument.new('NAME', true),
21
- ]
22
-
23
- def self.options
24
- [
25
- ['--template-url=URL', 'The URL of the git repo containing a ' \
26
- 'compatible template'],
27
- ].concat(super)
28
- end
29
-
30
- def initialize(argv)
31
- @name = argv.shift_argument
32
- @template_url = argv.option('template-url', TEMPLATE_REPO)
33
- super
34
- @additional_args = argv.remainder!
35
- end
36
-
37
- def validate!
38
- super
39
- help! 'A name for the Pod is required.' unless @name
40
- help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
41
- help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
42
- end
43
-
44
- def run
45
- clone_template
46
- configure_template
47
- print_info
48
- end
49
-
50
- private
51
-
52
- #----------------------------------------#
53
-
54
- # !@group Private helpers
55
-
56
- extend Executable
57
- executable :git
58
-
59
- TEMPLATE_REPO = 'https://github.com/CocoaPods/pod-template.git'
60
- TEMPLATE_INFO_URL = 'https://github.com/CocoaPods/pod-template'
61
- CREATE_NEW_POD_INFO_URL = 'http://guides.cocoapods.org/making/making-a-cocoapod'
62
-
63
- # Clones the template from the remote in the working directory using
64
- # the name of the Pod.
65
- #
66
- # @return [void]
67
- #
68
- def clone_template
69
- UI.section("Cloning `#{template_repo_url}` into `#{@name}`.") do
70
- git! ['clone', template_repo_url, @name]
71
- end
72
- end
73
-
74
- # Runs the template configuration utilities.
75
- #
76
- # @return [void]
77
- #
78
- def configure_template
79
- UI.section("Configuring #{@name} template.") do
80
- Dir.chdir(@name) do
81
- if File.exist?('configure')
82
- system('./configure', @name, *@additional_args)
83
- else
84
- UI.warn 'Template does not have a configure file.'
85
- end
86
- end
87
- end
88
- end
89
-
90
- # Runs the template configuration utilities.
91
- #
92
- # @return [void]
93
- #
94
- def print_info
95
- UI.puts "\nTo learn more about the template see `#{template_repo_url}`."
96
- UI.puts "To learn more about creating a new pod, see `#{CREATE_NEW_POD_INFO_URL}`."
97
- end
98
-
99
- # Checks if a template URL is given else returns the TEMPLATE_REPO URL
100
- #
101
- # @return String
102
- #
103
- def template_repo_url
104
- @template_url || TEMPLATE_REPO
105
- end
106
- end
107
-
108
- #-----------------------------------------------------------------------#
109
-
110
- class Lint < Lib
111
- self.summary = 'Validates a Pod'
112
-
113
- self.description = <<-DESC
114
- Validates the Pod using the files in the working directory.
115
- DESC
116
-
117
- def self.options
118
- [
119
- ['--quick', 'Lint skips checks that would require to download and build the spec'],
120
- ['--allow-warnings', 'Lint validates even if warnings are present'],
121
- ['--subspec=NAME', 'Lint validates only the given subspec'],
122
- ['--no-subspecs', 'Lint skips validation of subspecs'],
123
- ['--no-clean', 'Lint leaves the build directory intact for inspection'],
124
- ['--fail-fast', 'Lint stops on the first failing platform or subspec'],
125
- ['--use-libraries', 'Lint uses static libraries to install the spec'],
126
- ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to pull dependent pods ' \
127
- '(defaults to https://github.com/CocoaPods/Specs.git). ' \
128
- 'Multiple sources must be comma-delimited.'],
129
- ['--private', 'Lint skips checks that apply only to public specs'],
130
- ].concat(super)
131
- end
132
-
133
- def initialize(argv)
134
- @quick = argv.flag?('quick')
135
- @allow_warnings = argv.flag?('allow-warnings')
136
- @clean = argv.flag?('clean', true)
137
- @fail_fast = argv.flag?('fail-fast', false)
138
- @subspecs = argv.flag?('subspecs', true)
139
- @only_subspec = argv.option('subspec')
140
- @use_frameworks = !argv.flag?('use-libraries')
141
- @source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
142
- @private = argv.flag?('private', false)
143
- @podspecs_paths = argv.arguments!
144
- super
145
- end
146
-
147
- def validate!
148
- super
149
- end
150
-
151
- def run
152
- UI.puts
153
- podspecs_to_lint.each do |podspec|
154
- validator = Validator.new(podspec, @source_urls)
155
- validator.local = true
156
- validator.quick = @quick
157
- validator.no_clean = !@clean
158
- validator.fail_fast = @fail_fast
159
- validator.allow_warnings = @allow_warnings
160
- validator.no_subspecs = !@subspecs || @only_subspec
161
- validator.only_subspec = @only_subspec
162
- validator.use_frameworks = @use_frameworks
163
- validator.ignore_public_only_results = @private
164
- validator.validate
165
-
166
- unless @clean
167
- UI.puts "Pods workspace available at `#{validator.validation_dir}/App.xcworkspace` for inspection."
168
- UI.puts
169
- end
170
- if validator.validated?
171
- UI.puts "#{validator.spec.name} passed validation.".green
172
- else
173
- spec_name = podspec
174
- spec_name = validator.spec.name if validator.spec
175
- message = "#{spec_name} did not pass validation, due to #{validator.failure_reason}."
176
-
177
- if @clean
178
- message << "\nYou can use the `--no-clean` option to inspect " \
179
- 'any issue.'
180
- end
181
- raise Informative, message
182
- end
183
- end
184
- end
185
-
186
- private
187
-
188
- #----------------------------------------#
189
-
190
- # !@group Private helpers
191
-
192
- # @return [Pathname] The path of the podspec found in the current
193
- # working directory.
194
- #
195
- # @raise If no podspec is found.
196
- # @raise If multiple podspecs are found.
197
- #
198
- def podspecs_to_lint
199
- if !@podspecs_paths.empty?
200
- Array(@podspecs_paths)
201
- else
202
- podspecs = Pathname.glob(Pathname.pwd + '*.podspec{.json,}')
203
- if podspecs.count.zero?
204
- raise Informative, 'Unable to find a podspec in the working ' \
205
- 'directory'
206
- end
207
- podspecs
208
- end
209
- end
210
- end
211
-
212
- #-----------------------------------------------------------------------#
213
9
  end
214
10
  end
215
11
  end
@@ -0,0 +1,105 @@
1
+ module Pod
2
+ class Command
3
+ class Lib < Command
4
+ class Create < Lib
5
+ self.summary = 'Creates a new Pod'
6
+
7
+ self.description = <<-DESC
8
+ Creates a scaffold for the development of a new Pod named `NAME`
9
+ according to the CocoaPods best practices.
10
+ If a `TEMPLATE_URL`, pointing to a git repo containing a compatible
11
+ template, is specified, it will be used in place of the default one.
12
+ DESC
13
+
14
+ self.arguments = [
15
+ CLAide::Argument.new('NAME', true),
16
+ ]
17
+
18
+ def self.options
19
+ [
20
+ ['--template-url=URL', 'The URL of the git repo containing a ' \
21
+ 'compatible template'],
22
+ ].concat(super)
23
+ end
24
+
25
+ def initialize(argv)
26
+ @name = argv.shift_argument
27
+ @template_url = argv.option('template-url', TEMPLATE_REPO)
28
+ super
29
+ @additional_args = argv.remainder!
30
+ end
31
+
32
+ def validate!
33
+ super
34
+ help! 'A name for the Pod is required.' unless @name
35
+ help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
36
+ help! 'The Pod name cannot contain plusses.' if @name =~ /\+/
37
+ help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
38
+ end
39
+
40
+ def run
41
+ clone_template
42
+ configure_template
43
+ print_info
44
+ end
45
+
46
+ private
47
+
48
+ #----------------------------------------#
49
+
50
+ # !@group Private helpers
51
+
52
+ extend Executable
53
+ executable :git
54
+
55
+ TEMPLATE_REPO = 'https://github.com/CocoaPods/pod-template.git'.freeze
56
+ TEMPLATE_INFO_URL = 'https://github.com/CocoaPods/pod-template'.freeze
57
+ CREATE_NEW_POD_INFO_URL = 'http://guides.cocoapods.org/making/making-a-cocoapod'.freeze
58
+
59
+ # Clones the template from the remote in the working directory using
60
+ # the name of the Pod.
61
+ #
62
+ # @return [void]
63
+ #
64
+ def clone_template
65
+ UI.section("Cloning `#{template_repo_url}` into `#{@name}`.") do
66
+ git! ['clone', template_repo_url, @name]
67
+ end
68
+ end
69
+
70
+ # Runs the template configuration utilities.
71
+ #
72
+ # @return [void]
73
+ #
74
+ def configure_template
75
+ UI.section("Configuring #{@name} template.") do
76
+ Dir.chdir(@name) do
77
+ if File.exist?('configure')
78
+ system('./configure', @name, *@additional_args)
79
+ else
80
+ UI.warn 'Template does not have a configure file.'
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+ # Runs the template configuration utilities.
87
+ #
88
+ # @return [void]
89
+ #
90
+ def print_info
91
+ UI.puts "\nTo learn more about the template see `#{template_repo_url}`."
92
+ UI.puts "To learn more about creating a new pod, see `#{CREATE_NEW_POD_INFO_URL}`."
93
+ end
94
+
95
+ # Checks if a template URL is given else returns the TEMPLATE_REPO URL
96
+ #
97
+ # @return String
98
+ #
99
+ def template_repo_url
100
+ @template_url || TEMPLATE_REPO
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,107 @@
1
+ module Pod
2
+ class Command
3
+ class Lib < Command
4
+ class Lint < Lib
5
+ self.summary = 'Validates a Pod'
6
+
7
+ self.description = <<-DESC
8
+ Validates the Pod using the files in the working directory.
9
+ DESC
10
+
11
+ def self.options
12
+ [
13
+ ['--quick', 'Lint skips checks that would require to download and build the spec'],
14
+ ['--allow-warnings', 'Lint validates even if warnings are present'],
15
+ ['--subspec=NAME', 'Lint validates only the given subspec'],
16
+ ['--no-subspecs', 'Lint skips validation of subspecs'],
17
+ ['--no-clean', 'Lint leaves the build directory intact for inspection'],
18
+ ['--fail-fast', 'Lint stops on the first failing platform or subspec'],
19
+ ['--use-libraries', 'Lint uses static libraries to install the spec'],
20
+ ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to pull dependent pods ' \
21
+ '(defaults to https://github.com/CocoaPods/Specs.git). ' \
22
+ 'Multiple sources must be comma-delimited.'],
23
+ ['--private', 'Lint skips checks that apply only to public specs'],
24
+ ].concat(super)
25
+ end
26
+
27
+ def initialize(argv)
28
+ @quick = argv.flag?('quick')
29
+ @allow_warnings = argv.flag?('allow-warnings')
30
+ @clean = argv.flag?('clean', true)
31
+ @fail_fast = argv.flag?('fail-fast', false)
32
+ @subspecs = argv.flag?('subspecs', true)
33
+ @only_subspec = argv.option('subspec')
34
+ @use_frameworks = !argv.flag?('use-libraries')
35
+ @source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
36
+ @private = argv.flag?('private', false)
37
+ @podspecs_paths = argv.arguments!
38
+ super
39
+ end
40
+
41
+ def validate!
42
+ super
43
+ end
44
+
45
+ def run
46
+ UI.puts
47
+ podspecs_to_lint.each do |podspec|
48
+ validator = Validator.new(podspec, @source_urls)
49
+ validator.local = true
50
+ validator.quick = @quick
51
+ validator.no_clean = !@clean
52
+ validator.fail_fast = @fail_fast
53
+ validator.allow_warnings = @allow_warnings
54
+ validator.no_subspecs = !@subspecs || @only_subspec
55
+ validator.only_subspec = @only_subspec
56
+ validator.use_frameworks = @use_frameworks
57
+ validator.ignore_public_only_results = @private
58
+ validator.validate
59
+
60
+ unless @clean
61
+ UI.puts "Pods workspace available at `#{validator.validation_dir}/App.xcworkspace` for inspection."
62
+ UI.puts
63
+ end
64
+ if validator.validated?
65
+ UI.puts "#{validator.spec.name} passed validation.".green
66
+ else
67
+ spec_name = podspec
68
+ spec_name = validator.spec.name if validator.spec
69
+ message = "#{spec_name} did not pass validation, due to #{validator.failure_reason}."
70
+
71
+ if @clean
72
+ message << "\nYou can use the `--no-clean` option to inspect " \
73
+ 'any issue.'
74
+ end
75
+ raise Informative, message
76
+ end
77
+ end
78
+ end
79
+
80
+ private
81
+
82
+ #----------------------------------------#
83
+
84
+ # !@group Private helpers
85
+
86
+ # @return [Pathname] The path of the podspec found in the current
87
+ # working directory.
88
+ #
89
+ # @raise If no podspec is found.
90
+ # @raise If multiple podspecs are found.
91
+ #
92
+ def podspecs_to_lint
93
+ if !@podspecs_paths.empty?
94
+ Array(@podspecs_paths)
95
+ else
96
+ podspecs = Pathname.glob(Pathname.pwd + '*.podspec{.json,}')
97
+ if podspecs.count.zero?
98
+ raise Informative, 'Unable to find a podspec in the working ' \
99
+ 'directory'
100
+ end
101
+ podspecs
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -49,14 +49,13 @@ module Pod
49
49
  end
50
50
 
51
51
  def validate!
52
+ super
52
53
  help! 'A spec-repo name is required.' unless @repo
53
54
  unless @source.repo.directory?
54
55
  raise Informative,
55
56
  "Unable to find the `#{@repo}` repo. " \
56
57
  'If it has not yet been cloned, add it via `pod repo add`.'
57
58
  end
58
-
59
- super
60
59
  end
61
60
 
62
61
  def run
@@ -1,3 +1,5 @@
1
+ require 'active_support/multibyte/unicode'
2
+
1
3
  module Pod
2
4
  # Stores the global configuration of CocoaPods.
3
5
  #
@@ -145,7 +147,8 @@ module Pod
145
147
  # Podfile is located.
146
148
  #
147
149
  def installation_root
148
- current_path = Pathname.pwd
150
+ current_dir = ActiveSupport::Multibyte::Unicode.normalize(Dir.pwd)
151
+ current_path = Pathname.new(current_dir)
149
152
  unless @installation_root
150
153
  until current_path.root?
151
154
  if podfile_path_in_dir(current_path)
@@ -108,7 +108,7 @@ module Pod
108
108
  #
109
109
  def self.which!(program)
110
110
  which(program).tap do |bin|
111
- raise Informative, "Unable to locate the executable `#{executable}`" unless bin
111
+ raise Informative, "Unable to locate the executable `#{program}`" unless bin
112
112
  end
113
113
  end
114
114
 
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the CocoaPods command line tool.
3
3
  #
4
- VERSION = '1.0.0'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.0.1'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -144,8 +144,8 @@ EOM
144
144
  ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
145
145
  ;;
146
146
  *\.xib)
147
- echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
148
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
147
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
148
+ ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
149
149
  ;;
150
150
  *.framework)
151
151
  echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
@@ -72,7 +72,7 @@ module Pod
72
72
  else
73
73
  raise Informative, 'Could not automatically select an Xcode project. ' \
74
74
  "Specify one in your Podfile like so:\n\n" \
75
- " xcodeproj 'path/to/Project.xcodeproj'\n"
75
+ " project 'path/to/Project.xcodeproj'\n"
76
76
  end
77
77
  end
78
78
  path
@@ -32,6 +32,7 @@ module Pod
32
32
  target.file_accessors.flat_map(&:public_headers).map(&:basename)
33
33
  end
34
34
  end
35
+ create_build_phase_to_symlink_header_folders
35
36
  end
36
37
  create_prefix_header
37
38
  create_dummy_source
@@ -216,6 +217,26 @@ module Pod
216
217
  end
217
218
  end
218
219
 
220
+ # Creates a build phase which links the versioned header folders
221
+ # of the OS X into the framework bundle's root root directory.
222
+ # This is only necessary because the way how headers are copied
223
+ # via custom copy file build phases in combination with
224
+ # header_mappings_dir interferes with xcodebuild's expectations
225
+ # about the existence of private or public headers.
226
+ #
227
+ # @return [void]
228
+ #
229
+ def create_build_phase_to_symlink_header_folders
230
+ return unless target.platform.name == :osx && header_mappings_dir
231
+
232
+ build_phase = native_target.new_shell_script_build_phase('Create Symlinks to Header Folders')
233
+ build_phase.shell_script = <<-eos.strip_heredoc
234
+ cd "$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME"
235
+ ln -fs ${PUBLIC_HEADERS_FOLDER_PATH\#$WRAPPER_NAME/} ${PUBLIC_HEADERS_FOLDER_PATH\#\$CONTENTS_FOLDER_PATH/}
236
+ ln -fs ${PRIVATE_HEADERS_FOLDER_PATH\#\$WRAPPER_NAME/} ${PRIVATE_HEADERS_FOLDER_PATH\#\$CONTENTS_FOLDER_PATH/}
237
+ eos
238
+ end
239
+
219
240
  # Creates a prefix header file which imports `UIKit` or `Cocoa` according
220
241
  # to the platform of the target. This file also include any prefix header
221
242
  # content reported by the specification of the pods.
@@ -11,7 +11,7 @@ module Pod
11
11
 
12
12
  # @return [String] the PACKAGE emoji to use as prefix for every build phase aded to the user project
13
13
  #
14
- BUILD_PHASE_PREFIX = "\u{1F4E6} ".freeze
14
+ BUILD_PHASE_PREFIX = '[CP] '.freeze
15
15
 
16
16
  # @return [String] the name of the check manifest phase
17
17
  #
@@ -215,8 +215,7 @@ module Pod
215
215
  def create_or_update_build_phase(target, phase_name, phase_class = Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
216
216
  prefixed_phase_name = BUILD_PHASE_PREFIX + phase_name
217
217
  build_phases = target.build_phases.grep(phase_class)
218
- build_phases.find { |phase| phase.name == prefixed_phase_name } ||
219
- build_phases.find { |phase| phase.name == phase_name }.tap { |p| p.name = prefixed_phase_name if p } ||
218
+ build_phases.find { |phase| phase.name && phase.name.end_with?(phase_name) }.tap { |p| p.name = prefixed_phase_name if p } ||
220
219
  target.project.new(phase_class).tap do |phase|
221
220
  UI.message("Adding Build Phase '#{prefixed_phase_name}' to project.") do
222
221
  phase.name = prefixed_phase_name
@@ -1,3 +1,5 @@
1
+ require 'active_support/multibyte/unicode'
2
+
1
3
  module Pod
2
4
  class Sandbox
3
5
  # The PathList class is designed to perform multiple glob matches against
@@ -20,7 +22,8 @@ module Pod
20
22
  # @param [Pathname] root The root of the PathList.
21
23
  #
22
24
  def initialize(root)
23
- @root = root
25
+ root_dir = ActiveSupport::Multibyte::Unicode.normalize(root.to_s)
26
+ @root = Pathname.new(root_dir)
24
27
  @glob_cache = {}
25
28
  end
26
29
 
@@ -47,15 +50,12 @@ module Pod
47
50
  unless root.exist?
48
51
  raise Informative, "Attempt to read non existent folder `#{root}`."
49
52
  end
50
- root_length = root.to_s.length + 1
51
53
  escaped_root = escape_path_for_glob(root)
52
- paths = Dir.glob(escaped_root + '**/*', File::FNM_DOTMATCH).sort_by(&:upcase)
53
- absolute_dirs = paths.select { |path| File.directory?(path) }
54
- relative_dirs = absolute_dirs.map { |p| p[root_length..-1] }
55
- absolute_paths = paths.reject { |p| p == "#{root}/." || p == "#{root}/.." }
56
- relative_paths = absolute_paths.map { |p| p[root_length..-1] }
57
- @files = relative_paths - relative_dirs
58
- @dirs = relative_dirs.map { |d| d.gsub(/\/\.\.?$/, '') }.reject { |d| d == '.' || d == '..' } .uniq
54
+ absolute_paths = Pathname.glob(escaped_root + '**/*', File::FNM_DOTMATCH)
55
+ dirs_and_files = absolute_paths.reject { |path| path.basename.to_s =~ /^\.\.?$/ }
56
+ relative_paths = dirs_and_files.map { |path| path.relative_path_from(root) }
57
+ sorted_paths = relative_paths.map(&:to_s).sort_by(&:upcase)
58
+ @dirs, @files = sorted_paths.partition { |path| File.directory?(root + path) }
59
59
  @glob_cache = {}
60
60
  end
61
61
 
@@ -1,4 +1,5 @@
1
1
  require 'cocoapods-core/source'
2
+ require 'set'
2
3
 
3
4
  module Pod
4
5
  class Source
@@ -141,8 +142,6 @@ module Pod
141
142
  "CocoaPods #{latest_cocoapods_version} is available.".green,
142
143
  "To update use: `#{install_message}`".green,
143
144
  ("[!] This is a test version we'd love you to try.".yellow if rc),
144
- ("Until we reach version 1.0 the features of CocoaPods can and will change.\n" \
145
- 'We strongly recommend that you use the latest version at all times.'.yellow unless rc),
146
145
  '',
147
146
  'For more information, see https://blog.cocoapods.org ' \
148
147
  'and the CHANGELOG for this version at ' \
@@ -7,7 +7,7 @@ module Pod
7
7
  module UserInterface
8
8
  require 'colored'
9
9
 
10
- @title_colors = %w( yellow green )
10
+ @title_colors = %w( yellow green )
11
11
  @title_level = 0
12
12
  @indentation_level = 2
13
13
  @treat_titles_as_messages = false
@@ -117,9 +117,6 @@ module Pod
117
117
  self.title_level -= 1
118
118
  end
119
119
 
120
- # def title(title, verbose_prefix = '', relative_indentation = 2)
121
- # end
122
-
123
120
  # Prints a verbose message taking an optional verbose prefix and
124
121
  # a relative indentation valid for the UI action in the passed
125
122
  # block.
@@ -575,7 +575,7 @@ module Pod
575
575
  end
576
576
  non_source_files = header_files - file_accessor.source_files
577
577
  unless non_source_files.empty?
578
- error(attr_name, 'The pattern includes header files that are not listed' \
578
+ error(attr_name, 'The pattern includes header files that are not listed ' \
579
579
  "in source_files (#{non_source_files.join(', ')}).")
580
580
  end
581
581
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-05-10 00:00:00.000000000 Z
14
+ date: 2016-06-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods-core
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.0
22
+ version: 1.0.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.0
29
+ version: 1.0.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -207,7 +207,7 @@ dependencies:
207
207
  requirements:
208
208
  - - '>='
209
209
  - !ruby/object:Gem::Version
210
- version: 1.0.0
210
+ version: 1.1.0
211
211
  - - <
212
212
  - !ruby/object:Gem::Version
213
213
  version: '2.0'
@@ -217,7 +217,7 @@ dependencies:
217
217
  requirements:
218
218
  - - '>='
219
219
  - !ruby/object:Gem::Version
220
- version: 1.0.0
220
+ version: 1.1.0
221
221
  - - <
222
222
  - !ruby/object:Gem::Version
223
223
  version: '2.0'
@@ -363,8 +363,15 @@ files:
363
363
  - lib/cocoapods/command/env.rb
364
364
  - lib/cocoapods/command/init.rb
365
365
  - lib/cocoapods/command/install.rb
366
- - lib/cocoapods/command/inter_process_communication.rb
366
+ - lib/cocoapods/command/ipc.rb
367
+ - lib/cocoapods/command/ipc/list.rb
368
+ - lib/cocoapods/command/ipc/podfile.rb
369
+ - lib/cocoapods/command/ipc/repl.rb
370
+ - lib/cocoapods/command/ipc/spec.rb
371
+ - lib/cocoapods/command/ipc/update_search_index.rb
367
372
  - lib/cocoapods/command/lib.rb
373
+ - lib/cocoapods/command/lib/create.rb
374
+ - lib/cocoapods/command/lib/lint.rb
368
375
  - lib/cocoapods/command/list.rb
369
376
  - lib/cocoapods/command/options/project_directory.rb
370
377
  - lib/cocoapods/command/options/repo_update.rb
@@ -1,177 +0,0 @@
1
- module Pod
2
- class Command
3
- class IPC < Command
4
- self.abstract_command = true
5
- self.summary = 'Inter-process communication'
6
-
7
- def output_pipe
8
- STDOUT
9
- end
10
-
11
- #-----------------------------------------------------------------------#
12
-
13
- class Spec < IPC
14
- self.summary = 'Converts a podspec to JSON'
15
- self.description = 'Converts a podspec to JSON and prints it to STDOUT.'
16
- self.arguments = [
17
- CLAide::Argument.new('PATH', true),
18
- ]
19
-
20
- def initialize(argv)
21
- @path = argv.shift_argument
22
- super
23
- end
24
-
25
- def validate!
26
- super
27
- help! 'A specification path is required.' unless @path
28
- end
29
-
30
- def run
31
- require 'json'
32
- spec = Specification.from_file(@path)
33
- output_pipe.puts(spec.to_pretty_json)
34
- end
35
- end
36
-
37
- #-----------------------------------------------------------------------#
38
-
39
- class Podfile < IPC
40
- include ProjectDirectory
41
-
42
- self.summary = 'Converts a Podfile to YAML'
43
- self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
44
- self.arguments = [
45
- CLAide::Argument.new('PATH', true),
46
- ]
47
-
48
- def initialize(argv)
49
- @path = argv.shift_argument
50
- super
51
- end
52
-
53
- def validate!
54
- super
55
- help! 'A Podfile path is required.' unless @path
56
- end
57
-
58
- def run
59
- require 'yaml'
60
- podfile = Pod::Podfile.from_file(@path)
61
- output_pipe.puts podfile.to_yaml
62
- end
63
- end
64
-
65
- #-----------------------------------------------------------------------#
66
-
67
- class List < IPC
68
- self.summary = 'Lists the specifications known to CocoaPods'
69
- self.description = <<-DESC
70
- Prints to STDOUT a YAML dictionary where the keys are the name of the
71
- specifications and each corresponding value is a dictionary with
72
- the following keys:
73
-
74
- - defined_in_file
75
- - version
76
- - authors
77
- - summary
78
- - description
79
- - platforms
80
- DESC
81
-
82
- def run
83
- require 'yaml'
84
- sets = config.sources_manager.aggregate.all_sets
85
- result = {}
86
- sets.each do |set|
87
- begin
88
- spec = set.specification
89
- result[spec.name] = {
90
- 'authors' => spec.authors.keys,
91
- 'summary' => spec.summary,
92
- 'description' => spec.description,
93
- 'platforms' => spec.available_platforms.map { |p| p.name.to_s },
94
- }
95
- rescue DSLError
96
- next
97
- end
98
- end
99
- output_pipe.puts result.to_yaml
100
- end
101
- end
102
-
103
- #-----------------------------------------------------------------------#
104
-
105
- class UpdateSearchIndex < IPC
106
- self.summary = 'Updates the search index'
107
- self.description = <<-DESC
108
- Updates the search index and prints its path to standard output.
109
- The search index is a YAML encoded dictionary where the keys
110
- are the names of the Pods and the values are a dictionary containing
111
- the following information:
112
-
113
- - version
114
- - summary
115
- - description
116
- - authors
117
- DESC
118
-
119
- def run
120
- config.sources_manager.updated_search_index
121
- output_pipe.puts(config.sources_manager.search_index_path)
122
- end
123
- end
124
-
125
- #-----------------------------------------------------------------------#
126
-
127
- class Repl < IPC
128
- include ProjectDirectory
129
-
130
- END_OF_OUTPUT_SIGNAL = "\n\r"
131
-
132
- self.summary = 'The repl listens to commands on standard input'
133
- self.description = <<-DESC
134
- The repl listens to commands on standard input and prints their
135
- result to standard output.
136
-
137
- It accepts all the other ipc subcommands. The repl will signal the
138
- end of output with the the ASCII CR+LF `\\n\\r`.
139
- DESC
140
-
141
- def run
142
- print_version
143
- signal_end_of_output
144
- listen
145
- end
146
-
147
- def print_version
148
- output_pipe.puts "version: '#{Pod::VERSION}'"
149
- end
150
-
151
- def signal_end_of_output
152
- output_pipe.puts(END_OF_OUTPUT_SIGNAL)
153
- STDOUT.flush
154
- end
155
-
156
- def listen
157
- while repl_command = STDIN.gets
158
- execute_repl_command(repl_command)
159
- end
160
- end
161
-
162
- def execute_repl_command(repl_command)
163
- if (repl_command != "\n")
164
- repl_commands = repl_command.split
165
- subcommand = repl_commands.shift.capitalize
166
- arguments = repl_commands
167
- subcommand_class = Pod::Command::IPC.const_get(subcommand)
168
- subcommand_class.new(CLAide::ARGV.new(arguments)).run
169
- signal_end_of_output
170
- end
171
- end
172
- end
173
-
174
- #-----------------------------------------------------------------------#
175
- end
176
- end
177
- end