Class: Cxxproject::CustomBuildingBlock

Inherits:
BuildingBlock show all
Defined in:
lib/cxxproject/buildingblocks/custom_building_block.rb

Instance Attribute Summary collapse

Attributes inherited from BuildingBlock

#config_files, #config_name, #name, #output_dir, #output_dir_abs, #pre_step, #project_dir, #tags

Instance Method Summary collapse

Methods inherited from BuildingBlock

#add_output_dir_dependency, #additional_path_components, #calc_complete_output_dir, #catch_output, #check_config_file, #complete_init, #complete_output_dir, #has_tcs?, #initialize, #printCmd, #process_result, #read_file_or_empty_string, #remove_empty_strings_and_join, #set_config_files, #set_config_name, #set_name, #set_output_dir, #set_project_dir, #set_tcs, #setup_rake_dependencies, #tcs, #typed_file_task

Methods included from HasDependencies

#add_unique, #all_dependencies, #all_dependencies_recursive, #collect_dependencies, #convert_named_values_to_string, #dependencies, #direct_deps, #helper_dependencies, #resolve_by_name, #set_dependencies, #set_helper_dependencies

Constructor Details

This class inherits a constructor from Cxxproject::BuildingBlock

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



7
8
9
# File 'lib/cxxproject/buildingblocks/custom_building_block.rb', line 7

def actions
  @actions
end

#custom_commandObject (readonly)

Returns the value of attribute custom_command.



7
8
9
# File 'lib/cxxproject/buildingblocks/custom_building_block.rb', line 7

def custom_command
  @custom_command
end

Instance Method Details

#convert_to_rakeObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cxxproject/buildingblocks/custom_building_block.rb', line 26

def convert_to_rake()
  desc get_task_name
  res = task get_task_name do
    actions.each do |a|
      a.call
    end
  end
  res.type = Rake::Task::CUSTOM
  setup_rake_dependencies(res)
  res
end

#get_task_nameObject



14
15
16
# File 'lib/cxxproject/buildingblocks/custom_building_block.rb', line 14

def get_task_name()
  name
end

#set_actions(actions) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/cxxproject/buildingblocks/custom_building_block.rb', line 18

def set_actions(actions)
  if actions.kind_of?(Array)
    @actions = actions
  else
    @actions = [actions]
  end
end

#set_custom_command(c) ⇒ Object



9
10
11
12
# File 'lib/cxxproject/buildingblocks/custom_building_block.rb', line 9

def set_custom_command(c)
  @custom_command = c
  self
end