Class: AspNetCompiler

Inherits:
Object
  • Object
show all
Includes:
Albacore::RunCommand, Albacore::Task, Configuration::AspNetCompiler, SupportsLinuxEnvironment
Defined in:
lib/albacore/aspnetcompiler.rb

Instance Attribute Summary

Attributes included from SupportsLinuxEnvironment

#is_linux

Attributes included from Logging

#current_log_device, #logger

Attributes included from Albacore::RunCommand

#command, #working_directory

Instance Method Summary collapse

Methods included from SupportsLinuxEnvironment

#format_path, #format_reference, #to_OS_format

Methods included from Configuration::AspNetCompiler

#aspnetcompiler, aspnetcompilerconfig, included, #use

Methods included from Albacore::Configuration

included

Methods included from Configuration::NetVersion

#get_net_version, #win_dir

Methods included from Failure

#fail_with_message

Methods included from Logging

#create_logger, #log_device=, #log_level, #log_level=

Methods included from Albacore::RunCommand

#get_command, #run_command

Methods included from AttrMethods

#attr_array, #attr_hash

Methods included from Albacore::Task

clean_dirname, create_rake_task, include_config, included

Methods included from UpdateAttributes

#<<, #update_attributes

Methods included from YAMLConfig

#configure, #load_config_by_task_name

Constructor Details

#initializeAspNetCompiler

Optional String parameter. The virtual path of the application to be compiled. If PhysicalPath specified, the physical path is used to locate the application. Otherwise, the IIS metabase is used, and the application is assumed to be in the default site. This parameter corresponds to the -v switch on aspnet_compiler.exe.



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/albacore/aspnetcompiler.rb', line 28

def initialize
  @clean = false
  @debug = false
  @delay_sign = false
  @fixed_names = false
  @force = false
  @updateable = false
  @virtual_path = '/'
  super()
  update_attributes aspnetcompiler.to_hash
end

Instance Method Details

#executeObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/albacore/aspnetcompiler.rb', line 40

def execute
  params = []
  params << "-v #{@virtual_path}" unless @virtual_path.nil?
  params << "-p #{format_path(@physical_path)}" unless @physical_path.nil?
  params << "-c" if @clean
  params << "-delaysign" if @delay_sign
  params << "-fixednames" if @fixed_names
  params << "-d" if @debug
  params << "-u" if @updateable
  params << "-f" if @force
  params << format_path(@target_path) unless @target_path.nil?
  
  result = run_command "AspNetCompiler", params
  
  failure_message = 'AspNetCompiler Failed. See Build Log For Detail'
  fail_with_message failure_message if !result
end