Class: Xcake::TargetBuildRuleGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/xcake/generator/target_build_rule_generator.rb

Overview

This generator generates the build phases for each target in the project

Instance Attribute Summary

Attributes inherited from Generator

#context

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Generator

#initialize, plugins_location

Methods included from CoreExtensions::ClassDescendants

#descendants

Methods included from Visitor

#item_name, #leave, #visit

Methods included from Plugin

included

Methods included from Dependency

included

Constructor Details

This class inherits a constructor from Xcake::Generator

Class Method Details

.dependenciesObject



6
7
8
# File 'lib/xcake/generator/target_build_rule_generator.rb', line 6

def self.dependencies
  [TargetBuildPhaseGenerator]
end

Instance Method Details

#visit_target(target) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/xcake/generator/target_build_rule_generator.rb', line 10

def visit_target(target)
  EventHooks.run_hook :before_adding_build_rules, target

  native_target = @context.native_object_for(target)

  target.build_rules.each do |rule|
    EventHooks.run_hook :before_adding_custom_build_rule, rule, target

    native_build_rule = @context.native_object_for(rule)
    rule.configure_native_build_rule(native_build_rule, @context)
    native_target.build_rules << native_build_rule
  end
end