I wanted to use dotnet cli build command to build dotnet core project. I found that vim already has a compiler script for msbuild. Though dotnet build command internally calls msbuild, I did not want to use the msbuild compiler script. So I made some modification to the msbuild.vim script and made dotnet.vim compiler script -
" Vim compiler file
" Compiler: Microsoft Visual Studio C#
" Maintainer: Chiel ten Brinke (ctje92@gmail.com)
" Last Change: 2013 May 13
if exists("current_compiler")
finish
endif
let current_compiler = "dotnet"
let s:keepcpo= &cpo
set cpo&vim
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal
endif
CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m,%-G%.%#
CompilerSet makeprg=dotnet\ build\ --nologo\ --no-restore\ /clp:NoSummary
let &cpo = s:keepcpo
unlet s:keepcpo
I copied it in ~\vimfiles\compiler folder. And now to use is I just call :compiler dotnet followed by :make.