cocoapods 0.37.0.beta.1 → 0.37.0.rc.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
  SHA1:
3
- metadata.gz: ab74bb5d0f584952ffd9115c2e61a0b624b9fb03
4
- data.tar.gz: a935b3bff32b56d454932f95bff73eb4b6b780b5
3
+ metadata.gz: a26042f0448f6610faa8a5f75f0514784c0d5c33
4
+ data.tar.gz: 5053a7897ddcc85454482cfe5e640f8ef3732bc3
5
5
  SHA512:
6
- metadata.gz: b4c2c341908e2cceb3ee3ad114c21296648f583a19e1f11f31c062540727b3647c64e4fcab70ac8d3d32c3903fd0c611bd638eee052ce527a1fccfe2494e6921
7
- data.tar.gz: d0161a847678e8d4d35efdf85dbf95e03dfc477af4348849c2230c84864b40096f5aeb287b9d9fbbf36473ee939527bfce4440b341e4839cda943bd99cd8d41b
6
+ metadata.gz: 4fd3572b8d654e49c5c35cbd39de6f7b3cce5e10be5d8d58f6730f5f20930b8dfec613896eea12e61d82d869dfab8e238088f8f66e75d0efbb6f8a2e49177162
7
+ data.tar.gz: e11d9d17fbc11cf19bb28096b47d768efb8bba8406984b5cb191ecb09c5b4e9e83bac4ecad9301bb9687f74ed75e577f3812e223b5d01ea46498d4ae21ee44d6
@@ -4,6 +4,62 @@ 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
+ ## 0.37.0.rc.1
8
+
9
+ [Core](https://github.com/CocoaPods/Core/compare/0.37.0.beta.1...0.37.0.rc.1)
10
+ [Xcodeproj](https://github.com/CocoaPods/Xcodeproj/compare/0.24.0...0.24.1)
11
+
12
+ ##### Enhancements
13
+
14
+ * Add environment variable `COCOAPODS_SKIP_UPDATE_MESSAGE` to disable new
15
+ version message.
16
+ [Andrea Mazzini](https://github.com/andreamazz)
17
+ [#3364](https://github.com/CocoaPods/CocoaPods/issues/3364)
18
+
19
+ * Use user project's object version for pods project.
20
+ [Boris Bügling](https://github.com/neonichu)
21
+ [#253](https://github.com/CocoaPods/Xcodeproj/issues/253)
22
+
23
+ ##### Bug Fixes
24
+
25
+ * Adding `$(inherited)` to `FRAMEWORK_SEARCH_PATHS` build setting in xcconfig for aggregate.
26
+ [Tomohiro Kumagai](https://github.com/EZ-NET)
27
+ [#3429](https://github.com/CocoaPods/CocoaPods/pull/3429)
28
+
29
+ * Don't crash when the downloader can't find an appropriate podspec in a `git`
30
+ pod.
31
+ [Samuel Giddins](https://github.com/segiddins)
32
+ [#3433](https://github.com/CocoaPods/CocoaPods/issues/3433)
33
+
34
+ * Automatically lock Pod source files after installing.
35
+ [Mason Glidden](https://github.com/mglidden)
36
+ [#1154](https://github.com/CocoaPods/CocoaPods/issues/1154)
37
+
38
+ * Handle subprocesses leaking STDOUT/STDERR pipes by more strictly managing
39
+ process lifetime and not allowing I/O to block completion of the task.
40
+ [Samuel Giddins](https://github.com/segiddins)
41
+ [#3101](https://github.com/CocoaPods/CocoaPods/issues/3101)
42
+
43
+ * Do not create pod target if `source_files` only contains headers.
44
+ [Boris Bügling](https://github.com/neonichu)
45
+ [#3106](https://github.com/CocoaPods/CocoaPods/issues/3106)
46
+
47
+ * Run a pod's `prepare_command` (if it has one) before it is cleaned in the
48
+ download cache.
49
+ [Marius Rackwitz](https://github.com/mrackwitz)
50
+ [Samuel Giddins](https://github.com/segiddins)
51
+ [#3436](https://github.com/CocoaPods/CocoaPods/issues/3436)
52
+
53
+ * Don't set the `-fno-objc-arc` compiler flags for files for which the flag
54
+ makes no sense.
55
+ [Samuel Giddins](https://github.com/segiddins)
56
+ [#2559](https://github.com/CocoaPods/CocoaPods/issues/2559)
57
+
58
+ * Also apply a pod's configuration to any resource targets defined by the pod.
59
+ [Tom Adriaenssen](https://github.com/inferis)
60
+ [#3463](https://github.com/CocoaPods/CocoaPods/issues/3463)
61
+
62
+
7
63
  ## 0.37.0.beta.1
8
64
 
9
65
  ##### Enhancements
data/README.md CHANGED
@@ -30,8 +30,8 @@ project goals influence and drive the design of CocoaPods:
30
30
  - Allow library authors to structure their libraries however they like.
31
31
  - Save time for library authors by automating a lot of Xcode work not
32
32
  related to their libraries' functionality.
33
- - Support any source management system. (Currently supported are git,
34
- svn, mercurial, bazaar, and various types of archives downloaded over HTTP.)
33
+ - Support any source management system. (Currently supported are `git`,
34
+ `svn`, `mercurial`, `bazaar`, and various types of archives downloaded over HTTP.)
35
35
  - Promote a culture of distributed collaboration on pods, but also provide
36
36
  features only possible with a centralised solution to foster a community.
37
37
  - Build tools on top of the core Cocoa development system, including those
@@ -19,7 +19,7 @@ module Pod
19
19
 
20
20
  :clean => true,
21
21
  :integrate_targets => true,
22
- :new_version_message => true,
22
+ :new_version_message => ENV['COCOAPODS_SKIP_UPDATE_MESSAGE'].nil?,
23
23
 
24
24
  :cache_root => Pathname.new(Dir.home) + 'Library/Caches/CocoaPods',
25
25
  }
@@ -32,7 +32,7 @@ module Pod
32
32
  cache_path, tmp_cache = Pathname(Dir.mktmpdir), true unless cache_path
33
33
  cache = Cache.new(cache_path)
34
34
  result = cache.download_pod(request)
35
- if target
35
+ if target && result.location
36
36
  UI.message "Copying #{request.name} from `#{result.location}` to #{UI.path target}", '> ' do
37
37
  FileUtils.rm_rf target
38
38
  FileUtils.cp_r(result.location, target)
@@ -188,6 +188,7 @@ module Pod
188
188
  end
189
189
  destination.parent.mkpath
190
190
  FileUtils.cp_r(source, destination)
191
+ Pod::Installer::PodSourcePreparer.new(spec, destination).prepare!
191
192
  Sandbox::PodDirCleaner.new(destination, specs_by_platform).clean!
192
193
  end
193
194
 
@@ -51,7 +51,6 @@ module Pod
51
51
  bin = `which #{executable}`.strip
52
52
  raise Informative, "Unable to locate the executable `#{executable}`" if bin.empty?
53
53
 
54
- require 'open4'
55
54
  require 'shellwords'
56
55
 
57
56
  command = command.map(&:to_s)
@@ -64,9 +63,8 @@ module Pod
64
63
  stdout, stderr = Indenter.new, Indenter.new
65
64
  end
66
65
 
67
- options = { :stdout => stdout, :stderr => stderr, :status => true }
68
- status = Open4.spawn(bin, command, options)
69
- output = stdout.join("\n") + stderr.join("\n")
66
+ status = popen3(bin, command, stdout, stderr)
67
+ output = stdout.join("\n") + stderr.join("\n")
70
68
  unless status.success?
71
69
  if raise_on_failure
72
70
  raise Informative, "#{full_command}\n\n#{output}"
@@ -77,6 +75,27 @@ module Pod
77
75
  output
78
76
  end
79
77
 
78
+ private
79
+
80
+ def self.popen3(bin, command, stdout, stderr)
81
+ require 'open3'
82
+ Open3.popen3(bin, *command) do |i, o, e, t|
83
+ out_reader = Thread.new { while s = o.gets; stdout << s; end }
84
+ err_reader = Thread.new { while s = e.gets; stderr << s; end }
85
+
86
+ i.close
87
+
88
+ run_readers = lambda do
89
+ [out_reader, err_reader].each do |reader|
90
+ reader.run if reader.alive?
91
+ end
92
+ end
93
+
94
+ run_readers.call
95
+ t.value.tap { run_readers.call }
96
+ end
97
+ end
98
+
80
99
  #-------------------------------------------------------------------------#
81
100
 
82
101
  # Helper class that allows to write to an {IO} instance taking into account
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the cocoapods command line tool.
3
3
  #
4
- VERSION = '0.37.0.beta.1' unless defined? Pod::VERSION
4
+ VERSION = '0.37.0.rc.1' unless defined? Pod::VERSION
5
5
  end
@@ -64,7 +64,7 @@ module Pod
64
64
  'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_paths, '-iquote'),
65
65
  }
66
66
  if target.pod_targets.any?(&:should_build?)
67
- build_settings['FRAMEWORK_SEARCH_PATHS'] = '"$PODS_FRAMEWORK_BUILD_PATH"'
67
+ build_settings['FRAMEWORK_SEARCH_PATHS'] = '$(inherited) "$PODS_FRAMEWORK_BUILD_PATH"'
68
68
  end
69
69
  config.merge!(build_settings)
70
70
  else
@@ -34,6 +34,7 @@ module Pod
34
34
  autoload :HooksContext, 'cocoapods/installer/hooks_context'
35
35
  autoload :Migrator, 'cocoapods/installer/migrator'
36
36
  autoload :PodSourceInstaller, 'cocoapods/installer/pod_source_installer'
37
+ autoload :PodSourcePreparer, 'cocoapods/installer/pod_source_preparer'
37
38
  autoload :PodTargetInstaller, 'cocoapods/installer/target_installer/pod_target_installer'
38
39
  autoload :TargetInstaller, 'cocoapods/installer/target_installer'
39
40
  autoload :UserProjectIntegrator, 'cocoapods/installer/user_project_integrator'
@@ -444,7 +445,15 @@ module Pod
444
445
  #
445
446
  def prepare_pods_project
446
447
  UI.message '- Creating Pods project' do
447
- @pods_project = Pod::Project.new(sandbox.project_path)
448
+ object_version = aggregate_targets.map(&:user_project_path).compact.map do |path|
449
+ Xcodeproj::Project.open(path).object_version.to_i
450
+ end.min
451
+
452
+ if object_version
453
+ @pods_project = Pod::Project.new(sandbox.project_path, false, object_version)
454
+ else
455
+ @pods_project = Pod::Project.new(sandbox.project_path)
456
+ end
448
457
 
449
458
  analysis_result.all_user_build_configurations.each do |name, type|
450
459
  @pods_project.add_build_configuration(name, type)
@@ -63,7 +63,7 @@ module Pod
63
63
  lockfile['SPEC CHECKSUMS'][spec.name] = Specification.from_file(child).checksum
64
64
  end
65
65
  sandbox.manifest = Lockfile.new(lockfile)
66
- File.open(sandbox.manifest_path, 'w') { |f| f.write sandbox.manifest.to_yaml }
66
+ sandbox.manifest.write_to_disk(sandbox.manifest_path)
67
67
  end
68
68
  end
69
69
 
@@ -43,7 +43,8 @@ module Pod
43
43
  #
44
44
  def install!
45
45
  download_source unless predownloaded? || local?
46
- run_prepare_command
46
+ PodSourcePreparer.new(root_spec, root).prepare! if local?
47
+ lock_files!
47
48
  end
48
49
 
49
50
  # Cleans the installations if appropriate.
@@ -89,25 +90,21 @@ module Pod
89
90
  )
90
91
  end
91
92
 
92
- extend Executable
93
- executable :bash
94
-
95
- # Runs the prepare command bash script of the spec.
96
- #
97
- # @note Unsets the `CDPATH` env variable before running the
98
- # shell script to avoid issues with relative paths
99
- # (issue #1694).
93
+ # Locks all of the files in this pod (source, license, etc). This will
94
+ # cause Xcode to warn you if you try to accidently edit one of the files.
100
95
  #
101
96
  # @return [void]
102
97
  #
103
- def run_prepare_command
104
- return unless root_spec.prepare_command
105
- UI.section(' > Running prepare command', '', 1) do
106
- Dir.chdir(root) do
107
- ENV.delete('CDPATH')
108
- prepare_command = root_spec.prepare_command.strip_heredoc.chomp
109
- full_command = "\nset -e\n" + prepare_command
110
- bash!('-c', full_command)
98
+ def lock_files!
99
+ if local?
100
+ return
101
+ end
102
+
103
+ # We don't want to lock diretories, as that forces you to override
104
+ # those permissions if you decide to delete the Pods folder.
105
+ Dir.glob(root + '**/*').each do |file|
106
+ unless File.directory?(file)
107
+ File.chmod(0444, file)
111
108
  end
112
109
  end
113
110
  end
@@ -0,0 +1,70 @@
1
+ module Pod
2
+ class Installer
3
+ # Controller class responsible of executing the prepare command
4
+ # of a single Pod.
5
+ #
6
+ class PodSourcePreparer
7
+ # @return [Specification] the root specification of the Pod.
8
+ #
9
+ attr_reader :spec
10
+
11
+ # @return [Pathname] the folder where the source of the Pod is located.
12
+ #
13
+ attr_reader :path
14
+
15
+ # @param [Specification] spec the root specification of the Pod.
16
+ # @param [Pathname] path the folder where the source of the Pod is located.
17
+ #
18
+ def initialize(spec, path)
19
+ raise "Given spec isn't a root spec, but must be." unless spec.root?
20
+ @spec = spec
21
+ @path = path
22
+ end
23
+
24
+ #-----------------------------------------------------------------------#
25
+
26
+ public
27
+
28
+ # @!group Preparation
29
+
30
+ # Executes the prepare command if there is one.
31
+ #
32
+ # @return [void]
33
+ #
34
+ def prepare!
35
+ run_prepare_command
36
+ end
37
+
38
+ #-----------------------------------------------------------------------#
39
+
40
+ private
41
+
42
+ # @!group Preparation Steps
43
+
44
+ extend Executable
45
+ executable :bash
46
+
47
+ # Runs the prepare command bash script of the spec.
48
+ #
49
+ # @note Unsets the `CDPATH` env variable before running the
50
+ # shell script to avoid issues with relative paths
51
+ # (issue #1694).
52
+ #
53
+ # @return [void]
54
+ #
55
+ def run_prepare_command
56
+ return unless spec.prepare_command
57
+ UI.section(' > Running prepare command', '', 1) do
58
+ Dir.chdir(path) do
59
+ ENV.delete('CDPATH')
60
+ prepare_command = spec.prepare_command.strip_heredoc.chomp
61
+ full_command = "\nset -e\n" + prepare_command
62
+ bash!('-c', full_command)
63
+ end
64
+ end
65
+ end
66
+
67
+ #-----------------------------------------------------------------------#
68
+ end
69
+ end
70
+ end
@@ -38,6 +38,8 @@ module Pod
38
38
 
39
39
  #-----------------------------------------------------------------------#
40
40
 
41
+ SOURCE_FILE_EXTENSIONS = Sandbox::FileAccessor::SOURCE_FILE_EXTENSIONS
42
+
41
43
  # Adds the build files of the pods to the target and adds a reference to
42
44
  # the frameworks of the Pods.
43
45
  #
@@ -53,7 +55,7 @@ module Pod
53
55
  headers = file_accessor.headers
54
56
  public_headers = file_accessor.public_headers
55
57
  private_headers = file_accessor.private_headers
56
- other_source_files = file_accessor.source_files.select { |sf| sf.extname == '.d' }
58
+ other_source_files = file_accessor.source_files.reject { |sf| SOURCE_FILE_EXTENSIONS.include?(sf.extname) }
57
59
 
58
60
  {
59
61
  true => file_accessor.arc_source_files,
@@ -154,6 +156,13 @@ module Pod
154
156
  native_target.build_configurations.each do |c|
155
157
  c.base_configuration_reference = xcconfig_file_ref
156
158
  end
159
+
160
+ # also apply the private config to resource targets
161
+ target.resource_bundle_targets.each do |rsrc_target|
162
+ rsrc_target.build_configurations.each do |rsrc_bc|
163
+ rsrc_bc.base_configuration_reference = xcconfig_file_ref
164
+ end
165
+ end
157
166
  end
158
167
 
159
168
  # Creates a prefix header file which imports `UIKit` or `Cocoa` according
@@ -10,9 +10,12 @@ module Pod
10
10
  # @param [Pathname, String] path @see path
11
11
  # @param [Bool] skip_initialization
12
12
  # Whether the project should be initialized from scratch.
13
+ # @param [Int] object_version
14
+ # Object version to use for serialization, defaults to Xcode 3.2 compatible.
13
15
  #
14
- def initialize(path, skip_initialization = false)
15
- super(path, skip_initialization)
16
+ def initialize(path, skip_initialization = false,
17
+ object_version = Xcodeproj::Constants::DEFAULT_OBJECT_VERSION)
18
+ super(path, skip_initialization, object_version)
16
19
  @support_files_group = new_group('Targets Support Files')
17
20
  @refs_by_absolute_path = {}
18
21
  @pods = new_group('Pods')
@@ -8,11 +8,12 @@ module Pod
8
8
  #
9
9
  class FileAccessor
10
10
  HEADER_EXTENSIONS = Xcodeproj::Constants::HEADER_FILES_EXTENSIONS
11
+ SOURCE_FILE_EXTENSIONS = (%w(.m .mm .c .cpp .swift) + HEADER_EXTENSIONS).uniq.freeze
11
12
 
12
13
  GLOB_PATTERNS = {
13
14
  :readme => 'readme{*,.*}'.freeze,
14
15
  :license => 'licen{c,s}e{*,.*}'.freeze,
15
- :source_files => '*.{h,hpp,tpp,hh,m,mm,c,cpp,swift}'.freeze,
16
+ :source_files => "*{#{SOURCE_FILE_EXTENSIONS.join(',')}}".freeze,
16
17
  :public_header_files => "*{#{HEADER_EXTENSIONS.join(',')}}".freeze,
17
18
  }.freeze
18
19
 
@@ -52,7 +52,9 @@ module Pod
52
52
  # A target should not be build if it has no source files.
53
53
  #
54
54
  def should_build?
55
- !file_accessors.flat_map(&:source_files).empty?
55
+ source_files = file_accessors.flat_map(&:source_files)
56
+ source_files -= file_accessors.flat_map(&:headers)
57
+ !source_files.empty?
56
58
  end
57
59
 
58
60
  # @return [Array<Specification::Consumer>] the specification consumers for
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: 0.37.0.beta.1
4
+ version: 0.37.0.rc.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: 2015-04-18 00:00:00.000000000 Z
14
+ date: 2015-04-27 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: 0.37.0.beta.1
22
+ version: 0.37.0.rc.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: 0.37.0.beta.1
29
+ version: 0.37.0.rc.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -47,14 +47,14 @@ dependencies:
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 0.24.0
50
+ version: 0.24.1
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: 0.24.0
57
+ version: 0.24.1
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: cocoapods-downloader
60
60
  requirement: !ruby/object:Gem::Requirement
@@ -153,20 +153,6 @@ dependencies:
153
153
  - - "~>"
154
154
  - !ruby/object:Gem::Version
155
155
  version: 0.0.4
156
- - !ruby/object:Gem::Dependency
157
- name: open4
158
- requirement: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - "~>"
161
- - !ruby/object:Gem::Version
162
- version: '1.3'
163
- type: :runtime
164
- prerelease: false
165
- version_requirements: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: '1.3'
170
156
  - !ruby/object:Gem::Dependency
171
157
  name: activesupport
172
158
  requirement: !ruby/object:Gem::Requirement
@@ -324,6 +310,7 @@ files:
324
310
  - lib/cocoapods/installer/hooks_context.rb
325
311
  - lib/cocoapods/installer/migrator.rb
326
312
  - lib/cocoapods/installer/pod_source_installer.rb
313
+ - lib/cocoapods/installer/pod_source_preparer.rb
327
314
  - lib/cocoapods/installer/target_installer.rb
328
315
  - lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
329
316
  - lib/cocoapods/installer/target_installer/pod_target_installer.rb