Skip to content

Commit f677ce1

Browse files
ghostlordstarwalker
and
walker
authored
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 <[email protected]>
1 parent 5d7c159 commit f677ce1

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ test/Binary.xcworkspace/contents.xcworkspacedata
3131
test/Binary.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
3232
test/Podfile
3333
test/Podfile.lock
34+
35+
*.gem

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Forked from https://github.com/muukii/cocoapods-binary
2+
3+
add `forbidden_dependency_binary!`, Prevent the automatic compilation of dependent libraries into binary as well.
4+
5+
---
6+
17
> ⚠️ This is a temporaly forked repository.
28
39
https://github.com/leavez/cocoapods-binary/pull/137

lib/cocoapods-binary/Main.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ def all_binary!
1212
DSL.prebuild_all = true
1313
end
1414

15+
# Fobidden dependency auto build to binary
16+
def forbidden_dependency_binary!
17+
DSL.forbidden_dependency_binary = true
18+
end
19+
1520
# Enable bitcode for prebuilt frameworks
1621
def enable_bitcode_for_prebuilt_frameworks!
1722
DSL.bitcode_enabled = true
@@ -56,6 +61,9 @@ def set_custom_xcodebuild_options_for_prebuilt_frameworks(options)
5661
end
5762

5863
private
64+
class_attr_accessor :forbidden_dependency_binary
65+
forbidden_dependency_binary = false
66+
5967
class_attr_accessor :prebuild_all
6068
prebuild_all = false
6169

lib/cocoapods-binary/Prebuild.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ def prebuild_frameworks!
109109
targets = self.pod_targets
110110
end
111111

112+
if Pod::Podfile::DSL.forbidden_dependency_binary
113+
forbidden_dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
114+
targets = targets - forbidden_dependency_targets
115+
end
116+
112117
targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) }
113118

114119

lib/cocoapods-binary/gem_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module CocoapodsBinary
2-
VERSION = "0.4.4"
2+
VERSION = "0.4.5"
33
end

lib/cocoapods-binary/helper/podfile_options.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ def prebuild_pod_targets
8181
if not Podfile::DSL.prebuild_all
8282
targets = targets.select { |pod_target| prebuild_names.include?(pod_target.pod_name) }
8383
end
84-
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
85-
targets = (targets + dependency_targets).uniq
84+
85+
if not Podfile::DSL.forbidden_dependency_binary
86+
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
87+
targets = (targets + dependency_targets).uniq
88+
end
8689

8790
# filter should not prebuild
8891
explict_should_not_names = target_definition.should_not_prebuild_framework_pod_names

0 commit comments

Comments
 (0)