Class: Albacore::Build::Config
- Inherits:
-
Object
- Object
- Albacore::Build::Config
- Extended by:
- ConfigDSL
- Defined in:
- lib/albacore/task_types/build.rb
Overview
The configuration class for xbuild and msbuild. MSDN docs at: msdn.microsoft.com/en-us/library/vstudio/ms164311.aspx
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#properties ⇒ Object
any properties you want to set.
-
#target ⇒ Object
readonly
this is the target of the compilation with MsBuild/XBuild.
Instance Method Summary collapse
-
#be_quiet ⇒ Object
Set logging verbosity to quiet.
-
#clp(param) ⇒ Object
Pass the parameters that you specify to the console logger, which displays build information in the console window.
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#nologo ⇒ Object
Don’t display the startup banner or the copyright message.
- #params_for_file(file) ⇒ Object
-
#prop(k, v) ⇒ Object
Allows you to add properties to MsBuild; example:.
Methods included from ConfigDSL
Methods included from Logging
#debug, #err, #error, #fatal, #info, #puts, #trace, #warn
Methods included from CmdConfig
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/albacore/task_types/build.rb', line 40 def initialize @parameters = Set.new w = lambda { |e| CrossPlatformCmd.which(e) ? e : nil } @files = [] @exe = w.call( "msbuild" ) || w.call( "xbuild" ) || heuristic_executable debug { "build using '#{@exe}'" } set_logging (ENV['DEBUG'] ? (ENV['VERBOSE'] ? 'detailed' : 'normal') : 'minimal') end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
59 60 61 |
# File 'lib/albacore/task_types/build.rb', line 59 def files @files end |
#properties ⇒ Object
any properties you want to set
38 39 40 |
# File 'lib/albacore/task_types/build.rb', line 38 def properties @properties end |
#target ⇒ Object (readonly)
this is the target of the compilation with MsBuild/XBuild
35 36 37 |
# File 'lib/albacore/task_types/build.rb', line 35 def target @target end |
Instance Method Details
#be_quiet ⇒ Object
Set logging verbosity to quiet
142 143 144 |
# File 'lib/albacore/task_types/build.rb', line 142 def be_quiet logging = "quiet" end |
#clp(param) ⇒ Object
Pass the parameters that you specify to the console logger, which displays build information in the console window. You can specify the following parameters:
-
PerformanceSummary. Show the time that’s spent in tasks, targets and projects.
-
Summary. Show the error and warning summary at the end.
-
NoSummary. Don’t show the error and warning summary at the end.
-
ErrorsOnly. Show only errors.
-
WarningsOnly. Show only warnings.
-
NoItemAndPropertyList. Don’t show the list of items and properties that would appear at the start of each project build if the verbosity level is set to diagnostic.
-
ShowCommandLine. Show TaskCommandLineEvent messages.
-
ShowTimestamp. Show the timestamp as a prefix to any message.
-
ShowEventId. Show the event ID for each started event, finished event, and message.
-
ForceNoAlign. Don’t align the text to the size of the console buffer.
-
DisableConsoleColor. Use the default console colors for all logging messages.
-
DisableMPLogging. Disable the multiprocessor logging style of output when running in non-multiprocessor mode.
-
EnableMPLogging. Enable the multiprocessor logging style even when running in non-multiprocessor mode. This logging style is on by default.
-
Verbosity. Override the /verbosity setting for this logger.
137 138 139 |
# File 'lib/albacore/task_types/build.rb', line 137 def clp param update_array_prop "consoleloggerparameters", method(:make_clp), :clp, param end |
#nologo ⇒ Object
Don’t display the startup banner or the copyright message.
147 148 149 |
# File 'lib/albacore/task_types/build.rb', line 147 def nologo @parameters.add "/nologo" end |
#params_for_file(file) ⇒ Object
151 152 153 154 |
# File 'lib/albacore/task_types/build.rb', line 151 def params_for_file file update_file file @parameters end |
#prop(k, v) ⇒ Object
Allows you to add properties to MsBuild; example:
b.prop ‘WarningLevel’, 2 b.prop ‘BuildVersion’, ‘3.5.0’
From MSDN:
“Set or override the specified project-level properties, where name is the property name and value is the property value. Specify each property separately, or use a semicolon or comma to separate multiple properties, as the following example shows: /property:WarningLevel=2;OutputDir=binDebug”
The properties will be automatically converted to the correct syntax
92 93 94 95 96 97 |
# File 'lib/albacore/task_types/build.rb', line 92 def prop k, v @properties ||= Hash.new @parameters.delete "/property:#{make_props}" if @properties.any? @properties[k] = v @parameters.add "/property:#{make_props}" end |