Module: Gaudi::Rules::Build

Defined in:
lib/gaudi/helpers/generators.rb

Instance Method Summary collapse

Instance Method Details

#all_rules(system_config) ⇒ Object

Creates all rake rules for the given platform


126
127
128
129
130
131
# File 'lib/gaudi/helpers/generators.rb', line 126

def all_rules system_config
  system_config.platforms.each do |platform|
    executable_rule(system_config,platform)
    object_rule(system_config,platform)
  end
end

#executable_rule(system_config, platform) ⇒ Object

Creates a rake rule for executables files of the given platform


133
134
135
136
137
138
139
140
141
142
# File 'lib/gaudi/helpers/generators.rb', line 133

def executable_rule system_config,platform
  platform_config=system_config.platform_config(platform)
  _,_,exe=platform_config.extensions
  #we configure them with dots which messes the regexp up
  ext=exe.gsub(".","")
  rule(/#{platform}\/.*\.#{ext}$/) do |t|
    include Gaudi::ArtifactAdapters::Build
    build(t,system_config,platform)
  end
end

#object_rule(system_config, platform) ⇒ Object

Creates a rake rule for object files of the given platform


144
145
146
147
148
149
150
151
152
153
# File 'lib/gaudi/helpers/generators.rb', line 144

def object_rule system_config,platform
  platform_config=system_config.platform_config(platform)
  obj,_,_=platform_config.extensions
  #we configure them with dots which messes the regexp up
  ext=obj.gsub(".","")
  rule(/#{platform}\/.*\.#{ext}$/) do |t|
    include Gaudi::ArtifactAdapters::Build
    compile(t,system_config,platform)
  end
end