-
Notifications
You must be signed in to change notification settings - Fork 0
Command Line Task Options
Many of the tasks that Albacore includes are wrappers around command line tools. For example, the MSBuild task, NUnit task, and NCoverConsole tasks are all set up to call out to a command line tool. These commandline tasks have a few common options that allow you to control how the command line is called.
All command line tasks provide a .command attribute to specify the location of the tool to be executed. The tool can be any arbitrary command line tool, including built-in system commands.
Example:
nunit :test do |nunit|
nunit.command = "tool/nunit-console.exe"
#... other options here
end
In order to make these tasks more flexible and capable of running with options that are not yet supported by the task configuration, directly, we have added a generic .parameters attribute to all tasks that run a command line tool. This will allows you to use any arbitrary parameters that you want, when calling the task. For example:
msbuild :build do |msb|
#... other options here
msb.parameters "i'm a parameter!", "/some:value", "/whatever=idontknow"
end
There are times when the tool that is being called needs to be executed from a specific working directory. For example, NUnit may need to be called from a certain working directory, so that it can correctly find all of the necessary assemblies. In cases like this, you can set the working directory of the commandline task.
nunit :unittests do |nunit|
nunit.working_directory = "src/tests/bin/release/"
#note: the .command is relative to the working directory
nunit.command = "tool/nunit-console.exe"
#note: for the NUnit task, the path to the assemblies
#is also relative to the working directory
nunit.assemblies "tests.dll"
end
Note that the .command setting is relative to the working directory. If you change the working directory, then you must specify the location of the command that is being executed, relative to the working directory.
Only the current task call will be executed in the specified working directory. In the above example, the working directory will be reset after the NUnit command is executed.
- Build-Server Integration
- Command Line Task Options
- Configuration
- Custom Tasks
- Logging Options
- Sample Usages
- Task Arguments and Rakefile Parameters
- YAML Configuration
- ASP.NET Compiler - ASP.Net website compiler
- Assembly Info Generator - generate assembly info dynamically
- CSC - C# compiler
- Exec - Execute arbitrary cmd
- Fluent Migrator - Run FluentMigrator on migration library
- ILMerge - Merge dll/exe-s together
- MSBuild and XBuild - Compile a .sln-file or a MsBuild xml-file
- MSpec - Test using MSpec (machine.specifications)
- MSTest - Test using Microsoft Test Framework
- NAnt - Run a NAnt script
- NChurn - Calculate per-file churn
- NCover Console - Run NCover for tests/library
- NCover Reports - Generate a report from a coverage run
- NDepend - Run NDepend to check static code metrics
- NuGet Install - Install NuGet packages
- NuGet Pack - Create NuGet packages
- NuGet Push - Push NuGet packages to official MS repo
- NuGet Publish - Publish NuGet packages
- NUnit - Test using NUnit
- NuSpec - Generate a NuSpec file
- Output - File copying and template expansion
- PLink - SSH into a remote computer and run a command
- SQLCmd - Run a SQL command as a part of your build process
- UnZip - Unzip a directory
- XBuild - Run XBuild (will be merged into MsBuild)
- XUnit - Test using XUnit
- Zip - Zip a directory or files
- Edit the Wiki Locally - How to edit the wiki without using Github's interface
- How to Build Albacore
- How to Contribute