

Task Runner Explorer in Visual Studio for Mac
source link: https://lastexitcode.com/blog/2019/01/04/TaskRunnerExplorerInVisualStudioMac/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The Task Runner Explorer addin provides a Task Runner Explorer window, similar to the one in Visual Studio on Windows, which can be used to run tasks with Cake, Gulp, Grunt, NPM and TypeScript.
Features
Task Runner Explorer Window
- View tasks
- Run tasks
- View task output
- Run and cancel long running tasks, such as tcs watch
Configure tasks to run when specific IDE events occur
- Before Build
- After Build
- Clean
- Project Opened
- Solution Opened
Task Runners
- Grunt
- TypeScript
Supports
- Visual Studio Mac 7.5 or later.
Task Runner Explorer
To open the Task Runner Explorer window, from the View menu select Pads, then select Task Runner Explorer.
The Task Runner Explorer will look for files supported by a task runner in the solution directory and the project directory. It will also look at all files that have been added to a project or that have been added to a solution folder.
The top left of the Task Runner Explorer shows a list of projects or the solution that have tasks available. This can be used to filter the tasks shown in the Task Runner Explorer window.
Currently changes made to tasks will not be detected automatically. To refresh the task information you can click the Refresh button available at the top left of the Task Runner Explorer window.
Running a Task
To run a task you can double click it or right click and select Run.
Output from the task is shown on the right hand side of the Task Runner Explorer window.
A long running task, such as tcs watch, will run until the solution is closed, or the Stop button, available on the right hand side of the Task Runner Explorer window, is clicked.
Binding Tasks to IDE Events
Tasks can be configured to run when the following IDE events occur:
- After Build
- Before Build
- Clean
- Project or Solution Opened
If the task runner file is in a project directory then the build and clean events are associated with the project. If the task runner file is in a solution directory then the build events are associated with the solution.
To configure a task, right click it, select Bindings and then select the event.
The binding will be displayed in the Bindings tab and will also be shown as checked when the context menu for the task is opened.
To remove the binding you can right click the task, select Bindings and select the event again to uncheck it. Alternatively you can right click it in the Bindings tab and select Remove.
The order in which the tasks are run for a particular IDE event can be changed by right clicking the binding in the Bindings tab and selecting Move Up or Move Down.
The binding information is typically saved in a file in the same directory as the corresponding task runner file, however this depends on how the task runner is implemented.
Disabling Automatic Running of Tasks
In preferences there is a Task Runner Explorer section which shows a check box that can be used to enable or disable the automatic running of tasks on opening a project or solution, and when building or cleaning.
Cake Task Runner
The Cake task runner supports running tasks defined in a build.cake file.
This is based on the Cake Task Runner for Visual Studio.
Gulp Task Runner
The Gulp task runner supports running tasks defined in a gulpfile.js file.
Gulp needs to be installed separately.
Grunt Task Runner
The Grunt task runner supports running tasks defined in a Gruntfile.js file.
Grunt needs to be installed separately.
NPM Task Runner
The NPM task runner supports running tasks defined in a package.json file.
The NPM task runner is a port of Mads Kristensen’s NPM Task Runner.
The NPM task runner supports running with the verbose NPM option defined. If a
task is selected then a button will be displayed on the left hand side of the
Task Runner Explorer window. If this is selected then npm will be passed the
-d
argument when it is run.
NPM needs to be installed separately.
TypeScript Task Runner
The TypeScript task runner supports running tcs build and tcs watch if a tsconfig.json file is found.
The TypeScript task runner will try to use tsc that is distributed with the Web Tools extension that is included in Visual Studio for Mac. If the Web Tools extension is not installed then the task runner will fall back to running tsc directly.
Installation
There are two addins to be installed:
The Task Runner is the main addin. This will be used by other task runner addins and provides the main task runner API and services.
The Task Runners Bundle addin contains the Cake, Gulp, Grunt, NPM and TypeScript task runners. These are currently included together as a single addin instead of being distributed separately.
Download both of the above .mpack files. Install the Task Runner addin first since the Task Runners Bundle addin depends on it. To install an addin’s .mpack file, open the Extensions Manager by selecting Extensions… from the main menu. Click the Install from file button. Select the .mpack file and then click the Open button. After installing both the addins restart Visual Studio for Mac.
These addins are not currently available from the main Visual Studio for Mac extensions server.
Source Code
Recommend
-
71
Realize - Golang Task Runner
-
70
Today we’ll talk about a miscomfort that has been echoing in my head since a while ago: Task runners fatigue . We’ve come accross Grunt, Gradle, Gulp, NPM scripts, then rediscovered makefiles,...
-
14
Live in 2 daysJanuary 9, 6:00 AM ...
-
12
Advanced Basics: Using Task Runner in Visual Studio 2019 If the world is running on JavaScript, why not automate your client-side tasks through Visual Studio's Task Runner? Written by Jonathan Danylko • Last Updated: Janu...
-
10
Code Runner,率先支持刚发布的 Visual Studio 2022! Visual Studio 被不少网友...
-
11
Emacs Taskrunner This is an elisp library which aims to provide a way to retrieve all of the tasks/targets from various build systems and execute them in a compilation buffer. The ultimate goal is to use this library to prov...
-
8
Task Runner Gulp Update in Visual Studio After looking over my Gulp script, it definitely required some updates. In this post, I review what's required to update it to the latest version Written by Jonathan "JD" Dany...
-
5
Introducing the MSTest Runner – CLI, Visual Studio, & More Amaury Le...
-
8
Introducing the MSTest Runner – CLI, Visual Studio, & More Amaury Le...
-
8
原文 | Amaury Levé, Marco Rossignoli, Jakub Jareš 翻译 | 郑子铭 我们很高兴推出 MSTest runner,这是一个用于 MSTest 测试的新型轻量级运行程序。这个新的运行程序使测试更加便携和可靠,使测试运行得更快,并且可扩展,为您提供点菜测试体验,以...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK