From 02d61055b081d240eb2f6a95a877d5ec8d6f2b12 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Sun, 6 Dec 2020 18:42:48 +0900 Subject: [PATCH 01/13] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e1ba6c7..1dd1764 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +> ⚠️ This is a temporaly forked repository. +[`cocoapods-binary`](https://github.com/leavez/cocoapods-binary) is not maintained now, because the owner of `cocoapods-binary` is currently busy. +Although, this plugin brings us a bunch of advantages in working iOS app development. +So I created this forked repo inorder to gather PRs to fix issues and merge into the original repository in the future. + +

From 7aa18806d7261585ad7e8109a5899be31d975846 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Sun, 6 Dec 2020 19:22:35 +0900 Subject: [PATCH 02/13] Fix issue with IRGen (#1) During debugging session, with the use of pods installed via Cocoapods-binary, the console in Xcode displays error messages while executing following expression: `po self` The error looks the following one: ``` Printing description of self: expression produced error: error: virtual filesystem overlay file '/path/to/project/Pods/build/Pods.build/Release-iphoneos/Charts.build/all-product-headers.yaml' not found error: couldn't IRGen expression. Please check the above error messages for possible root causes. ``` The issue is not related to Charts pod, but to every pod used. To fix the issue, I just removed the line that delete the build folder generated during the precompiling of pods. THis folder contains for each pod, the `all-product-headers.yaml` expected by Xcode. Co-authored-by: Brendan Guegan --- lib/cocoapods-binary/rome/build_framework.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cocoapods-binary/rome/build_framework.rb b/lib/cocoapods-binary/rome/build_framework.rb index 10c8571..44e217e 100644 --- a/lib/cocoapods-binary/rome/build_framework.rb +++ b/lib/cocoapods-binary/rome/build_framework.rb @@ -188,7 +188,7 @@ def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, def self.remove_build_dir(sandbox_root) path = build_dir(sandbox_root) - path.rmtree if path.exist? + # path.rmtree if path.exist? end private From f42d797e197821a495c7cd05067411865041fb40 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Sun, 6 Dec 2020 19:24:31 +0900 Subject: [PATCH 03/13] Fix for CocoaPods 1.10.0 (#2) Co-authored-by: alexander-vorobyev-corp-mail <73995640+alexander-vorobyev-corp-mail@users.noreply.github.com> --- lib/cocoapods-binary/Integration.rb | 76 ++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/lib/cocoapods-binary/Integration.rb b/lib/cocoapods-binary/Integration.rb index 8ef76e1..660b013 100644 --- a/lib/cocoapods-binary/Integration.rb +++ b/lib/cocoapods-binary/Integration.rb @@ -286,4 +286,78 @@ class EmbedFrameworksScript end end end -end \ No newline at end of file +end + +module Pod + module Generator + class CopydSYMsScript + old_method = instance_method(:generate) + define_method(:generate) do + script = old_method.bind(self).() + script = script.gsub(/-av/, "-r -L -p -t -g -o -D -v") + end + end + end + end + + module Pod + module Generator + class CopyXCFrameworksScript + old_method = instance_method(:script) + define_method(:script) do + script = old_method.bind(self).() + script = script.gsub(/-av/, "-r -L -p -t -g -o -D -v") + end + end + end + end + + Pod::Installer::Xcode::PodsProjectGenerator::PodTargetInstaller.define_singleton_method(:dsym_paths) do |target| + dsym_paths = target.framework_paths.values.flatten.reject { |fmwk_path| fmwk_path.dsym_path.nil? }.map(&:dsym_path) + dsym_paths.concat(target.xcframeworks.values.flatten.flat_map { |xcframework| xcframework_dsyms(xcframework.path) }) + dsym_paths.uniq + end + + module Pod + class Installer + class Xcode + class PodsProjectGenerator + class PodTargetIntegrator + old_method = instance_method(:add_copy_xcframeworks_script_phase) + define_method(:add_copy_xcframeworks_script_phase) do |native_target| + script_path = "${PODS_ROOT}/#{target.copy_xcframeworks_script_path.relative_path_from(target.sandbox.root)}" + + input_paths_by_config = {} + output_paths_by_config = {} + + xcframeworks = target.xcframeworks.values.flatten + + if use_input_output_paths? && !xcframeworks.empty? + input_file_list_path = target.copy_xcframeworks_script_input_files_path + input_file_list_relative_path = "${PODS_ROOT}/#{input_file_list_path.relative_path_from(target.sandbox.root)}" + input_paths_key = UserProjectIntegrator::TargetIntegrator::XCFileListConfigKey.new(input_file_list_path, input_file_list_relative_path) + input_paths = input_paths_by_config[input_paths_key] = [] + + framework_paths = xcframeworks.map { |xcf| "${PODS_ROOT}/#{xcf.path.relative_path_from(target.sandbox.root)}" } + input_paths.concat framework_paths + + output_file_list_path = target.copy_xcframeworks_script_output_files_path + output_file_list_relative_path = "${PODS_ROOT}/#{output_file_list_path.relative_path_from(target.sandbox.root)}" + output_paths_key = UserProjectIntegrator::TargetIntegrator::XCFileListConfigKey.new(output_file_list_path, output_file_list_relative_path) + output_paths_by_config[output_paths_key] = xcframeworks.map do |xcf| + "#{Target::BuildSettings::XCFRAMEWORKS_BUILD_DIR_VARIABLE}/#{xcf.name}" + end + end + + if xcframeworks.empty? + UserProjectIntegrator::TargetIntegrator.remove_copy_xcframeworks_script_phase_from_target(native_target) + else + UserProjectIntegrator::TargetIntegrator.create_or_update_copy_xcframeworks_script_phase_to_target( + native_target, script_path, input_paths_by_config, output_paths_by_config) + end + end + end + end + end + end + end From 9f29c713b090e699a71e88bc6ef6888c1c0a5f0b Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Sun, 6 Dec 2020 19:32:55 +0900 Subject: [PATCH 04/13] Update README.md --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1dd1764..2bed041 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,24 @@ > ⚠️ This is a temporaly forked repository. -[`cocoapods-binary`](https://github.com/leavez/cocoapods-binary) is not maintained now, because the owner of `cocoapods-binary` is currently busy. -Although, this plugin brings us a bunch of advantages in working iOS app development. + +https://github.com/leavez/cocoapods-binary/pull/137 + +cocoapods-binary is not maintained now, because the owner of cocoapods-binary is currently busy. +Although, this plugin brings us a bunch of advantages in working iOS app development. So I created this forked repo inorder to gather PRs to fix issues and merge into the original repository in the future. +## Installation + +``` +gem 'cocoapods-binary', git: "https://github.com/muukii/cocoapods-binary.git", branch: "master" +``` + +## Contribution + +Please submit a PR to my forked repo from `https://github.com/muukii/cocoapods-binary/pulls`. +I'll merge it. +**But I can't review well because I don't have much experience with Ruby. So I really need developers who can handle ruby code.** +---

From ad8566382f6c6b8e3cd678ef8eee49bb91056c94 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Sun, 6 Dec 2020 19:33:25 +0900 Subject: [PATCH 05/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bed041..dd64ae8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ https://github.com/leavez/cocoapods-binary/pull/137 cocoapods-binary is not maintained now, because the owner of cocoapods-binary is currently busy. Although, this plugin brings us a bunch of advantages in working iOS app development. -So I created this forked repo inorder to gather PRs to fix issues and merge into the original repository in the future. +Respectfully, I created this forked repo inorder to gather PRs to fix issues and merge into the original repository in the future. ## Installation From 596cb287e94c6abd9bb87ed0701e96f8ad0ba647 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Sun, 6 Dec 2020 19:33:37 +0900 Subject: [PATCH 06/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd64ae8..8fdb80d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ https://github.com/leavez/cocoapods-binary/pull/137 -cocoapods-binary is not maintained now, because the owner of cocoapods-binary is currently busy. -Although, this plugin brings us a bunch of advantages in working iOS app development. +cocoapods-binary is not maintained now, because the owner of cocoapods-binary is currently busy. +Although, this plugin brings us a bunch of advantages in working iOS app development. Respectfully, I created this forked repo inorder to gather PRs to fix issues and merge into the original repository in the future. ## Installation From fdc39bbeb4ec6f29e3d059d3ff53c7b4d77d31f1 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Mon, 7 Dec 2020 01:12:41 +0900 Subject: [PATCH 07/13] Fix/ci (#3) * Use Xcode 10.2 in Travis for Swift 4.2 and 5 support * Specify RxCocoa to 4.x for tests * Remove version restriction on Bundler 1.x * Set gemfile in Travis to test/Gemfile * Remove extraneous gem install cocoapods * Add pod setup to travis script * Enable command output in test script * Make test.sh file executable * Unset CPATH env variable in Travis Co-authored-by: Kyle Fleming --- .travis.yml | 8 ++++++-- cocoapods-binary.gemspec | 2 +- test/change_podfile.py | 4 ++-- test/test.sh | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) mode change 100644 => 100755 test/test.sh diff --git a/.travis.yml b/.travis.yml index 9327854..59e818b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ -osx_image: xcode9.3 +osx_image: xcode10.2 language: objective-c cache: - cocoapods - bundler +gemfile: test/Gemfile before_install: -- gem install cocoapods +- unset CPATH +install: +- bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle} +- bundle exec pod setup script: - rake install - cd test diff --git a/cocoapods-binary.gemspec b/cocoapods-binary.gemspec index 697aeb2..de525fb 100644 --- a/cocoapods-binary.gemspec +++ b/cocoapods-binary.gemspec @@ -22,6 +22,6 @@ Gem::Specification.new do |spec| spec.add_dependency "fourflusher", "~> 2.0" spec.add_dependency "xcpretty", "~> 0.3.0" - spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'bundler', '> 1.3' spec.add_development_dependency 'rake' end diff --git a/test/change_podfile.py b/test/change_podfile.py index 5f31510..95b5098 100644 --- a/test/change_podfile.py +++ b/test/change_podfile.py @@ -53,7 +53,7 @@ def addSwiftPod(): """ keep_source_code_for_prebuilt_frameworks! -pod "RxCocoa", :binary => true +pod "RxCocoa", "~> 4.0", :binary => true pod "Literal", :binary => true """), """ @@ -70,7 +70,7 @@ def revertToSourceCode(): """ keep_source_code_for_prebuilt_frameworks! -pod "RxCocoa", :binary => true +pod "RxCocoa", "~> 4.0", :binary => true pod "Literal" """), """ diff --git a/test/test.sh b/test/test.sh old mode 100644 new mode 100755 index 4aa46dc..99e6466 --- a/test/test.sh +++ b/test/test.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -ex build() { xcodebuild -workspace Binary.xcworkspace -scheme Binary ONLY_ACTIVE_ARCH=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -quiet || exit 1 From 33274192dddd9fabf24a0ccec700e947250d754a Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Wed, 9 Dec 2020 22:03:13 +0900 Subject: [PATCH 08/13] Use GitHub Actions to run test (#4) * :zap: WIP * :evergreen_tree: Update * :evergreen_tree: Update * :evergreen_tree: Update * :evergreen_tree: Update --- .github/workflows/tests.yml | 32 ++++++++++ Gemfile.lock | 118 ++++++++++++++++++++++++++++++++++++ test/Gemfile | 2 +- 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml create mode 100644 Gemfile.lock diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..112d60c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Tests + +on: [push] + +jobs: + build: + runs-on: macos-latest + steps: + - name: Cache multiple paths + uses: actions/cache@v2 + with: + path: | + cocoapods + bundler + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + - uses: maxim-lobanov/setup-xcode@v1.1 + with: + xcode-version: '12.2' + - uses: actions/checkout@v1 + - name: Set up Ruby 2.6 + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + - name: Test + run: | + gem install bundler + bundle install --path=${BUNDLE_PATH:-vendor/bundle} + bundle exec pod setup + rake install + cd test + sh test.sh + cd .. diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..9db2d0f --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,118 @@ +PATH + remote: . + specs: + cocoapods-binary (0.4.4) + cocoapods (>= 1.5.0, < 2.0) + fourflusher (~> 2.0) + xcpretty (~> 0.3.0) + +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.3) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + bacon (1.2.0) + claide (1.0.3) + cocoapods (1.10.0) + addressable (~> 2.6) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.10.0) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.0) + activesupport (> 5.0, < 6) + addressable (~> 2.6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.4) + cocoapods-downloader (1.4.0) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-trunk (1.5.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.1.7) + escape (0.0.4) + ethon (0.12.0) + ffi (>= 1.3.0) + ffi (1.13.1) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.8.5) + concurrent-ruby (~> 1.0) + json (2.3.1) + minitest (5.14.2) + mocha (1.11.2) + mocha-on-bacon (0.2.3) + mocha (>= 0.13.0) + molinillo (0.6.6) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + prettybacon (0.0.2) + bacon (~> 1.2) + public_suffix (4.0.6) + rake (13.0.1) + rouge (2.0.7) + ruby-macho (1.4.0) + thread_safe (0.3.6) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.8) + thread_safe (~> 0.1) + xcodeproj (1.19.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + xcpretty (0.3.0) + rouge (~> 2.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + bacon + bundler (> 1.3) + cocoapods + cocoapods-binary! + mocha + mocha-on-bacon + prettybacon + rake + +BUNDLED WITH + 2.1.4 diff --git a/test/Gemfile b/test/Gemfile index 9a3ea13..240e3e0 100644 --- a/test/Gemfile +++ b/test/Gemfile @@ -2,6 +2,6 @@ # frozen_string_literal: true source "https://rubygems.org" -gem 'cocoapods', '1.6.1' +gem 'cocoapods', '1.10.0' gem 'cocoapods-binary', :path => "../" From 58cc6d29b7ff52ced39e5c838f5600264aa4ca2f Mon Sep 17 00:00:00 2001 From: Muukii Date: Wed, 9 Dec 2020 22:04:56 +0900 Subject: [PATCH 09/13] Update Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 59e818b..8002639 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode10.2 +osx_image: xcode12.2 language: objective-c cache: - cocoapods From 5d7c1597e5e58ceb6ed70c3d8fcbf7abe73db0ef Mon Sep 17 00:00:00 2001 From: Muukii Date: Thu, 10 Dec 2020 01:40:08 +0900 Subject: [PATCH 10/13] Fix demo --- demo/Gemfile | 2 +- demo/Gemfile.lock | 77 ++++++++++++++++++----------- demo/Podfile.lock | 4 +- demo/demo.xcodeproj/project.pbxproj | 61 +++++++++-------------- 4 files changed, 74 insertions(+), 70 deletions(-) diff --git a/demo/Gemfile b/demo/Gemfile index 5a134c1..3fc358f 100644 --- a/demo/Gemfile +++ b/demo/Gemfile @@ -2,6 +2,6 @@ # frozen_string_literal: true source "https://rubygems.org" -gem 'cocoapods', '1.6.1' +gem 'cocoapods', '1.10.0' gem 'cocoapods-binary', :path => "../" gem 'xcpretty' diff --git a/demo/Gemfile.lock b/demo/Gemfile.lock index 054eec4..7c0bc1d 100644 --- a/demo/Gemfile.lock +++ b/demo/Gemfile.lock @@ -9,71 +9,88 @@ PATH GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.0) - activesupport (4.2.11.1) - i18n (~> 0.7) + CFPropertyList (3.0.3) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) atomos (0.1.3) - claide (1.0.2) - cocoapods (1.6.1) - activesupport (>= 4.0.2, < 5) + claide (1.0.3) + cocoapods (1.10.0) + addressable (~> 2.6) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.6.1) - cocoapods-deintegrate (>= 1.0.2, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-core (= 1.10.0) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.1, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (>= 2.2.0, < 3.0) + fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.8.1, < 2.0) - cocoapods-core (1.6.1) - activesupport (>= 4.0.2, < 6) + xcodeproj (>= 1.19.0, < 2.0) + cocoapods-core (1.10.0) + activesupport (> 5.0, < 6) + addressable (~> 2.6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) + netrc (~> 0.11) + public_suffix + typhoeus (~> 1.0) cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.2.2) + cocoapods-downloader (1.4.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.3.1) + cocoapods-trunk (1.5.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) - cocoapods-try (1.1.0) + cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.7) escape (0.0.4) - fourflusher (2.2.0) + ethon (0.12.0) + ffi (>= 1.3.0) + ffi (1.13.1) + fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - i18n (0.9.5) + httpclient (2.8.3) + i18n (1.8.5) concurrent-ruby (~> 1.0) - minitest (5.11.3) + json (2.3.1) + minitest (5.14.2) molinillo (0.6.6) - nanaimo (0.2.6) + nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) + public_suffix (4.0.6) rouge (2.0.7) ruby-macho (1.4.0) thread_safe (0.3.6) - tzinfo (1.2.5) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.8) thread_safe (~> 0.1) - xcodeproj (1.8.2) + xcodeproj (1.19.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) xcpretty (0.3.0) rouge (~> 2.0.7) @@ -81,9 +98,9 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.6.1) + cocoapods (= 1.10.0) cocoapods-binary! xcpretty BUNDLED WITH - 2.0.1 + 2.1.4 diff --git a/demo/Podfile.lock b/demo/Podfile.lock index abaf4d6..f58bbb7 100644 --- a/demo/Podfile.lock +++ b/demo/Podfile.lock @@ -5,7 +5,7 @@ DEPENDENCIES: - Masonry SPEC REPOS: - https://github.com/cocoapods/specs.git: + trunk: - Masonry SPEC CHECKSUMS: @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5daab9dbab4736d6a1b3df2ffa8d856285c16553 -COCOAPODS: 1.6.1 +COCOAPODS: 1.10.0 diff --git a/demo/demo.xcodeproj/project.pbxproj b/demo/demo.xcodeproj/project.pbxproj index 556833b..27d7f5d 100644 --- a/demo/demo.xcodeproj/project.pbxproj +++ b/demo/demo.xcodeproj/project.pbxproj @@ -8,25 +8,22 @@ /* Begin PBXBuildFile section */ 2E1AEA2ADE0B2C6D0E8CB73C /* BDWebImage_demo.m in Sources */ = {isa = PBXBuildFile; fileRef = 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */; }; - 7ADC04F6B6AD86B4711FC662 /* Pods_demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0282097ED33E34DF2FB40193 /* Pods_demo.framework */; }; + 4E7F0A1DEF72401732631637 /* Pods_demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 044EC92A39312500E33210F0 /* Pods_demo.framework */; }; 8BC2E4C8225F2B8600EC0609 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */; }; 8BC2E4CA225F2B8600EC0609 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */; }; 8BC2E4D2225F2B8700EC0609 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 0282097ED33E34DF2FB40193 /* Pods_demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6F9AD13F2ED88EAB7A9128D7 /* libPods-demoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 044EC92A39312500E33210F0 /* Pods_demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CF2798C779A4B1DB1ED95EA /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = BDWebImage_demo.m; sourceTree = ""; }; 8BC2E4C4225F2B8600EC0609 /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 8BC2E4D1225F2B8700EC0609 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 8BC2E4D3225F2B8700EC0609 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9A8064F1F3E5738D234C80E2 /* Pods-demoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoTests.release.xcconfig"; path = "Target Support Files/Pods-demoTests/Pods-demoTests.release.xcconfig"; sourceTree = ""; }; - C55F7BF03CC970F91505F490 /* Pods-demoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoTests.debug.xcconfig"; path = "Target Support Files/Pods-demoTests/Pods-demoTests.debug.xcconfig"; sourceTree = ""; }; - E9C2707150376AA5D63E8BAE /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; - F8A8B289BFEAE54B0D540472 /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; + D04236F5B998AFD90E6F891E /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -34,22 +31,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7ADC04F6B6AD86B4711FC662 /* Pods_demo.framework in Frameworks */, + 4E7F0A1DEF72401732631637 /* Pods_demo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 03BCE6F733E8AF8755385CE8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 6F9AD13F2ED88EAB7A9128D7 /* libPods-demoTests.a */, - 0282097ED33E34DF2FB40193 /* Pods_demo.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 48064E0CABFB2B206E032E3B /* demos */ = { isa = PBXGroup; children = ( @@ -65,7 +53,7 @@ 8BC2E4C6225F2B8600EC0609 /* demo */, 8BC2E4C5225F2B8600EC0609 /* Products */, D25B1A678978B02ABFF01D1C /* Pods */, - 03BCE6F733E8AF8755385CE8 /* Frameworks */, + F46AC028BDE2AFC77F39ED2B /* Frameworks */, ); sourceTree = ""; }; @@ -92,14 +80,20 @@ D25B1A678978B02ABFF01D1C /* Pods */ = { isa = PBXGroup; children = ( - F8A8B289BFEAE54B0D540472 /* Pods-demo.debug.xcconfig */, - E9C2707150376AA5D63E8BAE /* Pods-demo.release.xcconfig */, - C55F7BF03CC970F91505F490 /* Pods-demoTests.debug.xcconfig */, - 9A8064F1F3E5738D234C80E2 /* Pods-demoTests.release.xcconfig */, + D04236F5B998AFD90E6F891E /* Pods-demo.debug.xcconfig */, + 4CF2798C779A4B1DB1ED95EA /* Pods-demo.release.xcconfig */, ); path = Pods; sourceTree = ""; }; + F46AC028BDE2AFC77F39ED2B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 044EC92A39312500E33210F0 /* Pods_demo.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -107,11 +101,11 @@ isa = PBXNativeTarget; buildConfigurationList = 8BC2E4E1225F2B8800EC0609 /* Build configuration list for PBXNativeTarget "demo" */; buildPhases = ( - 4A7278B702427200DBDC45CB /* [CP] Check Pods Manifest.lock */, + 81ED7638A0CD08711B1D7EB7 /* [CP] Check Pods Manifest.lock */, 8BC2E4C0225F2B8600EC0609 /* Sources */, 8BC2E4C1225F2B8600EC0609 /* Frameworks */, 8BC2E4C2225F2B8600EC0609 /* Resources */, - 27E132FE722A29856F619A3D /* [CP] Embed Pods Frameworks */, + 5801A456D772620A7851D8CB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -167,31 +161,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 27E132FE722A29856F619A3D /* [CP] Embed Pods Frameworks */ = { + 5801A456D772620A7851D8CB /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh", - "${PODS_ROOT}/Masonry/Masonry.framework", - "${PODS_ROOT}/Masonry/Masonry.framework.dSYM", + "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", - "${DWARF_DSYM_FOLDER_PATH}/Masonry.framework.dSYM", + "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 4A7278B702427200DBDC45CB /* [CP] Check Pods Manifest.lock */ = { + 81ED7638A0CD08711B1D7EB7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -358,7 +345,7 @@ }; 8BC2E4E2225F2B8800EC0609 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F8A8B289BFEAE54B0D540472 /* Pods-demo.debug.xcconfig */; + baseConfigurationReference = D04236F5B998AFD90E6F891E /* Pods-demo.debug.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = demo/Info.plist; @@ -375,7 +362,7 @@ }; 8BC2E4E3225F2B8800EC0609 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E9C2707150376AA5D63E8BAE /* Pods-demo.release.xcconfig */; + baseConfigurationReference = 4CF2798C779A4B1DB1ED95EA /* Pods-demo.release.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = demo/Info.plist; From f677ce19bfe30454a296be0ffda69323b094de18 Mon Sep 17 00:00:00 2001 From: ghostlordstar Date: Wed, 31 Mar 2021 20:23:25 +0800 Subject: [PATCH 11/13] add `forbidden_dependency_binary!` options. (#7) * [GL][add ] * [GL][add `forbidden_dependency_binary!`] * update README for `forbidden_dependency_binary!` * Update README.md Co-authored-by: walker --- .gitignore | 2 ++ README.md | 6 ++++++ lib/cocoapods-binary/Main.rb | 8 ++++++++ lib/cocoapods-binary/Prebuild.rb | 5 +++++ lib/cocoapods-binary/gem_version.rb | 2 +- lib/cocoapods-binary/helper/podfile_options.rb | 7 +++++-- 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 85dd667..1465c7c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ test/Binary.xcworkspace/contents.xcworkspacedata test/Binary.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist test/Podfile test/Podfile.lock + +*.gem \ No newline at end of file diff --git a/README.md b/README.md index 8fdb80d..1e3c0d9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +Forked from https://github.com/muukii/cocoapods-binary + +add `forbidden_dependency_binary!`, Prevent the automatic compilation of dependent libraries into binary as well. + +--- + > ⚠️ This is a temporaly forked repository. https://github.com/leavez/cocoapods-binary/pull/137 diff --git a/lib/cocoapods-binary/Main.rb b/lib/cocoapods-binary/Main.rb index 78fcf41..33e193d 100644 --- a/lib/cocoapods-binary/Main.rb +++ b/lib/cocoapods-binary/Main.rb @@ -12,6 +12,11 @@ def all_binary! DSL.prebuild_all = true end + # Fobidden dependency auto build to binary + def forbidden_dependency_binary! + DSL.forbidden_dependency_binary = true + end + # Enable bitcode for prebuilt frameworks def enable_bitcode_for_prebuilt_frameworks! DSL.bitcode_enabled = true @@ -56,6 +61,9 @@ def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) end private + class_attr_accessor :forbidden_dependency_binary + forbidden_dependency_binary = false + class_attr_accessor :prebuild_all prebuild_all = false diff --git a/lib/cocoapods-binary/Prebuild.rb b/lib/cocoapods-binary/Prebuild.rb index 77bc834..98e3449 100644 --- a/lib/cocoapods-binary/Prebuild.rb +++ b/lib/cocoapods-binary/Prebuild.rb @@ -109,6 +109,11 @@ def prebuild_frameworks! targets = self.pod_targets end + if Pod::Podfile::DSL.forbidden_dependency_binary + forbidden_dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || [] + targets = targets - forbidden_dependency_targets + end + targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) } diff --git a/lib/cocoapods-binary/gem_version.rb b/lib/cocoapods-binary/gem_version.rb index fd912f8..2f2cd56 100644 --- a/lib/cocoapods-binary/gem_version.rb +++ b/lib/cocoapods-binary/gem_version.rb @@ -1,3 +1,3 @@ module CocoapodsBinary - VERSION = "0.4.4" + VERSION = "0.4.5" end diff --git a/lib/cocoapods-binary/helper/podfile_options.rb b/lib/cocoapods-binary/helper/podfile_options.rb index ebbc402..8ed6823 100644 --- a/lib/cocoapods-binary/helper/podfile_options.rb +++ b/lib/cocoapods-binary/helper/podfile_options.rb @@ -81,8 +81,11 @@ def prebuild_pod_targets if not Podfile::DSL.prebuild_all targets = targets.select { |pod_target| prebuild_names.include?(pod_target.pod_name) } end - dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || [] - targets = (targets + dependency_targets).uniq + + if not Podfile::DSL.forbidden_dependency_binary + dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || [] + targets = (targets + dependency_targets).uniq + end # filter should not prebuild explict_should_not_names = target_definition.should_not_prebuild_framework_pod_names From 18d036a0e8379ca328cee90a21896ef43456fbdd Mon Sep 17 00:00:00 2001 From: ghostlordstar Date: Tue, 5 Oct 2021 21:29:38 +0800 Subject: [PATCH 12/13] update to v0.4.7 (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [GL][add ] * [GL][add `forbidden_dependency_binary!`] * update README for `forbidden_dependency_binary!` * Update README.md * [GL][merge https://github.com/leavez/cocoapods-binary/pull/148] * [GL][merge https://github.com/leavez/cocoapods-binary/pull/142] * [GL][开始开发Podfile_local功能] * [GL][Support to configure the `cocoapods-binary` plug-in separately through `BinPodfile`.] * [GL][add all_not_prebuild! configration.] * [GL][update test.rb] * [GL][update test.rb] * [GL][fix `all_not_prebuild!` bug.] * [GL][update to version: 0.4.7, update Gemfile.lock.] * [GL][update README.md]. * [GL][update README] Co-authored-by: walker Co-authored-by: Hansen --- Gemfile.lock | 2 +- README.md | 24 +++++- demo/BinPodfile | 8 ++ demo/Gemfile.lock | 26 +++--- demo/Podfile | 4 +- demo/Podfile.lock | 16 +++- lib/cocoapods-binary/Integration.rb | 11 ++- lib/cocoapods-binary/Main.rb | 125 +++++++++++++++++----------- lib/cocoapods-binary/Prebuild.rb | 3 +- lib/cocoapods-binary/gem_version.rb | 2 +- test.rb | 25 ++++++ 11 files changed, 176 insertions(+), 70 deletions(-) create mode 100644 demo/BinPodfile create mode 100644 test.rb diff --git a/Gemfile.lock b/Gemfile.lock index 9db2d0f..18c38c6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cocoapods-binary (0.4.4) + cocoapods-binary (0.4.7) cocoapods (>= 1.5.0, < 2.0) fourflusher (~> 2.0) xcpretty (~> 0.3.0) diff --git a/README.md b/README.md index 1e3c0d9..6a9168c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ Forked from https://github.com/muukii/cocoapods-binary -add `forbidden_dependency_binary!`, Prevent the automatic compilation of dependent libraries into binary as well. +## Change log + + +2012/09/11 +* Support to configure the `cocoapods-binary` plug-in separately through `BinPodfile`. [more >>](#BinPodfile) +* Add `all_not_prebuild!` for prebuild. [more >>](#all_not_probuild) +* Add a `test.rb` script to help you test quickly. + +2021/03/15 +* add `forbidden_dependency_binary!`, Prevent the automatic compilation of dependent libraries into binary as well. --- @@ -90,7 +99,20 @@ If your `Pods` folder is excluded from git, you may add `keep_source_code_for_pr If bitcode is needed, add a `enable_bitcode_for_prebuilt_frameworks!` before all targets in Podfile +`all_not_probuild`: If you want to disable binary for all pods, you can use `all_not_prebuild!`, it has high priority to other binary settings. + +BinPodfie: If you need to frequently modify the configuration of `cocoapods-binary`, but do not want to synchronize to the git repository, you can use `BinPodfile`, add `BinPodfile` to your `.gitignor`file. +```ruby + +# You can write the `cocoapods-binary` plugin configuration in this file. +# Prevent frequent modification of `Podfile` on CI machines. + +# e.g +forbidden_dependency_binary! + +all_not_prebuild! +``` #### Known Issues - doesn't support watchos now diff --git a/demo/BinPodfile b/demo/BinPodfile new file mode 100644 index 0000000..f051b02 --- /dev/null +++ b/demo/BinPodfile @@ -0,0 +1,8 @@ + +# You can write the `cocoapods-binary` plugin configuration in this file. +# Prevent frequent modification of `Podfile` on CI machines. + +# e.g +forbidden_dependency_binary! + +all_not_prebuild! \ No newline at end of file diff --git a/demo/Gemfile.lock b/demo/Gemfile.lock index 7c0bc1d..af32a7f 100644 --- a/demo/Gemfile.lock +++ b/demo/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - cocoapods-binary (0.4.4) + cocoapods-binary (0.4.7) cocoapods (>= 1.5.0, < 2.0) fourflusher (~> 2.0) xcpretty (~> 0.3.0) @@ -10,12 +10,12 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.3) - activesupport (5.2.4.4) + activesupport (5.2.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) @@ -60,37 +60,39 @@ GEM netrc (~> 0.11) cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.9) escape (0.0.4) - ethon (0.12.0) - ffi (>= 1.3.0) - ffi (1.13.1) + ethon (0.14.0) + ffi (>= 1.15.0) + ffi (1.15.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.8.5) + i18n (1.8.10) concurrent-ruby (~> 1.0) - json (2.3.1) - minitest (5.14.2) + json (2.5.1) + minitest (5.14.4) molinillo (0.6.6) nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) public_suffix (4.0.6) + rexml (3.2.5) rouge (2.0.7) ruby-macho (1.4.0) thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.8) + tzinfo (1.2.9) thread_safe (~> 0.1) - xcodeproj (1.19.0) + xcodeproj (1.20.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) + rexml (~> 3.2.4) xcpretty (0.3.0) rouge (~> 2.0.7) diff --git a/demo/Podfile b/demo/Podfile index e91f600..2a5f26b 100644 --- a/demo/Podfile +++ b/demo/Podfile @@ -2,11 +2,11 @@ platform :ios, '9.0' plugin 'cocoapods-binary' use_frameworks! -all_binary! - +#all_binary! target 'demo' do pod 'Masonry' + pod 'Moya', :binary => true end diff --git a/demo/Podfile.lock b/demo/Podfile.lock index f58bbb7..6b7a1c3 100644 --- a/demo/Podfile.lock +++ b/demo/Podfile.lock @@ -1,16 +1,30 @@ PODS: + - Alamofire (4.9.1) - Masonry (1.1.0) + - Moya (13.0.1): + - Moya/Core (= 13.0.1) + - Moya/Core (13.0.1): + - Alamofire (~> 4.1) + - Result (~> 4.1) + - Result (4.1.0) DEPENDENCIES: - Masonry + - Moya SPEC REPOS: trunk: + - Alamofire - Masonry + - Moya + - Result SPEC CHECKSUMS: + Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 + Moya: f4a4b80ff2f8a4ffc208dfb31cd91636622fee6e + Result: bd966fac789cc6c1563440b348ab2598cc24d5c7 -PODFILE CHECKSUM: 5daab9dbab4736d6a1b3df2ffa8d856285c16553 +PODFILE CHECKSUM: 3ce0f1842cd4e2647ed42da70d44c9392b1a014d COCOAPODS: 1.10.0 diff --git a/lib/cocoapods-binary/Integration.rb b/lib/cocoapods-binary/Integration.rb index 660b013..0f39f87 100644 --- a/lib/cocoapods-binary/Integration.rb +++ b/lib/cocoapods-binary/Integration.rb @@ -88,7 +88,16 @@ def mirror_with_symlink(source, basefolder, target_folder) path_objects = hash[name] if path_objects != nil path_objects.each do |object| - make_link(object.real_file_path, object.target_file_path) + # make_link(object.real_file_path, object.target_file_path) + # https://github.com/leavez/cocoapods-binary/pull/142 + target_file_path = object.target_file_path + real_file_path = object.real_file_path + case File.extname(real_file_path) + when '.xib' + real_file_path = real_file_path.sub_ext(".nib") + target_file_path = target_file_path.sub(".xib", ".nib") + end + make_link(real_file_path, target_file_path) end end end # of for each diff --git a/lib/cocoapods-binary/Main.rb b/lib/cocoapods-binary/Main.rb index 33e193d..edb57cb 100644 --- a/lib/cocoapods-binary/Main.rb +++ b/lib/cocoapods-binary/Main.rb @@ -12,6 +12,12 @@ def all_binary! DSL.prebuild_all = true end + # Disable prebuiding for all pods + # it has a high priority to other binary settings + def all_not_prebuild! + DSL.all_not_prebuild = true + end + # Fobidden dependency auto build to binary def forbidden_dependency_binary! DSL.forbidden_dependency_binary = true @@ -67,6 +73,9 @@ def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) class_attr_accessor :prebuild_all prebuild_all = false + class_attr_accessor :all_not_prebuild + all_not_prebuild = false + class_attr_accessor :bitcode_enabled bitcode_enabled = false @@ -84,6 +93,22 @@ def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) Pod::HooksManager.register('cocoapods-binary', :pre_install) do |installer_context| require_relative 'helper/feature_switches' + + # sync BinPodfile, refer to `https://github.com/tripleCC/cocoapods-bin` + bin_project_root = Pod::Config.instance.project_root + bin_path = File.join(bin_project_root.to_s, 'BinPodfile') + next unless File.exist?(bin_path) + bin_contents = File.open(bin_path, 'r:utf-8', &:read) + bin_podfile = Pod::Config.instance.podfile + bin_podfile.instance_eval do + begin + eval(bin_contents, nil, bin_path) + rescue Exception => e + bin_message = "Invalid `#{bin_path}` file: #{e.message}" + raise Pod::DSLError.new(bin_message, bin_path, e, bin_contents) + end + end + if Pod.is_prebuild_stage next end @@ -98,56 +123,57 @@ def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) exit end end - - - # -- step 1: prebuild framework --- - # Execute a sperated pod install, to generate targets for building framework, - # then compile them to framework files. - require_relative 'helper/prebuild_sandbox' - require_relative 'Prebuild' - - Pod::UI.puts "🚀 Prebuild frameworks" - - # Fetch original installer (which is running this pre-install hook) options, - # then pass them to our installer to perform update if needed - # Looks like this is the most appropriate way to figure out that something should be updated - - update = nil - repo_update = nil - - include ObjectSpace - ObjectSpace.each_object(Pod::Installer) { |installer| - update = installer.update - repo_update = installer.repo_update - } - - # control features - Pod.is_prebuild_stage = true - Pod::Podfile::DSL.enable_prebuild_patch true # enable sikpping for prebuild targets - Pod::Installer.force_disable_integration true # don't integrate targets - Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile - Pod::Installer.disable_install_complete_message true # disable install complete message - - # make another custom sandbox - standard_sandbox = installer_context.sandbox - prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox) - - # get the podfile for prebuild - prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file) - - # install - lockfile = installer_context.lockfile - binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile) - - if binary_installer.have_exact_prebuild_cache? && !update - binary_installer.install_when_cache_hit! + + # Check prebuild enable + if Pod::Podfile::DSL.all_not_prebuild # Disable prebuild + Pod::UI.puts "⚠️ Disable prebuild!" else - binary_installer.update = update - binary_installer.repo_update = repo_update - binary_installer.install! + Pod::UI.puts "🚀 Prebuild frameworks" + + # -- step 1: prebuild framework --- + # Execute a sperated pod install, to generate targets for building framework, + # then compile them to framework files. + require_relative 'helper/prebuild_sandbox' + require_relative 'Prebuild' + + # Fetch original installer (which is running this pre-install hook) options, + # then pass them to our installer to perform update if needed + # Looks like this is the most appropriate way to figure out that something should be updated + include ObjectSpace + update = nil + repo_update = nil + ObjectSpace.each_object(Pod::Installer) { |installer| + update = installer.update + repo_update = installer.repo_update + } + + # control features + Pod.is_prebuild_stage = true + Pod::Podfile::DSL.enable_prebuild_patch true # enable sikpping for prebuild targets + Pod::Installer.force_disable_integration true # don't integrate targets + Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile + Pod::Installer.disable_install_complete_message true # disable install complete message + + # make another custom sandbox + standard_sandbox = installer_context.sandbox + prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox) + + # get the podfile for prebuild + prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file) + + # install + lockfile = installer_context.lockfile + binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile) + + if binary_installer.have_exact_prebuild_cache? && !update + binary_installer.install_when_cache_hit! + else + binary_installer.update = update + binary_installer.repo_update = repo_update + binary_installer.install! + end end - - + # reset the environment Pod.is_prebuild_stage = false Pod::Installer.force_disable_integration false @@ -155,8 +181,7 @@ def set_custom_xcodebuild_options_for_prebuilt_frameworks(options) Pod::Config.force_disable_write_lockfile false Pod::Installer.disable_install_complete_message false Pod::UserInterface.warnings = [] # clean the warning in the prebuild step, it's duplicated. - - + # -- step 2: pod install --- # install Pod::UI.puts "\n" diff --git a/lib/cocoapods-binary/Prebuild.rb b/lib/cocoapods-binary/Prebuild.rb index 98e3449..6f3cb79 100644 --- a/lib/cocoapods-binary/Prebuild.rb +++ b/lib/cocoapods-binary/Prebuild.rb @@ -97,7 +97,8 @@ def prebuild_frameworks! targets = root_names_to_update.map do |pod_name| tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache) if tars.nil? || tars.empty? - raise "There's no target named (#{pod_name}) in Pod.xcodeproj.\n #{self.pod_targets.map(&:name)}" if t.nil? + # https://github.com/leavez/cocoapods-binary/pull/148 + raise "There's no target named (#{pod_name}) in Pod.xcodeproj.\n #{self.pod_targets.map(&:name)}" if tars.nil? end tars end.flatten diff --git a/lib/cocoapods-binary/gem_version.rb b/lib/cocoapods-binary/gem_version.rb index 2f2cd56..0b21f91 100644 --- a/lib/cocoapods-binary/gem_version.rb +++ b/lib/cocoapods-binary/gem_version.rb @@ -1,3 +1,3 @@ module CocoapodsBinary - VERSION = "0.4.5" + VERSION = "0.4.7" end diff --git a/test.rb b/test.rb new file mode 100644 index 0000000..31b47a7 --- /dev/null +++ b/test.rb @@ -0,0 +1,25 @@ +require 'cocoapods-binary/gem_version.rb' +# build gem +puts " 💫 begin build [cocoapods-binary]...\n" +build_ret = %x(gem build cocoapods-binary.gemspec) + +# build success +if ( build_ret.downcase =~ /(.*)successfully(.*)/ ) + puts "\n✅ build [cocoapods-binary] successfully!" + + gemFile = /cocoapods-binary-.*/.match(build_ret) # match gem file + puts "\n💫 begin install #{gemFile} ...\n" + install_ret = %x(sudo gem install #{gemFile}) # install gem file + + if (install_ret.downcase =~ /(.*)successfully installed cocoapods-binary-(.*)/) + Dir::chdir("demo") + puts "\n✅ install gem success.\n\n💫 Begin run `Pod install`" + puts "#{%x(pod install)}" # pod install + else + puts "❗️install #{gemFile} failed!" + end +else + puts "❗️build [cocoapods-binary] failed!" +end + + From 82528265c36cb836693adbd099cf208faa5d7bfc Mon Sep 17 00:00:00 2001 From: Muukii Date: Wed, 2 Mar 2022 16:51:04 +0900 Subject: [PATCH 13/13] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6a9168c..fe1c27e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +-> https://github.com/muukii/cocoapods-frost + Forked from https://github.com/muukii/cocoapods-binary ## Change log