Skip to content

add forbidden_dependency_binary! options. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ test/Binary.xcworkspace/contents.xcworkspacedata
test/Binary.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
test/Podfile
test/Podfile.lock

*.gem
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions lib/cocoapods-binary/Main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions lib/cocoapods-binary/Prebuild.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }


Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-binary/gem_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module CocoapodsBinary
VERSION = "0.4.4"
VERSION = "0.4.5"
end
7 changes: 5 additions & 2 deletions lib/cocoapods-binary/helper/podfile_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down