Skip to content
martin-brennan-fs edited this page Sep 4, 2014 · 10 revisions

The build command replaces the msbuild command from previous versions of Albacore.

require 'albacore'
build :compile_this do |b|
  b.file   = Paths.join 'src', 'MyProj.fsproj' # the file that you want to build
  # b.sln  = Paths.join 'src', 'MyProj.sln'    # alt. name
  b.target = ['Clean', 'Rebuild']              # call with an array of targets or just a single target
  b.prop 'Configuration', 'Release'            # call with 'key, value', to specify a MsBuild property
  b.cores = 4                                  # no of cores to build with, defaults to the number of cores on your machine
  b.clp 'ShowEventId'                          # any parameters you want to pass to the console logger of MsBuild
  b.logging = 'detailed'                       # detailed logging mode. The available verbosity levels are: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
  # b.be_quiet                                 # opposite of the above
  b.no_logo                                    # no Microsoft/XBuild header output
end

If you want the build command to package the solution for web deployment, add the following properties:

b.prop 'UseWPP_CopyWebApplication', 'true' # applies the web.config transforms for the build config
b.prop 'PipelineDependsOnBuild', 'false' # makes it so you can package without building first
b.prop 'webprojectoutputdir', '../deploy/' # the directory to write the published files to
b.prop 'outdir', 'bin/' # the directory of your bin files for the project
Clone this wiki locally