Skip to content

Instantly share code, notes, and snippets.

@bjorkstromm
Last active October 17, 2017 19:30
Show Gist options
  • Save bjorkstromm/3ac58729ee308f5c5c52746d52940f9c to your computer and use it in GitHub Desktop.
Save bjorkstromm/3ac58729ee308f5c5c52746d52940f9c to your computer and use it in GitHub Desktop.
Setting up Cake OmniSharp Bakery
  1. Clone Omnisharp Roslyn and build that
git clone https://github.com/cake-build/omnisharp-roslyn

cd omnisharp-roslyn

git checkout feature/cake

.\build.ps1 -Target Quick
  1. Clone Omnisharp VS Code and build that
git clone https://github.com/cake-build/omnisharp-vscode

cd omnisharp-vscode

git checkout feature/cake

npm i; npm run compile
  1. Prepare test project for usage. Create .vscode/settings.json with following content. I.e. we want Omnisharp VS Code to launch our custom build of Omnisharp Roslyn.
{
  "omnisharp.path": "path\\to\\omnisharp-roslyn\\artifacts\\publish\\OmniSharp.Stdio\\win7-x64\\OmniSharp.exe",
  "omnisharp.loggingLevel": "trace"
}
  1. Create tools\packages.config and add following content.
<packages>
    <package id="Cake" version="0.22.2" />
    <package id="Cake.Bakery" version="0.1.0-unstable0113" />
</packages>
  1. nuget restore from source https://www.myget.org/F/cake/api/v3/index.json
  2. Create your build.cake
  3. Open up the omnisharp-vscode project in VS Code. Press F5 to launch. In the newly opened window, open up your test project.
  4. Open your build.cake.
  5. You should see some output from Omnisharp.

Example project found here: https://github.com/mholo65/cake-omnisharp-bakery-example

Pro-tip: If you like to avoid having to do step 7., you can create a VSIX package from the VSCode extension and simply install that to VS Code. To generate a VSIX package simply append node_modules\.bin\gulp package:online to step 2..

@Julien-Mialon
Copy link

Steps for Mac OS X

  1. Clone Omnisharp Roslyn and build that
git clone https://github.com/cake-build/omnisharp-roslyn

cd omnisharp-roslyn

git checkout feature/cake

mkdir -p artifacts/logs
mkdir -p artifacts/scripts
./build.sh --target BuildHosts
./build.sh --target PublishMonoBuilds
  1. Clone Omnisharp VS Code and build that
git clone https://github.com/cake-build/omnisharp-vscode

cd omnisharp-vscode

git checkout feature/cake

npm i; npm run compile
  1. Prepare test project for usage. Create .vscode/settings.json with following content. I.e. we want Omnisharp VS Code to launch our custom build of Omnisharp Roslyn.
{
    "omnisharp.loggingLevel": "trace",
    "omnisharp.useMono": true,
    "omnisharp.path": "/path/to/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio/mono/OmniSharp.exe"
}
  1. Create tools\packages.config and add following content.
<packages>
    <package id="Cake" version="0.22.2" />
    <package id="Cake.Bakery" version="0.1.0-unstable0113" />
</packages>
  1. nuget restore from source https://www.myget.org/F/cake/api/v3/index.json
  2. rename Cake.Bakery.0.1.0-unstable0113 directory to cake.bakery.0.1.0-unstable0113 (with lowercase for cake.bakery)
  3. Create your build.cake
  4. Open up the omnisharp-vscode project in VS Code. Press F5 to launch. In the newly opened window, open up your test project.
  5. Open your build.cake.
  6. You should see some output from Omnisharp.

Example project found here:
https://github.com/mholo65/cake-omnisharp-bakery-example

Pro-tip:
If you like to avoid having to do step 8., you can create a VSIX package from the VSCode extension and simply install that to VS Code. To generate a VSIX package simply append node_modules\.bin\gulp package:online to step 2..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment