Skip to content

Instantly share code, notes, and snippets.

View jmarolf's full-sized avatar

Jonathon Marolf jmarolf

View GitHub Profile
@jmarolf
jmarolf / Async_in_expressions_and_other_bad_ideas.md
Last active February 23, 2022 18:32
Task-like type member access operator

Task-like type member access operator

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
  • Specification: Not Started

Summary

@jmarolf
jmarolf / compile-time-build.rsp
Created January 26, 2022 22:59
design-time-build vs. compile-time-build
# Compiler Arguments
/analyzer:..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll
/analyzer:..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.NetAnalyzers.dll
/analyzerconfig:D:\scratch\build\..\out\VisualStudioIntellisenseErrors\obj\Debug\VisualStudioIntellisenseErrors.GeneratedMSBuildEditorConfig.editorconfig
/analyzerconfig:D:\scratch\src\.editorconfig
/debug:full
/debug+
/define:DEBUG;TRACE
/deterministic+
/errorreport:prompt
@jmarolf
jmarolf / gist:bd76ade8201866cdb7b0adbb58b1a4a3
Last active October 31, 2021 21:40
CI Test Run PICT Model
Configuration : Debug, Release
OS: macOS, Windows, Linux
Bitness: amd64, x86, arm64
Runtime : Core, Framework
IF [OS] = "macOS" OR [OS] = "Linux" THEN [Runtime] = "Core";
IF [OS] = "macOS" OR [OS] = "Linux" THEN [Configuration] = "Debug";
IF [OS] = "Windows" AND [Bitness] = "x86" THEN [Configuration] = "Release";
IF [Runtime] = "Core" THEN [Bitness] <> "x86";
IF [OS] = "Windows" OR [OS] = "Linux" THEN [Bitness] <> "arm64";

dotnet format commands

Note: implicit in this doc is that we keep the name format as the root command.

Whitespace

Command Format: dotnet format <workspace> --fix-whitespace

Fixes whitespace only. Just looks at files and folders

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
Imports System
Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports Microsoft.Build.Locator
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.VisualBasic
Imports Microsoft.CodeAnalysis.VisualBasic.Symbols
@jmarolf
jmarolf / ConsoleApplication.csproj
Created August 26, 2018 04:03
Microsoft.CodeAnalysis.Workspaces.MSBuild example
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
<LangVersion>Latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Locator" Version="1.0.18" />

build.ps1 -build -sign -pack:

  • Build-Artifacts
    • Run-MSBuild "Roslyn.sln" "/p:DeployExtension=false"
    • Build-ExtraSignArtifacts
    • Build-NuGetPackages
    • Run-SignTool
    • Build-InsertionItems

build.ps1 -build:

  • Build-Artifacts