Giter Site home page Giter Site logo

kittitas's Introduction

Kittitas - Roslyn compiler host

Kittitas is a dotnet global tool that hosts the Roslyn and MSBuild APIs in a single process, making it easier to debug components that run in the roslyn compiler pipeline, such as Analyzers and Source Generators.

Nuget GitHub

Installation

Kittitas is distributed as a dotnet global tool. Simply run the following command to install:

dotnet tool install --global kittitas --version 0.0.5-alpha

Usage

Either pass the name of the project you want to build:

dotnet kittitas <projectFile.csproj>

Or run kittitas from a directory containing a single .csproj

cd projectDir
dotnet kittitas

Kittitas supports options that make attaching a debugger easier. Run dotnet kittitas --help to see a full list of options.

Usage:
  Kittitas [options] [<ProjectFile>]

Arguments:
  <ProjectFile>    The project file to build, or empty to build from the current directory. [default: ]

Options:
  -w, --wait        Waits for a debugger to attach before continuing [default: False]
  -a, --attach      Attempts to attach a debugger before continuing [default: False]
  --version         Show version information
  -?, -h, --help    Show help and usage information

Kittitas.SDK

Kittitas include an MSBuild SDK designed to make running Kittitas from Visual Studio easier.

To use the SDK, create an empty .csproj alongside the project you want to run Kittitas on. Add the following contents into the newly created project file:

<Project Sdk="Kittitas.SDK/0.0.5-alpha">
  <ItemGroup>
    <LaunchProject Include="YourApp.csproj" />
  </ItemGroup>
</Project>

Replacing YourApp.csproj with the path to the project you want to run Kittitas with.

This will create a launchSettings.json under the hood that is configured to start Kittitas with the specified project. Selecting the newly added project as the startup project will add a DebugRoslynComponent debug target.

DebugRoslynComponent debug target inside Visual Studio 2019

This will run Kittitas against the specified project, without actually building anything first, allowing you to debug the build process itself.

FAQs

Whats the difference between this and dotnet build / mbuild.exe / csc.exe: Kittitas isn't designed to replace builds performed by the regular tools, but as a supplementary tool to make it easier to debug components that run inside of them.

Where is the output?: Kittitas doesn't currently produce any output, all compilation is performed in-memory.

Why are builds slower?: Kittitas doesn't use the compiler server or parallel build nodes; by design everything runs in a single process to make debugging easier.

My build failed under Kittitas: Kittitas uses the MSBuild and Roslyn APIs with defaults and without any particular intelligence. Customized or complicated projects may cause the build to fail. Please file an issue or PR if you come across a project that fails under Kittitas.

Why the custom SDK / empty project?: Visual Studio will build an out of date project before launching it in the debugger. Roslyn components (especially source generators) can themselves cause build failures, leading to a chicken and egg situation where you want to debug the failing component but can't start Kittitas because of the failure you want to debug. The Kittitas SDK removes all build targets from the empty project, meaning it will always successfully 'build' instantaneously, and allow you to debug the build of the project you're actually interested in.

Whats with the name?: Kittitas is the name of the county in WA that contains Roslyn. Get it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.