lib/swordfish/native/target_architectures.rb in cocoapods-swordfish-0.1.7 vs lib/swordfish/native/target_architectures.rb in cocoapods-swordfish-1.0.0
- old
+ new
@@ -1,79 +1,54 @@
module Pod
class Target
- def self.excluded_archs_simulator(post_context, is_arm64)
+ def self.set_archs(post_context, is_only_arm64)
post_context.aggregate_targets.each do |one|
one.pod_targets.each { |target|
- target.excluded_archs_simulator(is_arm64)
+ target.loop_set_archs(is_only_arm64)
}
- one.excluded_archs_simulator(is_arm64)
+ one.set_archs(is_only_arm64)
end
end
end
class PodTarget
- def excluded_archs_simulator(is_arm64)
+ def loop_set_archs(is_arm64)
build_settings.each do |config_name, setting|
config_file = setting.xcconfig
if is_arm64
- config_file.set_excluded_archs_simulator
+ config_file.set_archs_arm64
else
- config_file.set_excluded_archs_simulator_default
+ config_file.set_archs_default
end
config_path = xcconfig_path(config_name)
config_file.save_as(config_path)
end
end
end
class AggregateTarget
- def excluded_archs_simulator(is_arm64)
+ def set_archs(is_arm64)
xcconfigs.each do |config_name, config_file|
if is_arm64
- config_file.set_excluded_archs_simulator
+ config_file.set_archs_arm64
else
- config_file.set_excluded_archs_simulator_default
+ config_file.set_archs_default
end
config_path = xcconfig_path(config_name)
config_file.save_as(config_path)
end
end
end
end
module Xcodeproj
class Config
- def set_excluded_archs_simulator_default
- remove_attr_with_key('EXCLUDED_ARCHS[sdk=iphonesimulator*]"')
+ def set_archs_default
+ remove_attr_with_key('ARCHS')
end
- def set_excluded_archs_simulator
- @attributes["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = 'arm64'
- end
- end
-
- class Project
- def self.set_archs_arm64(post_context, is_arm64)
- temp_project = post_context.umbrella_targets.first.user_project
- temp_project.targets.each do | target |
- build_configurations = target.build_configurations
- build_configurations.each do | config |
- config.set_archs(is_arm64)
- end
- end
- temp_project.save
- end
-
- module Object
- class XCBuildConfiguration
- def set_archs(is_arm64)
- if is_arm64
- build_settings['ARCHS'] = "arm64"
- else
- build_settings['ARCHS'] = "$(ARCHS_STANDARD)"
- end
- end
- end
+ def set_archs_arm64
+ @attributes['ARCHS'] = 'arm64'
end
end
end
\ No newline at end of file