Class: Phoenx::ExtractBuildSettings
- Inherits:
-
Object
- Object
- Phoenx::ExtractBuildSettings
- Defined in:
- lib/phoenx/use_cases/extract_build_settings.rb
Instance Method Summary collapse
- #extract ⇒ Object
- #extract_project_settings ⇒ Object
- #extract_target_settings ⇒ Object
-
#initialize(project) ⇒ ExtractBuildSettings
constructor
A new instance of ExtractBuildSettings.
Constructor Details
#initialize(project) ⇒ ExtractBuildSettings
Returns a new instance of ExtractBuildSettings.
7 8 9 10 11 |
# File 'lib/phoenx/use_cases/extract_build_settings.rb', line 7 def initialize(project) @project = project end |
Instance Method Details
#extract ⇒ Object
89 90 91 92 93 94 |
# File 'lib/phoenx/use_cases/extract_build_settings.rb', line 89 def extract self.extract_target_settings self.extract_project_settings end |
#extract_project_settings ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/phoenx/use_cases/extract_build_settings.rb', line 53 def extract_project_settings FileUtils::mkdir_p 'xcconfig' @project.build_configuration_list.build_configurations.each do |config| file = open('xcconfig/' + config.name + '.xcconfig', 'w') config.build_settings.each do |key,values| file.write(key + ' = ') if values.is_a?(String) file.write(values) else values.each do |value| file.write(value + ' ') end end file.puts end file.close end end |
#extract_target_settings ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/phoenx/use_cases/extract_build_settings.rb', line 13 def extract_target_settings @project.targets.each do |target| FileUtils::mkdir_p 'xcconfig/' + target.name target.build_configuration_list.build_configurations.each do |config| file = open('xcconfig/' + target.name + '/' + config.name + '.xcconfig', 'w') config.build_settings.each do |key,values| file.write(key + ' = ') if values.is_a?(String) file.write(values) else values.each do |value| file.write(value + ' ') end end file.puts end file.close end end end |