As described on my blog this project was a temporary solution for enabling IntelliSense support for Cake scripts. As the official support made its way to the OmniSharp repository, there is no point in keeping this code alive anymore.
Cake and Cake addins metadata generator which provides partial intellisense support for Cake build scripts for omnisharp editors.
Cake.Intellisense.exe --help
Generate metadata for Cake.Common 0.19.2
targeting .NETFramework,Version=v4.5
and push the result to C:\Output
Cake.Intellisense.exe --Package Cake.Common --PackageVersion 0.19.2 --TargetFramework .NETFramework,Version=v4.5 --OutputFolder C:\Output
Generate metadata for newest version of Cake.Common
targeting .NETFramework,Version=v4.5
and push the result to C:\Output
Cake.Intellisense.exe --Package Cake.Common --TargetFramework .NETFramework,Version=v4.5 --OutputFolder C:\Output
Generate metadata for newest version of Cake.Common
targeting .NETFramework,Version=v4.5
and push the result to current executing directory
Cake.Intellisense.exe --Package Cake.Common --TargetFramework .NETFramework,Version=v4.5
Generate metadata for newest version of Cake.Common
and let me choose framework version
Cake.Intellisense.exe --Package Cake.Common
- Add project.json file with empty JSON object into your build directory.
- Rename your
build.cake
script tobuild.csx
. - Copy metadata libraries somewhere into Build directory
- Create
imports.csx
file. This is the file which holds all original namespace imports. It may look as follows
#load "./metadataImports.csx"
using Cake.Core;
using Cake.Core.IO;
using Cake.Common;
...
...
- Create
metadataimports.csx
file. This is the file which holds metadata imports and loads cake and metadata references.
#r "./tools/Cake/Cake.Core.dll"
#r "./tools/Cake/Cake.Common.dll"
#r "./tools/Cake.Metadata/Cake.Core.Metadata.dll"
#r "./tools/Cake.Metadata/Cake.Common.Metadata.dll"
using static Cake.Common.ArgumentAliasesMetadata;
using static Cake.Common.EnvironmentAliasesMetadata;
...
...
...
- Load
imports.csx
to yourbuild.csx
file via#load "./imports.csx"
- Run
VSCode
install ms-vscode.csharp 1.7.0, open Build directory and write your build script with intellisense support - Before running the script remember to comment out
#load "./metadataImports.csx"
fromimports.csx
file - Run build pointing to build.csx file
build.ps1 -script build.csx -target Your-Target
Refer to my build scripts if you have any troubles
- Cake.Intellisense can only generate metadata libraries for standard .NET frameworks, it will fail if you try to create metadata targeting .NETStandard or .NET core framework
- Due to some breaking changes in Omnisharp-Roslyn scripting support, intellisense will work only with Omnisharp 1.7.0