├── .github └── dependabot.yml ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .rubocop_todo.yml ├── .travis.yml ├── CHANGELOG.md ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── README.md ├── Rakefile ├── VERSION ├── cocoapods-amicable.gemspec ├── lib ├── cocoapods_amicable.rb └── cocoapods_plugin.rb └── spec ├── cocoapods_amicable_spec.rb └── spec_helper.rb /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: bundler 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "13:00" 8 | open-pull-requests-limit: 10 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | pkg 3 | .idea/ 4 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --format documentation 2 | --color 3 | --require spec_helper 4 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: .rubocop_todo.yml 2 | 3 | AllCops: 4 | TargetRubyVersion: 2.0 5 | -------------------------------------------------------------------------------- /.rubocop_todo.yml: -------------------------------------------------------------------------------- 1 | # This configuration was generated by 2 | # `rubocop --auto-gen-config` 3 | # on 2019-01-14 12:55:11 -0800 using RuboCop version 0.49.1. 4 | # The point is for the user to remove these configuration records 5 | # one by one as the offenses are removed from the code base. 6 | # Note that changes in the inspected code, or installation of new 7 | # versions of RuboCop, may require this file to be generated again. 8 | 9 | # Offense count: 1 10 | # Cop supports --auto-correct. 11 | # Configuration parameters: EnforcedStyle, SupportedStyles. 12 | # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent 13 | Layout/IndentHeredoc: 14 | Exclude: 15 | - 'lib/cocoapods_amicable.rb' 16 | 17 | # Offense count: 3 18 | # Configuration parameters: AllowSafeAssignment. 19 | Lint/AssignmentInCondition: 20 | Exclude: 21 | - 'lib/cocoapods_amicable.rb' 22 | 23 | # Offense count: 2 24 | Metrics/AbcSize: 25 | Max: 24 26 | 27 | # Offense count: 6 28 | # Configuration parameters: CountComments, ExcludedMethods. 29 | Metrics/BlockLength: 30 | Max: 89 31 | 32 | # Offense count: 17 33 | # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. 34 | # URISchemes: http, https 35 | Metrics/LineLength: 36 | Max: 203 37 | 38 | # Offense count: 1 39 | # Configuration parameters: CountComments. 40 | Metrics/MethodLength: 41 | Max: 31 42 | 43 | # Offense count: 6 44 | Style/Documentation: 45 | Exclude: 46 | - 'spec/**/*' 47 | - 'test/**/*' 48 | - 'lib/cocoapods_amicable.rb' 49 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | 5 | before_script: 6 | - gem install bundler -v "~> 1.17" 7 | 8 | language: ruby 9 | cache: bundler 10 | rvm: 11 | - 2.0.0-p647 12 | - 2.3.4 13 | - 2.4.1 14 | - 2.5.1 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CocoaPods Amicable Changelog 2 | 3 | ## Master 4 | 5 | ##### Enhancements 6 | 7 | * None. 8 | 9 | ##### Bug Fixes 10 | 11 | * None. 12 | 13 | 14 | ## 0.4.0 (2023-07-23) 15 | 16 | ##### Enhancements 17 | 18 | * Support for Ruby 3.x. 19 | 20 | ##### Bug Fixes 21 | 22 | * None. 23 | 24 | 25 | ## 0.3.0 (2019-01-14) 26 | 27 | ##### Breaking Changes 28 | 29 | * Drop support for CocoaPods pre-1.7, support CocoaPods 1.7. 30 | [Dimitris Koutsogiorgas](https://github.com/dnkoutso) 31 | 32 | 33 | ## 0.2.0 (2018-04-02) 34 | 35 | ##### Enhancements 36 | 37 | * Rewrote the plugin to avoid saving the user project twice, 38 | saving multiple seconds per `pod install` on very large projects. 39 | 40 | 41 | ## 0.1.2 (2018-02-15) 42 | 43 | ##### Enhancements 44 | 45 | * Support Ruby 2.0.0. 46 | [Keith Smiley](https://github.com/keith) 47 | 48 | 49 | ## 0.1.1 (2018-02-14) 50 | 51 | ##### Bug Fixes 52 | 53 | * Fix Ruby 2.1 compatibility. 54 | [Samuel Giddins](https://github.com/segiddins) 55 | 56 | 57 | ## 0.1.0 (2018-02-14) 58 | 59 | ##### Enhancements 60 | 61 | * Initial implementation. 62 | [Samuel Giddins](https://github.com/segiddins) 63 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | # Specify your gem's dependencies in cocoapods-amicable.gemspec 6 | gemspec 7 | 8 | def cocoapods_gem(name, gem_name = name.downcase, **opts) 9 | gem gem_name, git: "https://github.com/CocoaPods/#{name}", **opts 10 | end 11 | 12 | group :development do 13 | cocoapods_gem 'CocoaPods' 14 | cocoapods_gem 'Core', 'cocoapods-core' 15 | cocoapods_gem 'Xcodeproj' 16 | 17 | gem 'rspec' 18 | gem 'rubocop', '<=0.50' 19 | end 20 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/CocoaPods/CocoaPods 3 | revision: 45376ff5a5926a1885adef0fe1c00b9c680c2ecc 4 | specs: 5 | cocoapods (1.6.0.beta.2) 6 | activesupport (>= 4.0.2, < 5) 7 | claide (>= 1.0.2, < 2.0) 8 | cocoapods-core (= 1.6.0.beta.2) 9 | cocoapods-deintegrate (>= 1.0.2, < 2.0) 10 | cocoapods-downloader (>= 1.2.2, < 2.0) 11 | cocoapods-plugins (>= 1.0.0, < 2.0) 12 | cocoapods-search (>= 1.0.0, < 2.0) 13 | cocoapods-stats (>= 1.0.0, < 2.0) 14 | cocoapods-trunk (>= 1.3.1, < 2.0) 15 | cocoapods-try (>= 1.1.0, < 2.0) 16 | colored2 (~> 3.1) 17 | escape (~> 0.0.4) 18 | fourflusher (~> 2.1.0) 19 | gh_inspector (~> 1.0) 20 | molinillo (~> 0.6.6) 21 | nap (~> 1.0) 22 | ruby-macho (~> 1.3, >= 1.3.1) 23 | xcodeproj (>= 1.7.0, < 2.0) 24 | 25 | GIT 26 | remote: https://github.com/CocoaPods/Core 27 | revision: 2972985a194494e0f779a9e498f2cc4d3e4375c8 28 | specs: 29 | cocoapods-core (1.6.0.beta.2) 30 | activesupport (>= 4.0.2, < 6) 31 | fuzzy_match (~> 2.0.4) 32 | nap (~> 1.0) 33 | 34 | GIT 35 | remote: https://github.com/CocoaPods/Xcodeproj 36 | revision: 4ee4a1af41000cdf0765dd83b7591c95350d015a 37 | specs: 38 | xcodeproj (1.7.0) 39 | CFPropertyList (>= 2.3.3, < 4.0) 40 | atomos (~> 0.1.3) 41 | claide (>= 1.0.2, < 2.0) 42 | colored2 (~> 3.1) 43 | nanaimo (~> 0.2.6) 44 | 45 | PATH 46 | remote: . 47 | specs: 48 | cocoapods-amicable (0.4.0) 49 | 50 | GEM 51 | remote: https://rubygems.org/ 52 | specs: 53 | CFPropertyList (3.0.0) 54 | activesupport (4.2.11) 55 | i18n (~> 0.7) 56 | minitest (~> 5.1) 57 | thread_safe (~> 0.3, >= 0.3.4) 58 | tzinfo (~> 1.1) 59 | ast (2.4.0) 60 | atomos (0.1.3) 61 | claide (1.0.2) 62 | cocoapods-deintegrate (1.0.2) 63 | cocoapods-downloader (1.2.2) 64 | cocoapods-plugins (1.0.0) 65 | nap 66 | cocoapods-search (1.0.0) 67 | cocoapods-stats (1.0.0) 68 | cocoapods-trunk (1.3.1) 69 | nap (>= 0.8, < 2.0) 70 | netrc (~> 0.11) 71 | cocoapods-try (1.1.0) 72 | colored2 (3.1.2) 73 | concurrent-ruby (1.1.4) 74 | diff-lcs (1.5.0) 75 | escape (0.0.4) 76 | fourflusher (2.1.0) 77 | fuzzy_match (2.0.4) 78 | gh_inspector (1.1.3) 79 | i18n (0.9.5) 80 | concurrent-ruby (~> 1.0) 81 | minitest (5.11.3) 82 | molinillo (0.6.6) 83 | nanaimo (0.2.6) 84 | nap (1.1.0) 85 | netrc (0.11.0) 86 | parallel (1.12.1) 87 | parser (2.4.0.2) 88 | ast (~> 2.3) 89 | powerpack (0.1.1) 90 | rainbow (2.2.2) 91 | rake 92 | rake (12.3.2) 93 | rspec (3.12.0) 94 | rspec-core (~> 3.12.0) 95 | rspec-expectations (~> 3.12.0) 96 | rspec-mocks (~> 3.12.0) 97 | rspec-core (3.12.0) 98 | rspec-support (~> 3.12.0) 99 | rspec-expectations (3.12.0) 100 | diff-lcs (>= 1.2.0, < 2.0) 101 | rspec-support (~> 3.12.0) 102 | rspec-mocks (3.12.0) 103 | diff-lcs (>= 1.2.0, < 2.0) 104 | rspec-support (~> 3.12.0) 105 | rspec-support (3.12.0) 106 | rubocop (0.49.1) 107 | parallel (~> 1.10) 108 | parser (>= 2.3.3.1, < 3.0) 109 | powerpack (~> 0.1) 110 | rainbow (>= 1.99.1, < 3.0) 111 | ruby-progressbar (~> 1.7) 112 | unicode-display_width (~> 1.0, >= 1.0.1) 113 | ruby-macho (1.3.1) 114 | ruby-progressbar (1.9.0) 115 | thread_safe (0.3.6) 116 | tzinfo (1.2.5) 117 | thread_safe (~> 0.1) 118 | unicode-display_width (1.3.0) 119 | 120 | PLATFORMS 121 | ruby 122 | 123 | DEPENDENCIES 124 | bundler (~> 2.3) 125 | cocoapods! 126 | cocoapods-amicable! 127 | cocoapods-core! 128 | rake (~> 12.3) 129 | rspec 130 | rubocop (<= 0.50) 131 | xcodeproj! 132 | 133 | BUNDLED WITH 134 | 2.4.17 135 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Samuel Giddins 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cocoapods-amicable 2 | 3 | A small CocoaPods plugin that moves the Podfile checksum to a file in the Sandbox, 4 | reducing merge conflicts for teams that don't commit their Pods directory. 5 | 6 | ## Installation 7 | 8 | $ gem install cocoapods-amicable 9 | 10 | ## Usage 11 | 12 | ```ruby 13 | # Podfile 14 | 15 | plugin 'cocoapods-amicable' 16 | ``` 17 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'bundler/gem_tasks' 4 | require 'rspec/core/rake_task' 5 | require 'rubocop/rake_task' 6 | 7 | RSpec::Core::RakeTask.new 8 | RuboCop::RakeTask.new 9 | 10 | task default: %i[rubocop spec] 11 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.4.0 2 | -------------------------------------------------------------------------------- /cocoapods-amicable.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Gem::Specification.new do |spec| 4 | spec.name = 'cocoapods-amicable' 5 | spec.version = File.read(File.expand_path('VERSION', __dir__)) 6 | spec.authors = ['Samuel Giddins'] 7 | spec.email = ['segiddins@segiddins.me'] 8 | spec.summary = 'A CocoaPods plugin that moves the Podfile checksum to a file in the Sandbox, ' \ 9 | "reducing merge conflicts for teams that don't commit their Pods directory." 10 | spec.homepage = 'https://github.com/segiddins/cocoapods-amicable' 11 | spec.license = 'MIT' 12 | 13 | spec.files = Dir['lib/**/*'] 14 | 15 | spec.add_development_dependency 'bundler', '~> 2.3' 16 | spec.add_development_dependency 'rake', '~> 12.3' 17 | 18 | spec.required_ruby_version = '>= 2.0' 19 | end 20 | -------------------------------------------------------------------------------- /lib/cocoapods_amicable.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module CocoaPodsAmicable 4 | module TargetIntegratorMixin 5 | def add_check_manifest_lock_script_phase 6 | podfile = target.target_definition.podfile 7 | return super unless podfile.plugins.key?('cocoapods-amicable') 8 | 9 | phase_name = Pod::Installer::UserProjectIntegrator::TargetIntegrator::CHECK_MANIFEST_PHASE_NAME 10 | native_targets.each do |native_target| 11 | phase = Pod::Installer::UserProjectIntegrator::TargetIntegrator.create_or_update_shell_script_build_phase(native_target, 12 | Pod::Installer::UserProjectIntegrator::TargetIntegrator::BUILD_PHASE_PREFIX + phase_name) 13 | native_target.build_phases.unshift(phase).uniq! unless native_target.build_phases.first == phase 14 | 15 | phase.shell_script = <<-SH 16 | set -e 17 | set -u 18 | set -o pipefail 19 | 20 | fail() { 21 | # print error to STDERR 22 | echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." $@ >&2 23 | exit 1 24 | } 25 | 26 | diff -q "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null || fail "The manifest in the sandbox differs from your lockfile." 27 | 28 | if [ -f "${PODS_ROOT}/Podfile.sha1" ]; then 29 | (cd "${PODS_PODFILE_DIR_PATH}" && shasum --algorithm 1 --status --check "${PODS_ROOT}/Podfile.sha1") || fail "Your Podfile has been changed since the last time you ran 'pod install'." 30 | fi 31 | 32 | # This output is used by Xcode 'outputs' to avoid re-running this script phase. 33 | echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}" 34 | SH 35 | 36 | phase.input_paths = %w[ 37 | ${PODS_PODFILE_DIR_PATH}/Podfile.lock 38 | ${PODS_ROOT}/Manifest.lock 39 | ${PODS_ROOT}/Podfile.sha1 40 | ] 41 | if name = podfile.defined_in_file && podfile.defined_in_file.basename 42 | phase.input_paths << "${PODS_PODFILE_DIR_PATH}/#{name}" 43 | end 44 | phase.output_paths = [target.check_manifest_lock_script_output_file_path] 45 | end 46 | end 47 | end 48 | 49 | module InstallerMixin 50 | def write_lockfiles 51 | super 52 | return unless podfile.plugins.key?('cocoapods-amicable') 53 | return unless checksum = podfile.checksum 54 | return unless podfile_path = podfile.defined_in_file 55 | checksum_path = sandbox.root + 'Podfile.sha1' 56 | 57 | Pod::UI.message "- Writing Podfile checksum in #{Pod::UI.path checksum_path}" do 58 | checksum_path.open('w') { |f| f << checksum << ' ' << podfile_path.basename.to_s << "\n" } 59 | end 60 | end 61 | end 62 | 63 | module LockfileMixin 64 | def generate(podfile, *) 65 | lockfile = super 66 | lockfile.internal_data.delete('PODFILE CHECKSUM') if podfile.plugins.key?('cocoapods-amicable') 67 | lockfile 68 | end 69 | end 70 | end 71 | 72 | module Pod 73 | class Installer 74 | prepend ::CocoaPodsAmicable::InstallerMixin 75 | 76 | class UserProjectIntegrator 77 | class TargetIntegrator 78 | prepend ::CocoaPodsAmicable::TargetIntegratorMixin 79 | end 80 | end 81 | end 82 | 83 | class Lockfile 84 | class << self 85 | prepend ::CocoaPodsAmicable::LockfileMixin 86 | end 87 | end 88 | end 89 | -------------------------------------------------------------------------------- /lib/cocoapods_plugin.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'cocoapods_amicable' 4 | -------------------------------------------------------------------------------- /spec/cocoapods_amicable_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'cocoapods_amicable' 4 | require 'tmpdir' 5 | 6 | RSpec.describe CocoaPodsAmicable do 7 | context 'with a user project' do 8 | around(:each) do |t| 9 | Dir.chdir(Dir.mktmpdir) { t.run } 10 | end 11 | 12 | let(:config) { Pod::Config.instance } 13 | 14 | let(:podfile_content) { <<-RUBY.strip_heredoc } 15 | plugin 'cocoapods-amicable' 16 | target 'App' 17 | RUBY 18 | 19 | before do 20 | user_project = Xcodeproj::Project.new('App.xcodeproj') 21 | Pod::Generator::AppTargetHelper.add_app_target(user_project, :osx, '10.11') 22 | user_project.save 23 | 24 | File.write 'Podfile', podfile_content 25 | 26 | CLAide::Command::PluginManager.load_plugins('cocoapods') 27 | end 28 | 29 | it 'writes something' do 30 | config.verbose = true 31 | installer = Pod::Installer.new(config.sandbox, config.podfile, config.lockfile) 32 | installer.install! 33 | 34 | expect(File.read('Podfile.lock')).to eq <<-YAML.strip_heredoc 35 | COCOAPODS: #{Pod::VERSION} 36 | YAML 37 | expect(File.read('Pods/Podfile.sha1')).to eq <<-EOS.strip_heredoc 38 | f81a4392854a0fca54d10ebc66e8bc82bc03281a Podfile 39 | EOS 40 | 41 | expect(installer.aggregate_targets.flat_map(&:user_targets)).to all(satisfy do |target| 42 | manifest_phase = target.build_phases.find { |bp| bp.name == '[CP] Check Pods Manifest.lock' } 43 | expect(manifest_phase.shell_script).to eq <<-SH.strip_heredoc 44 | set -e 45 | set -u 46 | set -o pipefail 47 | 48 | fail() { 49 | # print error to STDERR 50 | echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." $@ >&2 51 | exit 1 52 | } 53 | 54 | diff -q "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null || fail "The manifest in the sandbox differs from your lockfile." 55 | 56 | if [ -f "${PODS_ROOT}/Podfile.sha1" ]; then 57 | (cd "${PODS_PODFILE_DIR_PATH}" && shasum --algorithm 1 --status --check "${PODS_ROOT}/Podfile.sha1") || fail "Your Podfile has been changed since the last time you ran 'pod install'." 58 | fi 59 | 60 | # This output is used by Xcode 'outputs' to avoid re-running this script phase. 61 | echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}" 62 | SH 63 | expect(manifest_phase.input_paths).to eq [ 64 | '${PODS_PODFILE_DIR_PATH}/Podfile.lock', 65 | '${PODS_ROOT}/Manifest.lock', 66 | '${PODS_ROOT}/Podfile.sha1', 67 | '${PODS_PODFILE_DIR_PATH}/Podfile' 68 | ] 69 | expect(manifest_phase.output_paths).to eq %w[ 70 | $(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt 71 | ] 72 | end) 73 | 74 | expect(Pod::UI.output) 75 | .to include 'Writing Podfile checksum in `Pods/Podfile.sha1`' 76 | end 77 | 78 | context 'when the plugin is not specified' do 79 | let(:podfile_content) { super().gsub(/plugin.+/, '') } 80 | 81 | it 'keeps the checksum in the lockfile' do 82 | config.verbose = true 83 | installer = Pod::Installer.new(config.sandbox, config.podfile, config.lockfile) 84 | installer.install! 85 | 86 | expect(File.read('Podfile.lock')).to eq <<-YAML.strip_heredoc 87 | PODFILE CHECKSUM: 592f3ceb65a6adde4fcbc481f1e0325e951f85e5 88 | 89 | COCOAPODS: #{Pod::VERSION} 90 | YAML 91 | expect(File.file?('Pods/Podfile.sha1')).to eq false 92 | 93 | expect(installer.aggregate_targets.flat_map(&:user_targets)).to all(satisfy do |target| 94 | manifest_phase = target.build_phases.find { |bp| bp.name == '[CP] Check Pods Manifest.lock' } 95 | expect(manifest_phase.shell_script).to eq <<-SH.strip_heredoc 96 | diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null 97 | if [ $? != 0 ] ; then 98 | # print error to STDERR 99 | echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2 100 | exit 1 101 | fi 102 | # This output is used by Xcode 'outputs' to avoid re-running this script phase. 103 | echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}" 104 | SH 105 | expect(manifest_phase.input_paths).to eq [ 106 | '${PODS_PODFILE_DIR_PATH}/Podfile.lock', 107 | '${PODS_ROOT}/Manifest.lock' 108 | ] 109 | expect(manifest_phase.output_paths).to eq %w[ 110 | $(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt 111 | ] 112 | end) 113 | 114 | expect(Pod::UI.output) 115 | .not_to include 'Writing Podfile checksum in `Pods/Podfile.sha1`' 116 | end 117 | end 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'cocoapods' 4 | 5 | module Pod 6 | # Disable the wrapping so the output is deterministic in the tests. 7 | # 8 | UI.disable_wrap = true 9 | 10 | # Redirects the messages to an internal store. 11 | # 12 | module UI 13 | class << self 14 | attr_accessor :output 15 | attr_accessor :warnings 16 | attr_accessor :next_input 17 | 18 | def puts(message = '') 19 | @output << "#{message}\n" 20 | end 21 | 22 | def warn(message = '', _actions = []) 23 | @warnings << "#{message}\n" 24 | end 25 | 26 | def print(message) 27 | @output << message 28 | end 29 | 30 | alias gets next_input 31 | 32 | def print_warnings; end 33 | end 34 | end 35 | end 36 | 37 | RSpec.configure do |config| 38 | config.before(:each) do 39 | Pod::UI.output = ''.dup 40 | Pod::UI.warnings = ''.dup 41 | Pod::UI.next_input = ''.dup 42 | Pod::Config.instance = nil 43 | end 44 | end 45 | --------------------------------------------------------------------------------