cocoapods 1.0.0.beta.5 → 1.0.0.beta.6

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: 351bd282c885de91d29ea0ce21df2f9fbebe22ad
4
- data.tar.gz: a2b17616d19c1cc6971232c77fde0e36c1c559e1
3
+ metadata.gz: 82ef0fd2f13afd200f730d294d1e85d7aac49aba
4
+ data.tar.gz: c2b830bfc6c0edb7dd4e8ed8ab40409126825420
5
5
  SHA512:
6
- metadata.gz: b165cefed02d0efd9088f9acfaad7ca9e92a07df8e827b655965a9a42eabbc25796bd716e5fc7fd28feb3975411d5b7b57904bb1b8cd5b67c6d8944057ba79a9
7
- data.tar.gz: 172057ccdbbba5eac50a33abb6d611d9f5409db97748e1fd36e348a8fbdea458101f534bfc4d4f0849f05e8a7cb9fc54dd4609dfff100525c8182f7fc9a0ef37
6
+ metadata.gz: e426d23e4284592fbdb93d1591d5a30d96b30dfc6b98b51a1da55476a0678075599892f82b9bf4d3d4885e5840f6d10efc986bcc52ba1e7d25889ccee0256b5f
7
+ data.tar.gz: 55d32672b07f933172d9e6cd3d90112a0fa4d0a863db32a3ea7747399312ffddc3ab6ee2b4df772a638d6abe12eee4aa84d48b2fef99755c9ea30cbebcecb068
@@ -4,15 +4,74 @@ 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.0.beta.6 (2016-03-15)
8
+
9
+ ##### Breaking
10
+
11
+ * Running `pod install` doesn't imply an automatic spec repo update.
12
+ The old behavior can be achieved by passing in the option `--repo-update`
13
+ or running `pod repo update`.
14
+ [Marius Rackwitz](https://github.com/mrackwitz)
15
+ [#5004](https://github.com/CocoaPods/CocoaPods/issues/5004)
16
+
17
+ * Remove the configuration variable `skip_repo_update` as the default behavior
18
+ varies now between `pod install` and `pod (update|outdated)`.
19
+ [Marius Rackwitz](https://github.com/mrackwitz)
20
+ [#5017](https://github.com/CocoaPods/CocoaPods/issues/5017)
21
+
22
+ ##### Enhancements
23
+
24
+ * The master specs repo will no longer perform 'no-op' git fetches. This should
25
+ help to reduce the load on GitHub's servers.
26
+ [Daniel Tomlinson](https://github.com/DanielTomlinson)
27
+ [#5005](https://github.com/CocoaPods/CocoaPods/issues/5005)
28
+ [#4989](https://github.com/CocoaPods/CocoaPods/issues/4989)
29
+
30
+ * The specs repos will no longer support shallow clones to reduce CPU load
31
+ on git servers. Pre-existing shallow clones of the `master` repo will
32
+ automatically be upgraded to deep clones when the repo is updated.
33
+ [Samuel Giddins](https://github.com/segiddins)
34
+ [#5016](https://github.com/CocoaPods/CocoaPods/issues/5016)
35
+
36
+ * The validator will check that all `public_header_files` and
37
+ `private_header_files` are also present in `source_files`.
38
+ [Samuel Giddins](https://github.com/segiddins)
39
+ [#4936](https://github.com/CocoaPods/CocoaPods/issues/4936)
40
+
41
+ ##### Bug Fixes
42
+
43
+ * The master specs repository can no longer be added via `pod repo add`, but
44
+ instead must be done via `pod setup`.
45
+ [Samuel Giddins](https://github.com/segiddins)
46
+
47
+ * Print a friendly error message when the platform for a target cannot be
48
+ inferred.
49
+ [Samuel Giddins](https://github.com/segiddins)
50
+ [#4790](https://github.com/CocoaPods/CocoaPods/issues/4790)
51
+
52
+ * Rely on `TARGET_BUILD_DIR` instead of `CONFIGURATION_BUILD_DIR` in the
53
+ generated embed frameworks build phase's script, so that UI test targets can
54
+ be run.
55
+ [Marius Rackwitz](https://github.com/mrackwitz)
56
+ [#5022](https://github.com/CocoaPods/CocoaPods/issues/5022)
57
+
58
+ * Fix build paths for resources bundles.
59
+ [Marius Rackwitz](https://github.com/mrackwitz)
60
+ [#5028](https://github.com/CocoaPods/CocoaPods/pull/5028)
61
+
62
+ * Validate that a Podfile does not declare the same target twice.
63
+ [Samuel Giddins](https://github.com/segiddins)
64
+ [#5029](https://github.com/CocoaPods/CocoaPods/issues/5029)
65
+
66
+
7
67
  ## 1.0.0.beta.5 (2016-03-08)
8
68
 
9
69
  ##### Breaking
10
70
 
11
- * Development pods will no longer be implicitly unlocked. This makes CocoaPods
12
- to respect constraints related to dependencies of development pods in the
13
- lockfile.
71
+ * Development pods will no longer be implicitly unlocked. This makes CocoaPods respect
72
+ constraints related to dependencies of development pods in the lockfile.
14
73
 
15
- If you change constraints of a dependency of your development pod, and want to
74
+ If you change the constraints of a dependency of your development pod and want to
16
75
  override the locked version, you will have to use
17
76
  `pod update ${DEPENDENCY_NAME}` manually.
18
77
  [Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
@@ -14,17 +14,22 @@ module Pod
14
14
  end
15
15
 
16
16
  class Command < CLAide::Command
17
+ require 'cocoapods/command/options/repo_update'
18
+ require 'cocoapods/command/options/project_directory'
19
+ include Options
20
+
21
+ require 'cocoapods/command/cache'
22
+ require 'cocoapods/command/env'
23
+ require 'cocoapods/command/init'
24
+ require 'cocoapods/command/install'
17
25
  require 'cocoapods/command/inter_process_communication'
18
26
  require 'cocoapods/command/lib'
19
27
  require 'cocoapods/command/list'
20
28
  require 'cocoapods/command/outdated'
21
- require 'cocoapods/command/project'
22
29
  require 'cocoapods/command/repo'
23
30
  require 'cocoapods/command/setup'
24
31
  require 'cocoapods/command/spec'
25
- require 'cocoapods/command/init'
26
- require 'cocoapods/command/cache'
27
- require 'cocoapods/command/env'
32
+ require 'cocoapods/command/update'
28
33
 
29
34
  self.abstract_command = true
30
35
  self.command = 'pod'
@@ -32,9 +37,6 @@ module Pod
32
37
  self.description = 'CocoaPods, the Cocoa library package manager.'
33
38
  self.plugin_prefixes = %w(claide cocoapods)
34
39
 
35
- [Install, Update, Outdated, IPC::Podfile, IPC::Repl].each { |c| c.send(:include, ProjectDirectory) }
36
- [Outdated].each { |c| c.send(:include, Project) }
37
-
38
40
  def self.options
39
41
  [
40
42
  ['--silent', 'Show nothing'],
@@ -102,6 +104,14 @@ module Pod
102
104
 
103
105
  private
104
106
 
107
+ # Returns a new {Installer} parametrized from the {Config}.
108
+ #
109
+ # @return [Installer]
110
+ #
111
+ def installer_for_config
112
+ Installer.new(config.sandbox, config.podfile, config.lockfile)
113
+ end
114
+
105
115
  # Checks that the podfile exists.
106
116
  #
107
117
  # @raise If the podfile does not exists.
@@ -0,0 +1,41 @@
1
+ module Pod
2
+ class Command
3
+ class Install < Command
4
+ include RepoUpdate
5
+ include ProjectDirectory
6
+
7
+ self.summary = 'Install project dependencies to Podfile.lock versions'
8
+
9
+ self.description = <<-DESC
10
+ Downloads all dependencies defined in `Podfile` and creates an Xcode
11
+ Pods library project in `./Pods`.
12
+
13
+ The Xcode project file should be specified in your `Podfile` like this:
14
+
15
+ project 'path/to/XcodeProject.xcodeproj'
16
+
17
+ If no project is specified, then a search for an Xcode project will
18
+ be made. If more than one Xcode project is found, the command will
19
+ raise an error.
20
+
21
+ This will configure the project to reference the Pods static library,
22
+ add a build configuration file, and add a post build script to copy
23
+ Pod resources.
24
+ DESC
25
+
26
+ def self.options
27
+ [
28
+ ['--repo-update', 'Force running `pod repo update` before install'],
29
+ ].concat(super).reject { |(name, _)| name == '--no-repo-update' }
30
+ end
31
+
32
+ def run
33
+ verify_podfile_exists!
34
+ installer = installer_for_config
35
+ installer.repo_update = repo_update?(:default => false)
36
+ installer.update = false
37
+ installer.install!
38
+ end
39
+ end
40
+ end
41
+ end
@@ -37,6 +37,8 @@ module Pod
37
37
  #-----------------------------------------------------------------------#
38
38
 
39
39
  class Podfile < IPC
40
+ include ProjectDirectory
41
+
40
42
  self.summary = 'Converts a Podfile to YAML'
41
43
  self.description = 'Converts a Podfile to YAML and prints it to STDOUT.'
42
44
  self.arguments = [
@@ -123,6 +125,8 @@ module Pod
123
125
  #-----------------------------------------------------------------------#
124
126
 
125
127
  class Repl < IPC
128
+ include ProjectDirectory
129
+
126
130
  END_OF_OUTPUT_SIGNAL = "\n\r"
127
131
 
128
132
  self.summary = 'The repl listens to commands on standard input'
@@ -0,0 +1,36 @@
1
+ module Pod
2
+ class Command
3
+ module Options
4
+ # Provides support for commands to take a user-specified `project directory`
5
+ #
6
+ module ProjectDirectory
7
+ module Options
8
+ def options
9
+ [
10
+ ['--project-directory=/project/dir/', 'The path to the root of the project directory'],
11
+ ].concat(super)
12
+ end
13
+ end
14
+
15
+ def self.included(base)
16
+ base.extend(Options)
17
+ end
18
+
19
+ def initialize(argv)
20
+ if project_directory = argv.option('project-directory')
21
+ @project_directory = Pathname.new(project_directory).expand_path
22
+ end
23
+ config.installation_root = @project_directory
24
+ super
25
+ end
26
+
27
+ def validate!
28
+ super
29
+ if @project_directory && !@project_directory.directory?
30
+ raise Informative, "`#{@project_directory}` is not a valid directory."
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,34 @@
1
+ module Pod
2
+ class Command
3
+ module Options
4
+ # Provides support for commands to skip updating the spec repositories.
5
+ #
6
+ module RepoUpdate
7
+ module Options
8
+ def options
9
+ [
10
+ ['--no-repo-update', 'Skip running `pod repo update` before install'],
11
+ ].concat(super)
12
+ end
13
+ end
14
+
15
+ def self.included(base)
16
+ base.extend(Options)
17
+ end
18
+
19
+ def repo_update?(default: false)
20
+ if @repo_update.nil?
21
+ default
22
+ else
23
+ @repo_update
24
+ end
25
+ end
26
+
27
+ def initialize(argv)
28
+ @repo_update = argv.flag?('repo-update')
29
+ super
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,6 +1,9 @@
1
1
  module Pod
2
2
  class Command
3
3
  class Outdated < Command
4
+ include RepoUpdate
5
+ include ProjectDirectory
6
+
4
7
  self.summary = 'Show outdated project dependencies'
5
8
 
6
9
  self.description = <<-DESC
@@ -90,8 +93,8 @@ module Pod
90
93
 
91
94
  def spec_sets
92
95
  @spec_sets ||= begin
93
- analyzer.send(:update_repositories) unless config.skip_repo_update?
94
- aggregate = Source::Aggregate.new(analyzer.sources.map(&:repo))
96
+ analyzer.send(:update_repositories) if repo_update?(:default => true)
97
+ aggregate = Source::Aggregate.new(analyzer.sources)
95
98
  installed_pods.map do |pod_name|
96
99
  aggregate.search(Dependency.new(pod_name))
97
100
  end.compact.uniq
@@ -15,14 +15,7 @@ module Pod
15
15
  CLAide::Argument.new('BRANCH', false),
16
16
  ]
17
17
 
18
- def self.options
19
- [
20
- ['--shallow', 'Create a shallow clone (fast clone, but no push capabilities)'],
21
- ].concat(super)
22
- end
23
-
24
18
  def initialize(argv)
25
- @shallow = argv.flag?('shallow', false)
26
19
  @name = argv.shift_argument
27
20
  @url = argv.shift_argument
28
21
  @branch = argv.shift_argument
@@ -34,11 +27,16 @@ module Pod
34
27
  unless @name && @url
35
28
  help! 'Adding a repo needs a `NAME` and a `URL`.'
36
29
  end
30
+ if @name == 'master' || @url =~ %r{github.com[:/]+cocoapods/specs}i
31
+ raise Informative,
32
+ 'To setup the master specs repo, please run `pod setup`.'
33
+ end
37
34
  end
38
35
 
39
36
  def run
40
- prefix = @shallow ? 'Creating shallow clone of' : 'Cloning'
41
- UI.section("#{prefix} spec repo `#{@name}` from `#{@url}`#{" (branch `#{@branch}`)" if @branch}") do
37
+ section = "Cloning spec repo `#{@name}` from `#{@url}`"
38
+ section << " (branch `#{@branch}`)" if @branch
39
+ UI.section(section) do
42
40
  create_repos_dir
43
41
  clone_repo
44
42
  checkout_branch
@@ -70,7 +68,6 @@ module Pod
70
68
  def clone_repo
71
69
  Dir.chdir(config.repos_dir) do
72
70
  command = ['clone', @url, @name]
73
- command << '--depth=1' if @shallow
74
71
  git!(command)
75
72
  end
76
73
  end
@@ -14,20 +14,9 @@ module Pod
14
14
  If the clone already exists, it will ensure that it is up-to-date.
15
15
  DESC
16
16
 
17
- def self.options
18
- [
19
- ['--no-shallow', 'Clone full history so push will work'],
20
- ].concat(super)
21
- end
22
-
23
17
  extend Executable
24
18
  executable :git
25
19
 
26
- def initialize(argv)
27
- @shallow = argv.flag?('shallow', true)
28
- super
29
- end
30
-
31
20
  def run
32
21
  UI.section 'Setting up CocoaPods master repo' do
33
22
  if master_repo_dir.exist?
@@ -62,7 +51,6 @@ module Pod
62
51
  #
63
52
  def add_master_repo
64
53
  cmd = ['master', url, 'master']
65
- cmd << '--shallow' if @shallow
66
54
  Repo::Add.parse(cmd).run
67
55
  end
68
56
 
@@ -0,0 +1,64 @@
1
+ module Pod
2
+ class Command
3
+ class Update < Command
4
+ include RepoUpdate
5
+ include ProjectDirectory
6
+
7
+ self.summary = 'Update outdated project dependencies and create new ' \
8
+ 'Podfile.lock'
9
+
10
+ self.description = <<-DESC
11
+ Updates the Pods identified by the specified `POD_NAMES`. If no
12
+ `POD_NAMES` are specified it updates all the Pods ignoring the contents
13
+ of the Podfile.lock.
14
+ This command is reserved to the update of dependencies and pod install
15
+ should be used to install changes to the Podfile.
16
+ DESC
17
+
18
+ self.arguments = [
19
+ CLAide::Argument.new('POD_NAMES', false, true),
20
+ ]
21
+
22
+ def initialize(argv)
23
+ @pods = argv.arguments! unless argv.arguments.empty?
24
+ super
25
+ end
26
+
27
+ # Check if all given pods are installed
28
+ #
29
+ def verify_pods_are_installed!
30
+ lockfile_roots = config.lockfile.pod_names.map { |p| Specification.root_name(p) }
31
+ missing_pods = @pods.map { |p| Specification.root_name(p) }.select do |pod|
32
+ !lockfile_roots.include?(pod)
33
+ end
34
+
35
+ unless missing_pods.empty?
36
+ message = if missing_pods.length > 1
37
+ "Pods `#{missing_pods.join('`, `')}` are not " \
38
+ 'installed and cannot be updated'
39
+ else
40
+ "The `#{missing_pods.first}` Pod is not installed " \
41
+ 'and cannot be updated'
42
+ end
43
+ raise Informative, message
44
+ end
45
+ end
46
+
47
+ def run
48
+ verify_podfile_exists!
49
+
50
+ installer = installer_for_config
51
+ installer.repo_update = repo_update?(:default => true)
52
+ if @pods
53
+ verify_lockfile_exists!
54
+ verify_pods_are_installed!
55
+ installer.update = { :pods => @pods }
56
+ else
57
+ UI.puts 'Update all pods'.yellow
58
+ installer.update = true
59
+ end
60
+ installer.install!
61
+ end
62
+ end
63
+ end
64
+ end
@@ -14,7 +14,6 @@ module Pod
14
14
  DEFAULTS = {
15
15
  :verbose => false,
16
16
  :silent => false,
17
- :skip_repo_update => false,
18
17
  :skip_download_cache => !ENV['COCOAPODS_SKIP_CACHE'].nil?,
19
18
 
20
19
  :new_version_message => ENV['COCOAPODS_SKIP_UPDATE_MESSAGE'].nil?,
@@ -69,11 +68,6 @@ module Pod
69
68
 
70
69
  # @!group Installation
71
70
 
72
- # @return [Bool] Whether the installer should skip the repos update.
73
- #
74
- attr_accessor :skip_repo_update
75
- alias_method :skip_repo_update?, :skip_repo_update
76
-
77
71
  # @return [Bool] Whether the installer should skip the download cache.
78
72
  #
79
73
  attr_accessor :skip_download_cache
@@ -137,9 +137,9 @@ module Pod
137
137
  case capture
138
138
  when :merge then Open3.capture2e(bin, *command)
139
139
  when :both then Open3.capture3(bin, *command)
140
- when :out then Open3.capture2(bin, *command)
140
+ when :out then Open3.capture3(bin, *command).values_at(0, -1)
141
141
  when :err then Open3.capture3(bin, *command).drop(1)
142
- when :none then Open3.capture2(bin, *command).last
142
+ when :none then Open3.capture3(bin, *command).last
143
143
  end
144
144
  end
145
145
 
@@ -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.beta.5'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.0.0.beta.6'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -53,7 +53,7 @@ module Pod
53
53
  local source="$1"
54
54
  fi
55
55
 
56
- local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
56
+ local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
57
57
 
58
58
  if [ -L "${source}" ]; then
59
59
  echo "Symlinked..."
@@ -84,6 +84,11 @@ module Pod
84
84
  #
85
85
  attr_accessor :update
86
86
 
87
+ # @return [Bool] Whether the spec repos should be updated.
88
+ #
89
+ attr_accessor :repo_update
90
+ alias_method :repo_update?, :repo_update
91
+
87
92
  # @return [Boolean] Whether default plugins should be used during
88
93
  # installation. Defaults to true.
89
94
  #
@@ -140,7 +145,7 @@ module Pod
140
145
 
141
146
  UI.section 'Updating local specs repositories' do
142
147
  analyzer.update_repositories
143
- end unless config.skip_repo_update?
148
+ end if repo_update?
144
149
 
145
150
  UI.section 'Analyzing dependencies' do
146
151
  analyze(analyzer)
@@ -212,7 +212,7 @@ module Pod
212
212
 
213
213
  public
214
214
 
215
- # Updates the git source repositories unless the config indicates to skip it.
215
+ # Updates the git source repositories.
216
216
  #
217
217
  def update_repositories
218
218
  sources.each do |source|
@@ -153,6 +153,11 @@ module Pod
153
153
  end
154
154
  end
155
155
 
156
+ unless name
157
+ raise Informative,
158
+ "Unable to determine the platform for the `#{target_definition.name}` target."
159
+ end
160
+
156
161
  target_definition.set_platform(name, deployment_target)
157
162
  Platform.new(name, deployment_target)
158
163
  end
@@ -34,6 +34,7 @@ module Pod
34
34
  validate_pod_directives
35
35
  validate_no_abstract_only_pods!
36
36
  validate_dependencies_are_present!
37
+ validate_no_duplicate_targets!
37
38
 
38
39
  @validated = true
39
40
  end
@@ -122,6 +123,16 @@ module Pod
122
123
  add_error "The dependency `#{dep}` is not used in any concrete target."
123
124
  end
124
125
  end
126
+
127
+ def validate_no_duplicate_targets!
128
+ podfile.target_definition_list.group_by { |td| [td.name, td.user_project_path] }.
129
+ each do |(name, project), definitions|
130
+ next unless definitions.size > 1
131
+ error = "The target `#{name}` is declared twice"
132
+ error << " for the project `#{project}`" if project
133
+ add_error(error << '.')
134
+ end
135
+ end
125
136
  end
126
137
  end
127
138
  end
@@ -154,7 +154,7 @@ module Pod
154
154
  end
155
155
  frameworks_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
156
156
  frameworks = pod_target.file_accessors.flat_map(&:vendored_dynamic_artifacts).map { |fw| "${PODS_ROOT}/#{fw.relative_path_from(sandbox.root)}" }
157
- frameworks << pod_target.build_product_path if pod_target.should_build? && pod_target.requires_frameworks?
157
+ frameworks << pod_target.build_product_path('$BUILT_PRODUCTS_DIR') if pod_target.should_build? && pod_target.requires_frameworks?
158
158
  frameworks
159
159
  end
160
160
  end
@@ -177,9 +177,7 @@ module Pod
177
177
  c.build_settings['PRODUCT_NAME'] = bundle_name
178
178
  relative_info_plist_path = info_plist_path.relative_path_from(sandbox.root)
179
179
  c.build_settings['INFOPLIST_FILE'] = relative_info_plist_path.to_s
180
- if target.requires_frameworks? && target.scoped?
181
- c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir
182
- end
180
+ c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir
183
181
 
184
182
  # Set the correct device family for this bundle, based on the platform
185
183
  device_family_by_platform = {
@@ -352,7 +352,7 @@ module Pod
352
352
  if dependency && dependency.podspec_repo
353
353
  return SourcesManager.aggregate_for_dependency(dependency)
354
354
  else
355
- @aggregate ||= Source::Aggregate.new(sources.map(&:repo))
355
+ @aggregate ||= Source::Aggregate.new(sources)
356
356
  end
357
357
  end
358
358
 
@@ -41,7 +41,7 @@ module Pod
41
41
  #
42
42
  def sources(names)
43
43
  dirs = names.map { |name| source_dir(name) }
44
- dirs.map { |repo| Source.new(repo) }
44
+ dirs.map { |repo| source_from_path(repo) }
45
45
  end
46
46
 
47
47
  # Returns the source whose {Source#url} is equal to `url`, adding the repo
@@ -61,9 +61,11 @@ module Pod
61
61
  previous_title_level = UI.title_level
62
62
  UI.title_level = 0
63
63
  begin
64
- argv = [name, url]
65
- argv << '--shallow' if name =~ /^master(-\d+)?$/
66
- Command::Repo::Add.new(CLAide::ARGV.new(argv)).run
64
+ if name =~ /^master(-\d+)?$/
65
+ Command::Setup.parse([]).run
66
+ else
67
+ Command::Repo::Add.parse([name, url]).run
68
+ end
67
69
  rescue Informative
68
70
  raise Informative, "Unable to add a source with url `#{url}` " \
69
71
  "named `#{name}`.\nYou can try adding it manually in " \
@@ -97,7 +99,7 @@ module Pod
97
99
  def all
98
100
  return [] unless config.repos_dir.exist?
99
101
  dirs = config.repos_dir.children.select(&:directory?)
100
- dirs.map { |repo| Source.new(repo) }
102
+ dirs.map { |repo| source_from_path(repo) }
101
103
  end
102
104
 
103
105
  # @return [Array<Source>] The CocoaPods Master Repo source.
@@ -323,7 +325,7 @@ module Pod
323
325
  changed_spec_paths = {}
324
326
  sources.each do |source|
325
327
  UI.section "Updating spec repo `#{source.name}`" do
326
- changed_source_paths = source.update(show_output && !config.verbose?)
328
+ changed_source_paths = source.update(show_output)
327
329
  changed_spec_paths[source] = changed_source_paths if changed_source_paths.count > 0
328
330
  check_version_information(source.repo)
329
331
  end
@@ -468,14 +470,25 @@ module Pod
468
470
 
469
471
  private
470
472
 
473
+ # @return [Source] The Source at a given path.
474
+ #
475
+ # @param [Pathname] path
476
+ # The local file path to one podspec repo.
477
+ #
478
+ def source_from_path(path)
479
+ return Source.new(path) unless path.basename.to_s == 'master'
480
+ MasterSource.new(path)
481
+ end
482
+
471
483
  # @return [Source::Aggregate] The aggregate of the sources from repos.
472
484
  #
473
485
  # @param [Array<Pathname>] repos
474
486
  # The local file paths to one or more podspec repo caches.
475
487
  #
476
488
  def aggregate_with_repos(repos)
489
+ sources = repos.map { |path| source_from_path(path) }
477
490
  @aggregates_by_repos ||= {}
478
- @aggregates_by_repos[repos] ||= Source::Aggregate.new(repos)
491
+ @aggregates_by_repos[repos] ||= Source::Aggregate.new(sources)
479
492
  end
480
493
 
481
494
  # @return [Bool] Whether the given path is writable by the current user.
@@ -609,9 +622,15 @@ module Pod
609
622
  extend Executable
610
623
  executable :git
611
624
 
625
+ def git(args, include_error: false)
626
+ Executable.capture_command('git', args, :capture => include_error ? :merge : :out).first.strip
627
+ end
628
+
612
629
  def update_git_repo(show_output = false)
613
- output = git! %w(pull --ff-only)
614
- UI.puts output if show_output
630
+ ensure_in_repo!
631
+ Config.instance.with_changes(:verbose => show_output) do
632
+ git!(%w(pull --ff-only))
633
+ end
615
634
  rescue
616
635
  UI.warn 'CocoaPods was not able to update the ' \
617
636
  "`#{name}` repo. If this is an unexpected issue " \
@@ -619,4 +638,16 @@ module Pod
619
638
  '`pod repo update --verbose`'
620
639
  end
621
640
  end
641
+
642
+ class MasterSource
643
+ def update_git_repo(show_output = false)
644
+ ensure_in_repo!
645
+ if repo.join('.git', 'shallow').file?
646
+ UI.info "Performing a deep fetch of the `#{name}` specs repo to improve future performance" do
647
+ git!(%w(fetch --unshallow))
648
+ end
649
+ end
650
+ super
651
+ end
652
+ end
622
653
  end
@@ -16,26 +16,10 @@ module Pod
16
16
  #
17
17
  attr_reader :build_headers
18
18
 
19
- # @return [Bool] whether the target needs to be scoped by target definition,
20
- # because the spec is used with different subspec sets across them.
21
- #
22
- # @note The target products of {PodTarget}s are named after their specs.
23
- # The namespacing cannot directly happen in the product name itself,
24
- # because this must be equal to the module name and this will be
25
- # used in source code, which should stay agnostic over the
26
- # dependency manager.
27
- # We need namespacing because multiple targets can exist for the
28
- # same podspec and their products should not collide. This
29
- # duplication is needed when multiple user targets have the same
30
- # dependency, but they require different sets of subspecs or they
31
- # are on different platforms.
32
- #
33
- def scoped?
34
- !scope_suffix.nil?
35
- end
36
-
37
- # @return [String] used for the label and the directory name, which is used to
38
- # scope the build product in the default configuration build dir.
19
+ # @return [String] used as suffix in the label
20
+ #
21
+ # @note This affects the value returned by #configuration_build_dir
22
+ # and accessors relying on this as #build_product_path.
39
23
  #
40
24
  attr_reader :scope_suffix
41
25
 
@@ -44,10 +28,10 @@ module Pod
44
28
  #
45
29
  attr_accessor :dependent_targets
46
30
 
47
- # @param [Array<Specification>] @spec #see spec
48
- # @param [Array<TargetDefinition>] target_definitions @see target_definitions
49
- # @param [Sandbox] sandbox @see sandbox
50
- # @param [String] scope_suffix @see scope_suffix
31
+ # @param [Array<Specification>] specs @see #specs
32
+ # @param [Array<TargetDefinition>] target_definitions @see #target_definitions
33
+ # @param [Sandbox] sandbox @see #sandbox
34
+ # @param [String] scope_suffix @see #scope_suffix
51
35
  #
52
36
  def initialize(specs, target_definitions, sandbox, scope_suffix = nil)
53
37
  raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
@@ -89,14 +73,10 @@ module Pod
89
73
  # @return [String] the label for the target.
90
74
  #
91
75
  def label
92
- if scoped?
93
- if scope_suffix[0] == '.'
94
- "#{root_spec.name}#{scope_suffix}"
95
- else
96
- "#{root_spec.name}-#{scope_suffix}"
97
- end
76
+ if scope_suffix.nil? || scope_suffix[0] == '.'
77
+ "#{root_spec.name}#{scope_suffix}"
98
78
  else
99
- root_spec.name
79
+ "#{root_spec.name}-#{scope_suffix}"
100
80
  end
101
81
  end
102
82
 
@@ -349,7 +349,6 @@ module Pod
349
349
  @original_config = Config.instance.clone
350
350
  config.installation_root = validation_dir
351
351
  config.silent = !config.verbose
352
- config.skip_repo_update = true
353
352
  end
354
353
 
355
354
  def tear_down_validation_environment
@@ -560,12 +559,18 @@ module Pod
560
559
  # Ensures that a list of header files only contains header files.
561
560
  #
562
561
  def _validate_header_files(attr_name)
563
- non_header_files = file_accessor.send(attr_name).
562
+ header_files = file_accessor.send(attr_name)
563
+ non_header_files = header_files.
564
564
  select { |f| !Sandbox::FileAccessor::HEADER_EXTENSIONS.include?(f.extname) }.
565
565
  map { |f| f.relative_path_from(file_accessor.root) }
566
566
  unless non_header_files.empty?
567
567
  error(attr_name, "The pattern matches non-header files (#{non_header_files.join(', ')}).")
568
568
  end
569
+ non_source_files = header_files - file_accessor.source_files
570
+ unless non_source_files.empty?
571
+ error(attr_name, 'The pattern includes header files that are not listed' \
572
+ "in source_files (#{non_source_files.join(', ')}).")
573
+ end
569
574
  end
570
575
 
571
576
  def _validate_header_mappings_dir
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.beta.5
4
+ version: 1.0.0.beta.6
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-03-07 00:00:00.000000000 Z
14
+ date: 2016-03-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods-core
@@ -19,21 +19,21 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.0.beta.5
22
+ version: 1.0.0.beta.6
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.beta.5
29
+ version: 1.0.0.beta.6
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '>='
35
35
  - !ruby/object:Gem::Version
36
- version: 1.0.0.beta.2
36
+ version: 1.0.0.beta.3
37
37
  - - <
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.0'
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - '>='
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.0.beta.2
46
+ version: 1.0.0.beta.3
47
47
  - - <
48
48
  - !ruby/object:Gem::Version
49
49
  version: '2.0'
@@ -73,7 +73,7 @@ dependencies:
73
73
  requirements:
74
74
  - - '>='
75
75
  - !ruby/object:Gem::Version
76
- version: 1.0.0.beta.1
76
+ version: 1.0.0.beta.2
77
77
  - - <
78
78
  - !ruby/object:Gem::Version
79
79
  version: '2.0'
@@ -83,7 +83,7 @@ dependencies:
83
83
  requirements:
84
84
  - - '>='
85
85
  - !ruby/object:Gem::Version
86
- version: 1.0.0.beta.1
86
+ version: 1.0.0.beta.2
87
87
  - - <
88
88
  - !ruby/object:Gem::Version
89
89
  version: '2.0'
@@ -173,7 +173,7 @@ dependencies:
173
173
  requirements:
174
174
  - - '>='
175
175
  - !ruby/object:Gem::Version
176
- version: 1.0.0.beta.2
176
+ version: 1.0.0.beta.3
177
177
  - - <
178
178
  - !ruby/object:Gem::Version
179
179
  version: '2.0'
@@ -183,7 +183,7 @@ dependencies:
183
183
  requirements:
184
184
  - - '>='
185
185
  - !ruby/object:Gem::Version
186
- version: 1.0.0.beta.2
186
+ version: 1.0.0.beta.3
187
187
  - - <
188
188
  - !ruby/object:Gem::Version
189
189
  version: '2.0'
@@ -362,11 +362,13 @@ files:
362
362
  - lib/cocoapods/command/cache/list.rb
363
363
  - lib/cocoapods/command/env.rb
364
364
  - lib/cocoapods/command/init.rb
365
+ - lib/cocoapods/command/install.rb
365
366
  - lib/cocoapods/command/inter_process_communication.rb
366
367
  - lib/cocoapods/command/lib.rb
367
368
  - lib/cocoapods/command/list.rb
369
+ - lib/cocoapods/command/options/project_directory.rb
370
+ - lib/cocoapods/command/options/repo_update.rb
368
371
  - lib/cocoapods/command/outdated.rb
369
- - lib/cocoapods/command/project.rb
370
372
  - lib/cocoapods/command/repo.rb
371
373
  - lib/cocoapods/command/repo/add.rb
372
374
  - lib/cocoapods/command/repo/lint.rb
@@ -382,6 +384,7 @@ files:
382
384
  - lib/cocoapods/command/spec/env_spec.rb
383
385
  - lib/cocoapods/command/spec/lint.rb
384
386
  - lib/cocoapods/command/spec/which.rb
387
+ - lib/cocoapods/command/update.rb
385
388
  - lib/cocoapods/config.rb
386
389
  - lib/cocoapods/downloader.rb
387
390
  - lib/cocoapods/downloader/cache.rb
@@ -473,7 +476,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
476
  version: '0'
474
477
  requirements: []
475
478
  rubyforge_project:
476
- rubygems_version: 2.6.1
479
+ rubygems_version: 2.6.2
477
480
  signing_key:
478
481
  specification_version: 3
479
482
  summary: The Cocoa library package manager.
@@ -1,157 +0,0 @@
1
- module Pod
2
- class Command
3
- # Provides support for commands to take a user-specified `project directory`
4
- #
5
- module ProjectDirectory
6
- module Options
7
- def options
8
- [
9
- ['--project-directory=/project/dir/', 'The path to the root of the project directory'],
10
- ].concat(super)
11
- end
12
- end
13
-
14
- def self.included(base)
15
- base.extend(Options)
16
- end
17
-
18
- def initialize(argv)
19
- if project_directory = argv.option('project-directory')
20
- @project_directory = Pathname.new(project_directory).expand_path
21
- end
22
- config.installation_root = @project_directory
23
- super
24
- end
25
-
26
- def validate!
27
- super
28
- if @project_directory && !@project_directory.directory?
29
- raise Informative,
30
- "`#{@project_directory}` is not a valid directory."
31
- end
32
- end
33
- end
34
-
35
- # Provides support for the common behaviour of the `install` and `update`
36
- # commands.
37
- #
38
- module Project
39
- module Options
40
- def options
41
- [
42
- ['--no-repo-update', 'Skip running `pod repo update` before install'],
43
- ].concat(super)
44
- end
45
- end
46
-
47
- def self.included(base)
48
- base.extend Options
49
- end
50
-
51
- def initialize(argv)
52
- config.skip_repo_update = !argv.flag?('repo-update', !config.skip_repo_update)
53
- super
54
- end
55
-
56
- # Runs the installer.
57
- #
58
- # @param [Hash, Boolean, nil] update
59
- # Pods that have been requested to be updated or true if all Pods
60
- # should be updated
61
- #
62
- # @return [void]
63
- #
64
- def run_install_with_update(update)
65
- installer = Installer.new(config.sandbox, config.podfile, config.lockfile)
66
- installer.update = update
67
- installer.install!
68
- end
69
- end
70
-
71
- #-------------------------------------------------------------------------#
72
-
73
- class Install < Command
74
- include Project
75
-
76
- self.summary = 'Install project dependencies to Podfile.lock versions'
77
-
78
- self.description = <<-DESC
79
- Downloads all dependencies defined in `Podfile` and creates an Xcode
80
- Pods library project in `./Pods`.
81
-
82
- The Xcode project file should be specified in your `Podfile` like this:
83
-
84
- project 'path/to/XcodeProject'
85
-
86
- If no project is specified, then a search for an Xcode project will
87
- be made. If more than one Xcode project is found, the command will
88
- raise an error.
89
-
90
- This will configure the project to reference the Pods static library,
91
- add a build configuration file, and add a post build script to copy
92
- Pod resources.
93
- DESC
94
-
95
- def run
96
- verify_podfile_exists!
97
- run_install_with_update(false)
98
- end
99
- end
100
-
101
- #-------------------------------------------------------------------------#
102
-
103
- class Update < Command
104
- include Project
105
-
106
- self.summary = 'Update outdated project dependencies and create new ' \
107
- 'Podfile.lock'
108
-
109
- self.description = <<-DESC
110
- Updates the Pods identified by the specified `POD_NAMES`. If no
111
- `POD_NAMES` are specified it updates all the Pods ignoring the contents
112
- of the Podfile.lock.
113
- This command is reserved to the update of dependencies and pod install
114
- should be used to install changes to the Podfile.
115
- DESC
116
-
117
- self.arguments = [
118
- CLAide::Argument.new('POD_NAMES', false, true),
119
- ]
120
-
121
- def initialize(argv)
122
- @pods = argv.arguments! unless argv.arguments.empty?
123
- super
124
- end
125
-
126
- def run
127
- verify_podfile_exists!
128
-
129
- if @pods
130
- verify_lockfile_exists!
131
-
132
- # Check if all given pods are installed
133
- lockfile_roots = config.lockfile.pod_names.map { |p| Specification.root_name(p) }
134
- missing_pods = @pods.map { |p| Specification.root_name(p) }.select do |pod|
135
- !lockfile_roots.include?(pod)
136
- end
137
-
138
- unless missing_pods.empty?
139
- message = if missing_pods.length > 1
140
- "Pods `#{missing_pods.join('`, `')}` are not " \
141
- 'installed and cannot be updated'
142
- else
143
- "The `#{missing_pods.first}` Pod is not installed " \
144
- 'and cannot be updated'
145
- end
146
- raise Informative, message
147
- end
148
-
149
- run_install_with_update(:pods => @pods)
150
- else
151
- UI.puts 'Update all pods'.yellow unless @pods
152
- run_install_with_update(true)
153
- end
154
- end
155
- end
156
- end
157
- end