Class: PodAlexandria::XcodeGen

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-alexandria/xcodegen/xcodegen.rb,
lib/cocoapods-alexandria/xcodegen/dependencies_generator.rb

Class Method Summary collapse

Class Method Details

.cleanupRomeObject



3
4
5
6
7
# File 'lib/cocoapods-alexandria/xcodegen/xcodegen.rb', line 3

def self.cleanupRome
  FileUtils.remove_dir('build', force: true)
  FileUtils.remove_dir('dSYM', force: true)
  FileUtils.remove_dir('Rome', force: true)
end

.clearDependencies(xcodegen_dependencies_file) ⇒ Object



9
10
11
# File 'lib/cocoapods-alexandria/xcodegen/xcodegen.rb', line 9

def self.clearDependencies(xcodegen_dependencies_file)
  File.truncate(xcodegen_dependencies_file, 0)
end

.generateObject



13
14
15
16
17
18
19
# File 'lib/cocoapods-alexandria/xcodegen/xcodegen.rb', line 13

def self.generate
  unless system('which xcodegen > /dev/null')
    abort 'XcodeGen is not installed. Visit https://github.com/yonaskolb/XcodeGen to learn more.'
  end

  system('xcodegen')
end

.generate_dependencies(installer_context, options) ⇒ Object

Generate the project dependencies file, adding frameworks to the right targets and also checking if they are linked dynamically or not.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cocoapods-alexandria/xcodegen/dependencies_generator.rb', line 7

def self.generate_dependencies(installer_context, options)
  targets = installer_context.umbrella_targets.map { |target|
    generate_for_target(
      installer_context,
      target,
      options.environment_configs_for(target.cocoapods_target_label),
      options.allow_embed_dependencies_for(target.cocoapods_target_label)
    )
  }.to_h

  File.open(options.xcodegen_dependencies_file, 'w') { |file|
    YAML::dump({ 'targets' => targets }, file)
  }
end