This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BuildData | |
{ | |
public string TaskName { get; set; } | |
} | |
Setup(context => new BuildData()); | |
TaskSetup<BuildData>( | |
(context, data) => data.TaskName = context.Task.Name | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Tt]ools/ | |
[Aa]rtifacts/ | |
[Oo]bj/ | |
[Bb]in/ | |
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task("BOOM") | |
.Does(() => throw new Exception("BOOM")); | |
Teardown(ctx => { | |
for(var i = 1; i <= 15; i++) | |
{ | |
Information("Teardown {0}", i); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$CakeVersion = "0.34.1" | |
if (![string]::IsNullOrWhiteSpace($env:CAKE_VERSION)) | |
{ | |
$CakeVersion = $env:CAKE_VERSION | |
} | |
$IsRunningOnUnix = [System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Unix | |
# Make sure tools folder exists | |
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent | |
$ToolPath = Join-Path $PSScriptRoot "tools" | |
if (!(Test-Path $ToolPath)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Switch expression | |
static string ToLevel(this Verbosity verbosity) | |
=> verbosity switch | |
{ | |
Verbosity.Diagnostic => "[****]", | |
Verbosity.Verbose => "[*** ]", | |
Verbosity.Normal => "[** ]", | |
Verbosity.Minimal => "[* ]", | |
Verbosity.Quiet => "[ ]", | |
_ => throw new ArgumentOutOfRangeException(message: "invalid enum value", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExecBase = 4 ;location of the exec.lib | |
OpenLib = -552 ;offset to the openLibrary function | |
OpenLibVersion = 34 ;minimum version to use | |
CloseLib = -414 ;offset to closeLibrary function | |
PutString = -948 ;offset to putStr() function | |
MOVE.L #OpenLibVersion,D0 ;place version of lib in data reg 0 | |
LEA DosName,A1 ;place dos.lib name into add reg 1 | |
MOVE.L ExecBase,A6 ;point to exec.lib's jump table | |
JSR OpenLib(A6) ;make the jump from exec.lib jump table | |
TST.L D0 ;check to see if D0 equals zero (fail) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "AsyncHelper.cake" | |
#r "System.Net.Http" | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
string url = "https://icanhazdadjoke.com/"; | |
var result = AsyncHelpers.RunSync( | |
async ()=> { | |
using(var client = new HttpClient()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DirectoryPath projectPath = MakeAbsolute(Directory("./cscTest")); | |
DirectoryPath outputPath = projectPath.Combine("bin/Debug"); | |
FilePath asssemblyPath = outputPath.CombineWithFilePath("Test.dll"), | |
symbolsPath = outputPath.CombineWithFilePath("Test.pdb"); | |
FilePath[] references = new FilePath[0]; // add any assembly dependencies | |
Task("Clean") | |
.Does(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp1.1</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" /> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var taskA = Task("A") | |
.Does(()=>Information("Hello from A")); |
NewerOlder