Skip to content

Task properties

Andy James edited this page Jun 26, 2020 · 1 revision

Currently, the tasks file (dotnet-tasks.yml) is made up only of a single property tasks - an array of tasks. Each task has a number of properties.

Name

required string

This is the name of the task. This will be used to run it when using dotnet do <task-name>. The task name is case insensitive but should not contain spaces.

 - name: run

You can specify more than one name for a single task, and any of them can be used to run the task via dotnet do <task-name>. Do this by using a multiline string for the value, with a task name on each line.

 - name: |
     run
     start

Description

string

This is an optional property to give a description for the task such as it's purpose or anecdotes on how it works. We can

  description: Build and run the LinqEm frontend client.

Run

string

Add to this property the shell command(s) you'd like to execute when this task is run.

  run: dotnet run --environment Development

You may specify a multiline value, when specifying a multiline value each line is executed in order at the working directory.

  run: |
    dotnet clean --configuration Release
    dotnet build --configuration Release

Working Directory

string

Use this property to enforce a specific folder being the working directory for the shell commands specified in the run property. This can be either a rooted, absolute path (starting with either / on unix or *:\ on Windows), or it can be a path relative to the location of the tasks file (dotnet-tasks.yml). Where possible a relative path should be used.

Relative path

  working-directory: src/

Absolute path:

  working-directory: /home/me/dev/linqem/src/
Clone this wiki locally