Sha256: f392ae9ba0bff1f9e349e75d11246b018f2b9d56d3c59d7a698d3578c286a0de
Contents?: true
Size: 1.77 KB
Versions: 5
Compression:
Stored size: 1.77 KB
Contents
module Physique class CompileConfig attr_writer :default_targets, # Default build targets for compile task :configuration, # Build configuration (Release, Debug, etc.) :logging # MSBuild Logging level (normal, verbose, etc.) def initialize @default_targets = %w(Clean Rebuild) @targets = %w(Clean Build Rebuild) end def clear_targets @targets.clear end def add_target(val) @targets << val end def opts raise ArgumentError, 'You must specify the default targets' if @default_targets.blank? Map.new({ default_targets: @default_targets, configuration: @configuration, logging: @logging, targets: @targets }).apply( configuration: 'Release', logging: 'normal' ) end end class BuildTasksBuilder < TasksBuilder def build_tasks add_version_task add_compile_tasks end private def add_version_task require 'albacore/tasks/versionizer' Albacore::Tasks::Versionizer.new :versionizer end def add_compile_tasks block = lambda &method(:configure_build) desc 'Builds the solution' build :compile => [ :restore ], &block.curry.(solution.compile.default_targets) namespace :compile do solution.compile.targets.each do |t| desc "Builds the solution using the #{t} target" build t.downcase, &block.curry.(t) end end end def configure_build(target, config) config.sln = solution.file config.prop 'Configuration', solution.compile.configuration config.logging = solution.compile.logging config.target = target end end end
Version data entries
5 entries across 5 versions & 1 rubygems