lib/cocoapods-jxedt/binary/helper/target_definition.rb in cocoapods-jxedt-0.0.19 vs lib/cocoapods-jxedt/binary/helper/target_definition.rb in cocoapods-jxedt-0.0.20
- old
+ new
@@ -8,25 +8,20 @@
@explicit_prebuild_pod_names ||= []
@reject_prebuild_pod_names ||= []
if options.is_a?(Hash) && options.include?(:binary)
@explicit_prebuild_pod_names << Specification.root_name(name) if options[:binary]
@reject_prebuild_pod_names << Specification.root_name(name) unless options[:binary]
- else
- settings = Jxedt.config.binary_settings
- symbol_name = Specification.root_name(name).to_sym
- if settings.include?(symbol_name) && [true, false].include?(settings[symbol_name])
- @explicit_prebuild_pod_names << Specification.root_name(name) if settings[symbol_name]
- @reject_prebuild_pod_names << Specification.root_name(name) unless settings[symbol_name]
- end
end
# header search path
@explicit_header_search_pod_names ||= []
@reject_header_search_pod_names ||= []
- @explicit_header_search_pod_names << Specification.root_name(name) if options.is_a?(Hash) && options[:framework_header_search]
- @reject_header_search_pod_names << Specification.root_name(name) if options.is_a?(Hash) && options.include?(:framework_header_search) && !options[:framework_header_search]
+ if options.is_a?(Hash) && options.include?(:framework_header_search)
+ @explicit_header_search_pod_names << Specification.root_name(name) if options[:framework_header_search]
+ @reject_header_search_pod_names << Specification.root_name(name) unless options[:framework_header_search]
+ end
options.delete(:binary) if options.is_a?(Hash)
options.delete(:framework_header_search) if options.is_a?(Hash)
requirements.pop if options.empty?
end
@@ -35,9 +30,20 @@
# We want modify `store_pod` method, but it's hard to insert a line in the
# implementation. So we patch a method called in `store_pod`.
original_parse_inhibit_warnings = instance_method(:parse_inhibit_warnings)
define_method(:parse_inhibit_warnings) do |name, requirements|
detect_prebuilt_pod(name, requirements)
+
+ # merge binary settings
+ Jxedt.config.binary_settings.each { |name, val|
+ next if @explicit_prebuild_pod_names.include?(name) # 配置:binary的组件优先级高
+ next if @reject_prebuild_pod_names.include?(name)
+ next unless [true, false].include?(val)
+
+ @explicit_prebuild_pod_names << name.to_s if val
+ @reject_prebuild_pod_names << name.to_s unless val
+ }
+
original_parse_inhibit_warnings.bind(self).call(name, requirements)
end
end
end
end
\ No newline at end of file