diff --git a/Cake.Frosting.Example/Properties/AssemblyInfo.cs b/Cake.Frosting.Example/Properties/AssemblyInfo.cs deleted file mode 100644 index 761316033b..0000000000 --- a/Cake.Frosting.Example/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cake.Frosting.Example")] -[assembly: AssemblyProduct("Cake.Frosting")] -[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ed379398-da69-4d1e-b712-27dc0d67abc3")] diff --git a/Cake.Frosting.Tests/Properties/AssemblyInfo.cs b/Cake.Frosting.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 9058e00f44..0000000000 --- a/Cake.Frosting.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6948279d-7066-4707-902d-2d105fe61e6c")] diff --git a/Cake.Frosting.sln b/Cake.Frosting.sln deleted file mode 100644 index aece9a67e0..0000000000 --- a/Cake.Frosting.sln +++ /dev/null @@ -1,83 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30204.135 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Frosting", "Cake.Frosting\Cake.Frosting.csproj", "{A608FD39-2B71-4B6E-B238-AE80BB2794F8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Frosting.Example", "Cake.Frosting.Example\Cake.Frosting.Example.csproj", "{ED379398-DA69-4D1E-B712-27DC0D67ABC3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example", "Example", "{8BFACDC8-8BBF-4751-BB54-85B0D28A61A2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Frosting.Tests", "Cake.Frosting.Tests\Cake.Frosting.Tests.csproj", "{F6A8095C-E2B6-4D8B-88A1-213376387FD5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "..\build\Build.csproj", "{A117400E-6E1A-4FB0-9BD8-E298ED331FAC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Debug|x64.ActiveCfg = Debug|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Debug|x64.Build.0 = Debug|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Debug|x86.ActiveCfg = Debug|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Debug|x86.Build.0 = Debug|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Release|Any CPU.Build.0 = Release|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Release|x64.ActiveCfg = Release|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Release|x64.Build.0 = Release|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Release|x86.ActiveCfg = Release|Any CPU - {A608FD39-2B71-4B6E-B238-AE80BB2794F8}.Release|x86.Build.0 = Release|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Debug|x64.ActiveCfg = Debug|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Debug|x64.Build.0 = Debug|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Debug|x86.ActiveCfg = Debug|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Debug|x86.Build.0 = Debug|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Release|Any CPU.Build.0 = Release|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Release|x64.ActiveCfg = Release|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Release|x64.Build.0 = Release|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Release|x86.ActiveCfg = Release|Any CPU - {ED379398-DA69-4D1E-B712-27DC0D67ABC3}.Release|x86.Build.0 = Release|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Debug|x64.ActiveCfg = Debug|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Debug|x64.Build.0 = Debug|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Debug|x86.ActiveCfg = Debug|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Debug|x86.Build.0 = Debug|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Release|Any CPU.Build.0 = Release|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Release|x64.ActiveCfg = Release|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Release|x64.Build.0 = Release|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Release|x86.ActiveCfg = Release|Any CPU - {F6A8095C-E2B6-4D8B-88A1-213376387FD5}.Release|x86.Build.0 = Release|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Debug|x64.ActiveCfg = Debug|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Debug|x64.Build.0 = Debug|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Debug|x86.ActiveCfg = Debug|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Debug|x86.Build.0 = Debug|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Release|Any CPU.Build.0 = Release|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Release|x64.ActiveCfg = Release|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Release|x64.Build.0 = Release|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Release|x86.ActiveCfg = Release|Any CPU - {A117400E-6E1A-4FB0-9BD8-E298ED331FAC}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {ED379398-DA69-4D1E-B712-27DC0D67ABC3} = {8BFACDC8-8BBF-4751-BB54-85B0D28A61A2} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {34EDB4FC-F467-4967-9101-D7027C4EC6CE} - EndGlobalSection -EndGlobal diff --git a/Cake.Frosting/Properties/AssemblyInfo.cs b/Cake.Frosting/Properties/AssemblyInfo.cs deleted file mode 100644 index 9d033b0f6d..0000000000 --- a/Cake.Frosting/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cake.Frosting")] -[assembly: AssemblyProduct("Cake.Frosting")] -[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a608fd39-2b71-4b6e-b238-ae80bb2794f8")] \ No newline at end of file diff --git a/Shared.msbuild b/Shared.msbuild deleted file mode 100644 index 3a9a847337..0000000000 --- a/Shared.msbuild +++ /dev/null @@ -1,44 +0,0 @@ - - - 0.1.0 - $(AssemblyName) - Copyright (c) .NET Foundation and contributors - Patrik Svensson, Mattias Karlsson, Gary Ewan Park, Alistair Chapman, Martin Björkström, Dave Glick, Pascal Berger, Jérémie Desautels, Enrico Campidoglio and contributors - Patrik Svensson, Mattias Karlsson, Gary Ewan Park, Alistair Chapman, Martin Björkström, Dave Glick, Pascal Berger, Jérémie Desautels, Enrico Campidoglio and contributors - MIT - cake-medium.png - https://raw.githubusercontent.com/cake-build/graphics/master/png/cake-medium.png - Cake;Script;Build - https://cakebuild.net - https://github.com/cake-build/frosting.git - git - false - false - false - true - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - true - - - - $(DefineConstants);NETCORE - portable - - - - ../ - ../../ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.cake b/build.cake index 6a3a1a6cbd..bb68adfdd9 100644 --- a/build.cake +++ b/build.cake @@ -295,11 +295,11 @@ Task("Create-NuGet-Packages") .Does((context, parameters) => { // Build libraries - var projects = GetFiles("./src/**/*.csproj"); + var projects = GetFiles("./src/*/*.csproj"); foreach(var project in projects) { var name = project.GetDirectory().FullPath; - if(name.EndsWith("Cake") || name.EndsWith("Tests")) + if(name.EndsWith("Cake") || name.EndsWith("Tests") || name.EndsWith("Example")) { continue; } diff --git a/build/parameters.cake b/build/parameters.cake index 4393ca96b3..f6c090a841 100644 --- a/build/parameters.cake +++ b/build/parameters.cake @@ -113,6 +113,11 @@ public class BuildParameters .WithProperty("AssemblyVersion", Version.Version) .WithProperty("FileVersion", Version.Version) .WithProperty("PackageReleaseNotes", string.Concat("\"", releaseNotes, "\"")); + + if (!IsLocalBuild) + { + MSBuildSettings.WithProperty("TemplateVersion", Version.SemVersion); + } } private static bool IsBuildTagged(BuildSystem buildSystem) diff --git a/Cake.Frosting.Example/Cake.Frosting.Example.csproj b/src/Cake.Frosting.Example/Cake.Frosting.Example.csproj similarity index 93% rename from Cake.Frosting.Example/Cake.Frosting.Example.csproj rename to src/Cake.Frosting.Example/Cake.Frosting.Example.csproj index 0f4f821718..7d8884ead1 100644 --- a/Cake.Frosting.Example/Cake.Frosting.Example.csproj +++ b/src/Cake.Frosting.Example/Cake.Frosting.Example.csproj @@ -1,6 +1,6 @@  - net461;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0 + net461;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;net5.0 Cake.Frosting.Example Exe 7 diff --git a/Cake.Frosting.Example/Program.cs b/src/Cake.Frosting.Example/Program.cs similarity index 100% rename from Cake.Frosting.Example/Program.cs rename to src/Cake.Frosting.Example/Program.cs diff --git a/Cake.Frosting.Example/Settings.cs b/src/Cake.Frosting.Example/Settings.cs similarity index 100% rename from Cake.Frosting.Example/Settings.cs rename to src/Cake.Frosting.Example/Settings.cs diff --git a/Cake.Frosting.Example/Tasks.cs b/src/Cake.Frosting.Example/Tasks.cs similarity index 100% rename from Cake.Frosting.Example/Tasks.cs rename to src/Cake.Frosting.Example/Tasks.cs diff --git a/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj b/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj new file mode 100644 index 0000000000..205829e861 --- /dev/null +++ b/src/Cake.Frosting.Template/Cake.Frosting.Template.csproj @@ -0,0 +1,30 @@ + + + + Template + Cake.Frosting.Template + Cake.Frosting templates for the .NET SDK. + Cake.Frosting templates for the .NET SDK. + netcoreapp3.1 + + true + false + content + NU5110;NU5111;NU5128 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Cake.Frosting.Template/build.ps1 b/src/Cake.Frosting.Template/build.ps1 new file mode 100644 index 0000000000..90d183fc2c --- /dev/null +++ b/src/Cake.Frosting.Template/build.ps1 @@ -0,0 +1,70 @@ +#!/usr/bin/env pwsh +$DotNetInstallerUri = 'https://dot.net/v1/dotnet-install.ps1'; +$DotNetUnixInstallerUri = 'https://dot.net/v1/dotnet-install.sh' +$DotNetChannel = 'LTS' +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +[string] $DotNetVersion= '' +foreach($line in Get-Content (Join-Path $PSScriptRoot 'build.config')) +{ + if ($line -like 'DOTNET_VERSION=*') { + $DotNetVersion =$line.SubString(15) + } +} + + +if ([string]::IsNullOrEmpty($DotNetVersion)) { + 'Failed to parse .NET Core SDK Version' + exit 1 +} + +$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1"; + +# Make sure tools folder exists +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +$ToolPath = Join-Path $PSScriptRoot "tools" +if (!(Test-Path $ToolPath)) { + Write-Verbose "Creating tools directory..." + New-Item -Path $ToolPath -Type directory | out-null +} + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### + +Function Remove-PathVariable([string]$VariableToRemove) +{ + $path = [Environment]::GetEnvironmentVariable("PATH", "User") + $newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") + $path = [Environment]::GetEnvironmentVariable("PATH", "Process") + $newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") +} + +# Get .NET Core CLI path if installed. +$FoundDotNetCliVersion = $null; +if (Get-Command dotnet -ErrorAction SilentlyContinue) { + $FoundDotNetCliVersion = dotnet --version; +} + +if($FoundDotNetCliVersion -ne $DotNetVersion) { + $InstallPath = Join-Path $PSScriptRoot ".dotnet" + if (!(Test-Path $InstallPath)) { + mkdir -Force $InstallPath | Out-Null; + } + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1"); + & $InstallPath\dotnet-install.ps1 -Version $DotNetVersion -InstallDir $InstallPath; + + Remove-PathVariable "$InstallPath" + $env:PATH = "$InstallPath;$env:PATH" + $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 +} + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### + +dotnet run --project build/Build.csproj -- $args +exit $LASTEXITCODE; \ No newline at end of file diff --git a/src/Cake.Frosting.Template/build.sh b/src/Cake.Frosting.Template/build.sh new file mode 100644 index 0000000000..bd9974b730 --- /dev/null +++ b/src/Cake.Frosting.Template/build.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Define varibles +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +source $SCRIPT_DIR/build.config + +if [ "$DOTNET_VERSION" = "" ]; then + echo "An error occured while parsing .NET Core SDK version." + exit 1 +fi + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0 +export DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 + +DOTNET_INSTALLED_VERSION=$(dotnet --version 2>&1) + +if [ "$DOTNET_VERSION" != "$DOTNET_INSTALLED_VERSION" ]; then + echo "Installing .NET CLI..." + if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then + mkdir "$SCRIPT_DIR/.dotnet" + fi + curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh + bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path + export PATH="$SCRIPT_DIR/.dotnet":$PATH + export DOTNET_ROOT="$SCRIPT_DIR/.dotnet" +fi + +########################################################################### +# RUN BUILD SCRIPT +########################################################################### + +echo "Running build script.." +dotnet run --project ./build/Build.csproj -- "$@" diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/.template.config/template.json b/src/Cake.Frosting.Template/templates/cakefrosting/.template.config/template.json new file mode 100644 index 0000000000..74cf6f30b8 --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/.template.config/template.json @@ -0,0 +1,11 @@ +{ + "author": "Patrik Svensson (patrik@patriksvensson.se)", + "classifications": [ "Cake", "Frosting" ], + "name": "Cake Frosting Build Script", + "identity": "Cake.Frosting", + "shortName": "cakefrosting", + "sourceName": "temp", + "tags": { + "language": "C#" + } +} \ No newline at end of file diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj b/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj new file mode 100644 index 0000000000..bdae2f0327 --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj @@ -0,0 +1,12 @@ + + + Exe + netcoreapp3.1 + true + + $(MSBuildProjectDirectory) + + + + + \ No newline at end of file diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Context.cs b/src/Cake.Frosting.Template/templates/cakefrosting/build/Context.cs new file mode 100644 index 0000000000..2e70b09a50 --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Context.cs @@ -0,0 +1,10 @@ +using Cake.Core; +using Cake.Frosting; + +public class Context : FrostingContext +{ + public Context(ICakeContext context) + : base(context) + { + } +} \ No newline at end of file diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Lifetime.cs b/src/Cake.Frosting.Template/templates/cakefrosting/build/Lifetime.cs new file mode 100644 index 0000000000..999f1e85ad --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Lifetime.cs @@ -0,0 +1,16 @@ +using Cake.Common.Diagnostics; +using Cake.Core; +using Cake.Frosting; + +public sealed class Lifetime : FrostingLifetime +{ + public override void Setup(Context context) + { + context.Information("Setting things up..."); + } + + public override void Teardown(Context context, ITeardownContext info) + { + context.Information("Tearing things down..."); + } +} \ No newline at end of file diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Program.cs b/src/Cake.Frosting.Template/templates/cakefrosting/build/Program.cs new file mode 100644 index 0000000000..a5c08a1052 --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Program.cs @@ -0,0 +1,24 @@ +using Cake.Core; +using Cake.Frosting; + +public class Program : IFrostingStartup +{ + public static int Main(string[] args) + { + // Create the host. + var host = new CakeHostBuilder() + .WithArguments(args) + .UseStartup() + .Build(); + + // Run the host. + return host.Run(); + } + + public void Configure(ICakeServices services) + { + services.UseContext(); + services.UseLifetime(); + services.UseWorkingDirectory(".."); + } +} \ No newline at end of file diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Tasks/Default.cs b/src/Cake.Frosting.Template/templates/cakefrosting/build/Tasks/Default.cs new file mode 100644 index 0000000000..7d2ab0b182 --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Tasks/Default.cs @@ -0,0 +1,6 @@ +using Cake.Frosting; + +[Dependency(typeof(Hello))] +public sealed class Default : FrostingTask +{ +} \ No newline at end of file diff --git a/src/Cake.Frosting.Template/templates/cakefrosting/build/Tasks/Hello.cs b/src/Cake.Frosting.Template/templates/cakefrosting/build/Tasks/Hello.cs new file mode 100644 index 0000000000..e01777b78e --- /dev/null +++ b/src/Cake.Frosting.Template/templates/cakefrosting/build/Tasks/Hello.cs @@ -0,0 +1,11 @@ +using Cake.Common.Diagnostics; +using Cake.Frosting; + +[TaskName("Hello")] +public sealed class Hello : FrostingTask +{ + public override void Run(Context context) + { + context.Information("Hello World"); + } +} \ No newline at end of file diff --git a/Cake.Frosting.Tests/Asserts/ExecptionAsserts.cs b/src/Cake.Frosting.Tests/Asserts/ExecptionAsserts.cs similarity index 95% rename from Cake.Frosting.Tests/Asserts/ExecptionAsserts.cs rename to src/Cake.Frosting.Tests/Asserts/ExecptionAsserts.cs index 2af8f2aa63..56adc8c596 100644 --- a/Cake.Frosting.Tests/Asserts/ExecptionAsserts.cs +++ b/src/Cake.Frosting.Tests/Asserts/ExecptionAsserts.cs @@ -12,7 +12,7 @@ public class AssertEx public static void IsArgumentNullException(Exception exception, string parameterName) { Assert.IsType(exception); - Assert.Equal(parameterName, ((ArgumentNullException) exception).ParamName); + Assert.Equal(parameterName, ((ArgumentNullException)exception).ParamName); } } } diff --git a/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj b/src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj similarity index 89% rename from Cake.Frosting.Tests/Cake.Frosting.Tests.csproj rename to src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj index d8f9f4fb1f..0847868292 100644 --- a/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj +++ b/src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj @@ -1,7 +1,7 @@ - net461;netcoreapp2.1;netcoreapp3.0 + net461;netcoreapp2.1;netcoreapp3.0;net5.0 7 @@ -9,6 +9,7 @@ + @@ -21,7 +22,6 @@ - diff --git a/Cake.Frosting.Tests/Data/DummyLifetime.cs b/src/Cake.Frosting.Tests/Data/DummyLifetime.cs similarity index 100% rename from Cake.Frosting.Tests/Data/DummyLifetime.cs rename to src/Cake.Frosting.Tests/Data/DummyLifetime.cs diff --git a/Cake.Frosting.Tests/Data/DummyModule.cs b/src/Cake.Frosting.Tests/Data/DummyModule.cs similarity index 100% rename from Cake.Frosting.Tests/Data/DummyModule.cs rename to src/Cake.Frosting.Tests/Data/DummyModule.cs diff --git a/Cake.Frosting.Tests/Data/DummyPackageInstaller.cs b/src/Cake.Frosting.Tests/Data/DummyPackageInstaller.cs similarity index 100% rename from Cake.Frosting.Tests/Data/DummyPackageInstaller.cs rename to src/Cake.Frosting.Tests/Data/DummyPackageInstaller.cs diff --git a/Cake.Frosting.Tests/Data/DummyStartup.cs b/src/Cake.Frosting.Tests/Data/DummyStartup.cs similarity index 100% rename from Cake.Frosting.Tests/Data/DummyStartup.cs rename to src/Cake.Frosting.Tests/Data/DummyStartup.cs diff --git a/Cake.Frosting.Tests/Data/DummyTask.cs b/src/Cake.Frosting.Tests/Data/DummyTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/DummyTask.cs rename to src/Cake.Frosting.Tests/Data/DummyTask.cs diff --git a/Cake.Frosting.Tests/Data/DummyTaskLifetime.cs b/src/Cake.Frosting.Tests/Data/DummyTaskLifetime.cs similarity index 100% rename from Cake.Frosting.Tests/Data/DummyTaskLifetime.cs rename to src/Cake.Frosting.Tests/Data/DummyTaskLifetime.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/BuildTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/BuildTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/BuildTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/BuildTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/CleanTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/CleanTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/CleanTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/CleanTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/ContinueOnErrorTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/ContinueOnErrorTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/ContinueOnErrorTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/ContinueOnErrorTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/FinallyTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/FinallyTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/FinallyTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/FinallyTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/InvalidDependencyTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/InvalidDependencyTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/InvalidDependencyTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/InvalidDependencyTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/NoContinueOnErrorTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/NoContinueOnErrorTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/NoContinueOnErrorTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/NoContinueOnErrorTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/OnErrorRunAsyncFailedTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/OnErrorRunAsyncFailedTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/OnErrorRunAsyncFailedTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/OnErrorRunAsyncFailedTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/OnErrorRunCompletedTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/OnErrorRunCompletedTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/OnErrorRunCompletedTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/OnErrorRunCompletedTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/OnErrorRunFailedTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/OnErrorRunFailedTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/OnErrorRunFailedTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/OnErrorRunFailedTask.cs diff --git a/Cake.Frosting.Tests/Data/Tasks/UnitTestsTask.cs b/src/Cake.Frosting.Tests/Data/Tasks/UnitTestsTask.cs similarity index 100% rename from Cake.Frosting.Tests/Data/Tasks/UnitTestsTask.cs rename to src/Cake.Frosting.Tests/Data/Tasks/UnitTestsTask.cs diff --git a/Cake.Frosting.Tests/Extensions/CakeEngineExtensions.cs b/src/Cake.Frosting.Tests/Extensions/CakeEngineExtensions.cs similarity index 100% rename from Cake.Frosting.Tests/Extensions/CakeEngineExtensions.cs rename to src/Cake.Frosting.Tests/Extensions/CakeEngineExtensions.cs diff --git a/Cake.Frosting.Tests/Fakes/FakeLifetime.cs b/src/Cake.Frosting.Tests/Fakes/FakeLifetime.cs similarity index 100% rename from Cake.Frosting.Tests/Fakes/FakeLifetime.cs rename to src/Cake.Frosting.Tests/Fakes/FakeLifetime.cs diff --git a/Cake.Frosting.Tests/Fakes/FakeTaskLifetime.cs b/src/Cake.Frosting.Tests/Fakes/FakeTaskLifetime.cs similarity index 100% rename from Cake.Frosting.Tests/Fakes/FakeTaskLifetime.cs rename to src/Cake.Frosting.Tests/Fakes/FakeTaskLifetime.cs diff --git a/Cake.Frosting.Tests/Fakes/NullConsole.cs b/src/Cake.Frosting.Tests/Fakes/NullConsole.cs similarity index 100% rename from Cake.Frosting.Tests/Fakes/NullConsole.cs rename to src/Cake.Frosting.Tests/Fakes/NullConsole.cs diff --git a/Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixture.cs b/src/Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixture.cs similarity index 100% rename from Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixture.cs rename to src/Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixture.cs diff --git a/Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixtureExtensions.cs b/src/Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixtureExtensions.cs similarity index 100% rename from Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixtureExtensions.cs rename to src/Cake.Frosting.Tests/Fixtures/CakeHostBuilderFixtureExtensions.cs diff --git a/Cake.Frosting.Tests/Unit/CakeHostBuilderTests.cs b/src/Cake.Frosting.Tests/Unit/CakeHostBuilderTests.cs similarity index 100% rename from Cake.Frosting.Tests/Unit/CakeHostBuilderTests.cs rename to src/Cake.Frosting.Tests/Unit/CakeHostBuilderTests.cs diff --git a/Cake.Frosting.Tests/Unit/CakeHostTests.cs b/src/Cake.Frosting.Tests/Unit/CakeHostTests.cs similarity index 100% rename from Cake.Frosting.Tests/Unit/CakeHostTests.cs rename to src/Cake.Frosting.Tests/Unit/CakeHostTests.cs diff --git a/Cake.Frosting.Tests/Unit/CakeOptionsTests.cs b/src/Cake.Frosting.Tests/Unit/CakeOptionsTests.cs similarity index 100% rename from Cake.Frosting.Tests/Unit/CakeOptionsTests.cs rename to src/Cake.Frosting.Tests/Unit/CakeOptionsTests.cs diff --git a/Cake.Frosting.Tests/Unit/Extensions/CakeHostBuilderExtensionsTests.cs b/src/Cake.Frosting.Tests/Unit/Extensions/CakeHostBuilderExtensionsTests.cs similarity index 99% rename from Cake.Frosting.Tests/Unit/Extensions/CakeHostBuilderExtensionsTests.cs rename to src/Cake.Frosting.Tests/Unit/Extensions/CakeHostBuilderExtensionsTests.cs index 37115b4973..cdb27b4437 100644 --- a/Cake.Frosting.Tests/Unit/Extensions/CakeHostBuilderExtensionsTests.cs +++ b/src/Cake.Frosting.Tests/Unit/Extensions/CakeHostBuilderExtensionsTests.cs @@ -188,8 +188,7 @@ public void Should_Parse_Working_Directory(string args, string expected) // Then services.Received(1).RegisterInstance( - Arg.Is(o => o.WorkingDirectory.FullPath == expected - )); + Arg.Is(o => o.WorkingDirectory.FullPath == expected)); } } } diff --git a/Cake.Frosting.Tests/Unit/Extensions/CakeServicesExtensionsTests.cs b/src/Cake.Frosting.Tests/Unit/Extensions/CakeServicesExtensionsTests.cs similarity index 100% rename from Cake.Frosting.Tests/Unit/Extensions/CakeServicesExtensionsTests.cs rename to src/Cake.Frosting.Tests/Unit/Extensions/CakeServicesExtensionsTests.cs diff --git a/Cake.Frosting/Abstractions/ICakeHost.cs b/src/Cake.Frosting/Abstractions/ICakeHost.cs similarity index 100% rename from Cake.Frosting/Abstractions/ICakeHost.cs rename to src/Cake.Frosting/Abstractions/ICakeHost.cs diff --git a/Cake.Frosting/Abstractions/ICakeHostBuilder.cs b/src/Cake.Frosting/Abstractions/ICakeHostBuilder.cs similarity index 100% rename from Cake.Frosting/Abstractions/ICakeHostBuilder.cs rename to src/Cake.Frosting/Abstractions/ICakeHostBuilder.cs diff --git a/Cake.Frosting/Abstractions/ICakeServices.cs b/src/Cake.Frosting/Abstractions/ICakeServices.cs similarity index 100% rename from Cake.Frosting/Abstractions/ICakeServices.cs rename to src/Cake.Frosting/Abstractions/ICakeServices.cs diff --git a/Cake.Frosting/Abstractions/ICakeTaskFinder.cs b/src/Cake.Frosting/Abstractions/ICakeTaskFinder.cs similarity index 100% rename from Cake.Frosting/Abstractions/ICakeTaskFinder.cs rename to src/Cake.Frosting/Abstractions/ICakeTaskFinder.cs diff --git a/Cake.Frosting/Abstractions/IFrostingContext.cs b/src/Cake.Frosting/Abstractions/IFrostingContext.cs similarity index 100% rename from Cake.Frosting/Abstractions/IFrostingContext.cs rename to src/Cake.Frosting/Abstractions/IFrostingContext.cs diff --git a/Cake.Frosting/Abstractions/IFrostingLifetime.cs b/src/Cake.Frosting/Abstractions/IFrostingLifetime.cs similarity index 100% rename from Cake.Frosting/Abstractions/IFrostingLifetime.cs rename to src/Cake.Frosting/Abstractions/IFrostingLifetime.cs diff --git a/Cake.Frosting/Abstractions/IFrostingStartup.cs b/src/Cake.Frosting/Abstractions/IFrostingStartup.cs similarity index 100% rename from Cake.Frosting/Abstractions/IFrostingStartup.cs rename to src/Cake.Frosting/Abstractions/IFrostingStartup.cs diff --git a/Cake.Frosting/Abstractions/IFrostingTask.cs b/src/Cake.Frosting/Abstractions/IFrostingTask.cs similarity index 90% rename from Cake.Frosting/Abstractions/IFrostingTask.cs rename to src/Cake.Frosting/Abstractions/IFrostingTask.cs index 2c862ef9aa..3061159d26 100644 --- a/Cake.Frosting/Abstractions/IFrostingTask.cs +++ b/src/Cake.Frosting/Abstractions/IFrostingTask.cs @@ -18,6 +18,7 @@ public interface IFrostingTask /// Runs the task using the specified context. /// /// The context. + /// A representing the asynchronous operation. Task RunAsync(ICakeContext context); /// @@ -32,7 +33,7 @@ public interface IFrostingTask /// /// The error handler to be executed if an exception occurs in the task. /// - /// The exception + /// The exception. /// The context. void OnError(Exception exception, ICakeContext context); diff --git a/Cake.Frosting/Abstractions/IFrostingTaskLifetime.cs b/src/Cake.Frosting/Abstractions/IFrostingTaskLifetime.cs similarity index 100% rename from Cake.Frosting/Abstractions/IFrostingTaskLifetime.cs rename to src/Cake.Frosting/Abstractions/IFrostingTaskLifetime.cs diff --git a/Cake.Frosting/Abstractions/IToolInstaller.cs b/src/Cake.Frosting/Abstractions/IToolInstaller.cs similarity index 92% rename from Cake.Frosting/Abstractions/IToolInstaller.cs rename to src/Cake.Frosting/Abstractions/IToolInstaller.cs index e6994e5444..5b172a0866 100644 --- a/Cake.Frosting/Abstractions/IToolInstaller.cs +++ b/src/Cake.Frosting/Abstractions/IToolInstaller.cs @@ -16,7 +16,7 @@ public interface IToolInstaller /// Tries to install the specified using /// the most suitable . /// - /// + /// Tool to install. void Install(PackageReference tool); } } diff --git a/Cake.Frosting/Annotations/ContinueOnErrorAttribute.cs b/src/Cake.Frosting/Annotations/ContinueOnErrorAttribute.cs similarity index 100% rename from Cake.Frosting/Annotations/ContinueOnErrorAttribute.cs rename to src/Cake.Frosting/Annotations/ContinueOnErrorAttribute.cs diff --git a/Cake.Frosting/Annotations/DependencyAttribute.cs b/src/Cake.Frosting/Annotations/DependencyAttribute.cs similarity index 100% rename from Cake.Frosting/Annotations/DependencyAttribute.cs rename to src/Cake.Frosting/Annotations/DependencyAttribute.cs diff --git a/Cake.Frosting/Annotations/TaskNameAttribute.cs b/src/Cake.Frosting/Annotations/TaskNameAttribute.cs similarity index 100% rename from Cake.Frosting/Annotations/TaskNameAttribute.cs rename to src/Cake.Frosting/Annotations/TaskNameAttribute.cs diff --git a/Cake.Frosting/AsyncFrostingTask.cs b/src/Cake.Frosting/AsyncFrostingTask.cs similarity index 97% rename from Cake.Frosting/AsyncFrostingTask.cs rename to src/Cake.Frosting/AsyncFrostingTask.cs index 35fa70ccad..29cdff57c5 100644 --- a/Cake.Frosting/AsyncFrostingTask.cs +++ b/src/Cake.Frosting/AsyncFrostingTask.cs @@ -30,6 +30,7 @@ public abstract class AsyncFrostingTask : IFrostingTask /// Runs the task using the specified context. /// /// The context. + /// A representing the asynchronous operation. public virtual Task RunAsync(T context) { return Task.CompletedTask; diff --git a/Cake.Frosting/Cake.Frosting.csproj b/src/Cake.Frosting/Cake.Frosting.csproj similarity index 71% rename from Cake.Frosting/Cake.Frosting.csproj rename to src/Cake.Frosting/Cake.Frosting.csproj index 4a8c6606ad..1aee1738cb 100644 --- a/Cake.Frosting/Cake.Frosting.csproj +++ b/src/Cake.Frosting/Cake.Frosting.csproj @@ -1,19 +1,19 @@ - - - The .NET Core host for Cake. - net461;netstandard2.0 - true - Cake.Frosting - 7.2 - - - - - - - - - - true - - + + + The .NET Core host for Cake. + net461;netstandard2.0;net5.0 + true + Cake.Frosting + 7.2 + + + + + + + + + + true + + diff --git a/Cake.Frosting/CakeHost.cs b/src/Cake.Frosting/CakeHost.cs similarity index 100% rename from Cake.Frosting/CakeHost.cs rename to src/Cake.Frosting/CakeHost.cs diff --git a/Cake.Frosting/CakeHostBuilder.cs b/src/Cake.Frosting/CakeHostBuilder.cs similarity index 100% rename from Cake.Frosting/CakeHostBuilder.cs rename to src/Cake.Frosting/CakeHostBuilder.cs diff --git a/Cake.Frosting/CakeHostBuilderExtensions.cs b/src/Cake.Frosting/CakeHostBuilderExtensions.cs similarity index 100% rename from Cake.Frosting/CakeHostBuilderExtensions.cs rename to src/Cake.Frosting/CakeHostBuilderExtensions.cs diff --git a/Cake.Frosting/CakeHostCommand.cs b/src/Cake.Frosting/CakeHostCommand.cs similarity index 100% rename from Cake.Frosting/CakeHostCommand.cs rename to src/Cake.Frosting/CakeHostCommand.cs diff --git a/Cake.Frosting/CakeHostOptions.cs b/src/Cake.Frosting/CakeHostOptions.cs similarity index 100% rename from Cake.Frosting/CakeHostOptions.cs rename to src/Cake.Frosting/CakeHostOptions.cs diff --git a/Cake.Frosting/CakeServices.cs b/src/Cake.Frosting/CakeServices.cs similarity index 100% rename from Cake.Frosting/CakeServices.cs rename to src/Cake.Frosting/CakeServices.cs diff --git a/Cake.Frosting/CakeServicesExtensions.cs b/src/Cake.Frosting/CakeServicesExtensions.cs similarity index 100% rename from Cake.Frosting/CakeServicesExtensions.cs rename to src/Cake.Frosting/CakeServicesExtensions.cs diff --git a/Cake.Frosting/FrostingContext.cs b/src/Cake.Frosting/FrostingContext.cs similarity index 100% rename from Cake.Frosting/FrostingContext.cs rename to src/Cake.Frosting/FrostingContext.cs diff --git a/Cake.Frosting/FrostingException.cs b/src/Cake.Frosting/FrostingException.cs similarity index 100% rename from Cake.Frosting/FrostingException.cs rename to src/Cake.Frosting/FrostingException.cs diff --git a/Cake.Frosting/FrostingLifetime.cs b/src/Cake.Frosting/FrostingLifetime.cs similarity index 100% rename from Cake.Frosting/FrostingLifetime.cs rename to src/Cake.Frosting/FrostingLifetime.cs diff --git a/Cake.Frosting/FrostingTask.cs b/src/Cake.Frosting/FrostingTask.cs similarity index 100% rename from Cake.Frosting/FrostingTask.cs rename to src/Cake.Frosting/FrostingTask.cs diff --git a/Cake.Frosting/FrostingTaskLifetime.cs b/src/Cake.Frosting/FrostingTaskLifetime.cs similarity index 100% rename from Cake.Frosting/FrostingTaskLifetime.cs rename to src/Cake.Frosting/FrostingTaskLifetime.cs diff --git a/Cake.Frosting/Internal/Arguments/ArgumentParser.cs b/src/Cake.Frosting/Internal/Arguments/ArgumentParser.cs similarity index 100% rename from Cake.Frosting/Internal/Arguments/ArgumentParser.cs rename to src/Cake.Frosting/Internal/Arguments/ArgumentParser.cs diff --git a/Cake.Frosting/Internal/Arguments/VerbosityParser.cs b/src/Cake.Frosting/Internal/Arguments/VerbosityParser.cs similarity index 100% rename from Cake.Frosting/Internal/Arguments/VerbosityParser.cs rename to src/Cake.Frosting/Internal/Arguments/VerbosityParser.cs diff --git a/Cake.Frosting/Internal/Commands/Command.cs b/src/Cake.Frosting/Internal/Commands/Command.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/Command.cs rename to src/Cake.Frosting/Internal/Commands/Command.cs diff --git a/Cake.Frosting/Internal/Commands/CommandFactory.cs b/src/Cake.Frosting/Internal/Commands/CommandFactory.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/CommandFactory.cs rename to src/Cake.Frosting/Internal/Commands/CommandFactory.cs diff --git a/Cake.Frosting/Internal/Commands/DryRunCommand.cs b/src/Cake.Frosting/Internal/Commands/DryRunCommand.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/DryRunCommand.cs rename to src/Cake.Frosting/Internal/Commands/DryRunCommand.cs diff --git a/Cake.Frosting/Internal/Commands/DryRunExecutionStrategy.cs b/src/Cake.Frosting/Internal/Commands/DryRunExecutionStrategy.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/DryRunExecutionStrategy.cs rename to src/Cake.Frosting/Internal/Commands/DryRunExecutionStrategy.cs diff --git a/Cake.Frosting/Internal/Commands/ErrorDecoratorCommand.cs b/src/Cake.Frosting/Internal/Commands/ErrorDecoratorCommand.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/ErrorDecoratorCommand.cs rename to src/Cake.Frosting/Internal/Commands/ErrorDecoratorCommand.cs diff --git a/Cake.Frosting/Internal/Commands/HelpCommand.cs b/src/Cake.Frosting/Internal/Commands/HelpCommand.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/HelpCommand.cs rename to src/Cake.Frosting/Internal/Commands/HelpCommand.cs diff --git a/Cake.Frosting/Internal/Commands/RunCommand.cs b/src/Cake.Frosting/Internal/Commands/RunCommand.cs similarity index 96% rename from Cake.Frosting/Internal/Commands/RunCommand.cs rename to src/Cake.Frosting/Internal/Commands/RunCommand.cs index cca7331921..abe3fac86b 100644 --- a/Cake.Frosting/Internal/Commands/RunCommand.cs +++ b/src/Cake.Frosting/Internal/Commands/RunCommand.cs @@ -17,8 +17,7 @@ internal sealed class RunCommand : Command public RunCommand( IFrostingContext context, IExecutionStrategy strategy, - ICakeReportPrinter printer - ) + ICakeReportPrinter printer) { _context = context; _strategy = strategy; diff --git a/Cake.Frosting/Internal/Commands/VersionCommand.cs b/src/Cake.Frosting/Internal/Commands/VersionCommand.cs similarity index 100% rename from Cake.Frosting/Internal/Commands/VersionCommand.cs rename to src/Cake.Frosting/Internal/Commands/VersionCommand.cs diff --git a/Cake.Frosting/Internal/Composition/Activator.cs b/src/Cake.Frosting/Internal/Composition/Activator.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/Activator.cs rename to src/Cake.Frosting/Internal/Composition/Activator.cs diff --git a/Cake.Frosting/Internal/Composition/Activators/CachingActivator.cs b/src/Cake.Frosting/Internal/Composition/Activators/CachingActivator.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/Activators/CachingActivator.cs rename to src/Cake.Frosting/Internal/Composition/Activators/CachingActivator.cs diff --git a/Cake.Frosting/Internal/Composition/Activators/InstanceActivator.cs b/src/Cake.Frosting/Internal/Composition/Activators/InstanceActivator.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/Activators/InstanceActivator.cs rename to src/Cake.Frosting/Internal/Composition/Activators/InstanceActivator.cs diff --git a/Cake.Frosting/Internal/Composition/Activators/ReflectionActivator.cs b/src/Cake.Frosting/Internal/Composition/Activators/ReflectionActivator.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/Activators/ReflectionActivator.cs rename to src/Cake.Frosting/Internal/Composition/Activators/ReflectionActivator.cs diff --git a/Cake.Frosting/Internal/Composition/ComponentRegistration.cs b/src/Cake.Frosting/Internal/Composition/ComponentRegistration.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/ComponentRegistration.cs rename to src/Cake.Frosting/Internal/Composition/ComponentRegistration.cs diff --git a/Cake.Frosting/Internal/Composition/ComponentRegistry.cs b/src/Cake.Frosting/Internal/Composition/ComponentRegistry.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/ComponentRegistry.cs rename to src/Cake.Frosting/Internal/Composition/ComponentRegistry.cs diff --git a/Cake.Frosting/Internal/Composition/Container.cs b/src/Cake.Frosting/Internal/Composition/Container.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/Container.cs rename to src/Cake.Frosting/Internal/Composition/Container.cs diff --git a/Cake.Frosting/Internal/Composition/ContainerBuilder.cs b/src/Cake.Frosting/Internal/Composition/ContainerBuilder.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/ContainerBuilder.cs rename to src/Cake.Frosting/Internal/Composition/ContainerBuilder.cs diff --git a/Cake.Frosting/Internal/Composition/ContainerExtensions.cs b/src/Cake.Frosting/Internal/Composition/ContainerExtensions.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/ContainerExtensions.cs rename to src/Cake.Frosting/Internal/Composition/ContainerExtensions.cs diff --git a/Cake.Frosting/Internal/Composition/ContainerResolver.cs b/src/Cake.Frosting/Internal/Composition/ContainerResolver.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/ContainerResolver.cs rename to src/Cake.Frosting/Internal/Composition/ContainerResolver.cs diff --git a/Cake.Frosting/Internal/Composition/RegistrationBuilder.cs b/src/Cake.Frosting/Internal/Composition/RegistrationBuilder.cs similarity index 100% rename from Cake.Frosting/Internal/Composition/RegistrationBuilder.cs rename to src/Cake.Frosting/Internal/Composition/RegistrationBuilder.cs diff --git a/Cake.Frosting/Internal/Configuration.cs b/src/Cake.Frosting/Internal/Configuration.cs similarity index 100% rename from Cake.Frosting/Internal/Configuration.cs rename to src/Cake.Frosting/Internal/Configuration.cs diff --git a/Cake.Frosting/Internal/ConfigurationSetting.cs b/src/Cake.Frosting/Internal/ConfigurationSetting.cs similarity index 100% rename from Cake.Frosting/Internal/ConfigurationSetting.cs rename to src/Cake.Frosting/Internal/ConfigurationSetting.cs diff --git a/Cake.Frosting/Internal/DefaultConsole.cs b/src/Cake.Frosting/Internal/DefaultConsole.cs similarity index 89% rename from Cake.Frosting/Internal/DefaultConsole.cs rename to src/Cake.Frosting/Internal/DefaultConsole.cs index 161e78c121..087d9b38f6 100644 --- a/Cake.Frosting/Internal/DefaultConsole.cs +++ b/src/Cake.Frosting/Internal/DefaultConsole.cs @@ -30,7 +30,7 @@ public ConsoleColor BackgroundColor } /// - /// Gets if console supports ANSI escape codes. + /// Gets a value indicating whether gets if console supports ANSI escape codes. /// public bool SupportAnsiEscapeCodes => false; @@ -38,7 +38,7 @@ public ConsoleColor BackgroundColor /// Writes the text representation of the specified array of objects to the /// console output using the specified format information. /// - /// A composite format string + /// A composite format string. /// An array of objects to write using format. public void Write(string format, params object[] arg) { @@ -50,7 +50,7 @@ public void Write(string format, params object[] arg) /// by the current line terminator, to the console output using the specified /// format information. /// - /// A composite format string + /// A composite format string. /// An array of objects to write using format. public void WriteLine(string format, params object[] arg) { @@ -61,7 +61,7 @@ public void WriteLine(string format, params object[] arg) /// Writes the text representation of the specified array of objects to the /// console error output using the specified format information. /// - /// A composite format string + /// A composite format string. /// An array of objects to write using format. public void WriteError(string format, params object[] arg) { @@ -73,7 +73,7 @@ public void WriteError(string format, params object[] arg) /// by the current line terminator, to the console error output using the /// specified format information. /// - /// A composite format string + /// A composite format string. /// An array of objects to write using format. public void WriteErrorLine(string format, params object[] arg) { diff --git a/Cake.Frosting/Internal/Diagnostics/CakeLog.cs b/src/Cake.Frosting/Internal/Diagnostics/CakeLog.cs similarity index 100% rename from Cake.Frosting/Internal/Diagnostics/CakeLog.cs rename to src/Cake.Frosting/Internal/Diagnostics/CakeLog.cs diff --git a/Cake.Frosting/Internal/Diagnostics/ConsolePalette.cs b/src/Cake.Frosting/Internal/Diagnostics/ConsolePalette.cs similarity index 100% rename from Cake.Frosting/Internal/Diagnostics/ConsolePalette.cs rename to src/Cake.Frosting/Internal/Diagnostics/ConsolePalette.cs diff --git a/Cake.Frosting/Internal/Diagnostics/Formatting/FormatParser.cs b/src/Cake.Frosting/Internal/Diagnostics/Formatting/FormatParser.cs similarity index 100% rename from Cake.Frosting/Internal/Diagnostics/Formatting/FormatParser.cs rename to src/Cake.Frosting/Internal/Diagnostics/Formatting/FormatParser.cs diff --git a/Cake.Frosting/Internal/Diagnostics/Formatting/FormatToken.cs b/src/Cake.Frosting/Internal/Diagnostics/Formatting/FormatToken.cs similarity index 100% rename from Cake.Frosting/Internal/Diagnostics/Formatting/FormatToken.cs rename to src/Cake.Frosting/Internal/Diagnostics/Formatting/FormatToken.cs diff --git a/Cake.Frosting/Internal/Diagnostics/Formatting/LiteralToken.cs b/src/Cake.Frosting/Internal/Diagnostics/Formatting/LiteralToken.cs similarity index 100% rename from Cake.Frosting/Internal/Diagnostics/Formatting/LiteralToken.cs rename to src/Cake.Frosting/Internal/Diagnostics/Formatting/LiteralToken.cs diff --git a/Cake.Frosting/Internal/Diagnostics/Formatting/PropertyToken.cs b/src/Cake.Frosting/Internal/Diagnostics/Formatting/PropertyToken.cs similarity index 100% rename from Cake.Frosting/Internal/Diagnostics/Formatting/PropertyToken.cs rename to src/Cake.Frosting/Internal/Diagnostics/Formatting/PropertyToken.cs diff --git a/Cake.Frosting/Internal/EngineInitializer.cs b/src/Cake.Frosting/Internal/EngineInitializer.cs similarity index 100% rename from Cake.Frosting/Internal/EngineInitializer.cs rename to src/Cake.Frosting/Internal/EngineInitializer.cs diff --git a/Cake.Frosting/Internal/ErrorCakeHost.cs b/src/Cake.Frosting/Internal/ErrorCakeHost.cs similarity index 100% rename from Cake.Frosting/Internal/ErrorCakeHost.cs rename to src/Cake.Frosting/Internal/ErrorCakeHost.cs diff --git a/Cake.Frosting/Internal/ErrorCakeHostBuilder.cs b/src/Cake.Frosting/Internal/ErrorCakeHostBuilder.cs similarity index 100% rename from Cake.Frosting/Internal/ErrorCakeHostBuilder.cs rename to src/Cake.Frosting/Internal/ErrorCakeHostBuilder.cs diff --git a/Cake.Frosting/Internal/ErrorHandler.cs b/src/Cake.Frosting/Internal/ErrorHandler.cs similarity index 100% rename from Cake.Frosting/Internal/ErrorHandler.cs rename to src/Cake.Frosting/Internal/ErrorHandler.cs diff --git a/Cake.Frosting/Internal/Extensions/FrostingLifetimeExtensions.cs b/src/Cake.Frosting/Internal/Extensions/FrostingLifetimeExtensions.cs similarity index 100% rename from Cake.Frosting/Internal/Extensions/FrostingLifetimeExtensions.cs rename to src/Cake.Frosting/Internal/Extensions/FrostingLifetimeExtensions.cs diff --git a/Cake.Frosting/Internal/Extensions/FrostingTaskExtensions.cs b/src/Cake.Frosting/Internal/Extensions/FrostingTaskExtensions.cs similarity index 97% rename from Cake.Frosting/Internal/Extensions/FrostingTaskExtensions.cs rename to src/Cake.Frosting/Internal/Extensions/FrostingTaskExtensions.cs index d5cf3f9b21..b18d5d2619 100644 --- a/Cake.Frosting/Internal/Extensions/FrostingTaskExtensions.cs +++ b/src/Cake.Frosting/Internal/Extensions/FrostingTaskExtensions.cs @@ -81,7 +81,8 @@ private static bool IsAsyncFrostingTask(this IFrostingTask task) } taskType = taskType.BaseType; - } while (taskType != null); + } + while (taskType != null); return false; } @@ -98,7 +99,8 @@ private static bool IsFrostingTask(this IFrostingTask task) } taskType = taskType.BaseType; - } while (taskType != null); + } + while (taskType != null); return false; } diff --git a/Cake.Frosting/Internal/Extensions/FrostingTaskLifetimeExtensions.cs b/src/Cake.Frosting/Internal/Extensions/FrostingTaskLifetimeExtensions.cs similarity index 100% rename from Cake.Frosting/Internal/Extensions/FrostingTaskLifetimeExtensions.cs rename to src/Cake.Frosting/Internal/Extensions/FrostingTaskLifetimeExtensions.cs diff --git a/Cake.Frosting/Internal/Extensions/MethodInfoExtensions.cs b/src/Cake.Frosting/Internal/Extensions/MethodInfoExtensions.cs similarity index 100% rename from Cake.Frosting/Internal/Extensions/MethodInfoExtensions.cs rename to src/Cake.Frosting/Internal/Extensions/MethodInfoExtensions.cs diff --git a/Cake.Frosting/Internal/Guard.cs b/src/Cake.Frosting/Internal/Guard.cs similarity index 100% rename from Cake.Frosting/Internal/Guard.cs rename to src/Cake.Frosting/Internal/Guard.cs diff --git a/Cake.Frosting/Internal/Module.cs b/src/Cake.Frosting/Internal/Module.cs similarity index 96% rename from Cake.Frosting/Internal/Module.cs rename to src/Cake.Frosting/Internal/Module.cs index bb79261bf5..2b84484fc6 100644 --- a/Cake.Frosting/Internal/Module.cs +++ b/src/Cake.Frosting/Internal/Module.cs @@ -29,7 +29,7 @@ public void Register(ICakeContainerRegistrar registry) // Logging registry.RegisterType().As().Singleton(); - registry.RegisterType().As().Singleton(); + registry.RegisterType().As().Singleton(); // Configuration registry.RegisterType().AsSelf().Singleton(); diff --git a/Cake.Frosting/Internal/RawArguments.cs b/src/Cake.Frosting/Internal/RawArguments.cs similarity index 92% rename from Cake.Frosting/Internal/RawArguments.cs rename to src/Cake.Frosting/Internal/RawArguments.cs index 830dedae65..c11ef791e1 100644 --- a/Cake.Frosting/Internal/RawArguments.cs +++ b/src/Cake.Frosting/Internal/RawArguments.cs @@ -46,10 +46,11 @@ public bool HasArgument(string name) /// /// The argument name. /// The argument value. - public string GetArgument(string name) + public ICollection GetArguments(string name) { return _arguments.ContainsKey(name) - ? _arguments[name] : null; + ? new[] { _arguments[name] } + : Array.Empty(); } } } diff --git a/Cake.Frosting/Internal/ReportPrinter.cs b/src/Cake.Frosting/Internal/ReportPrinter.cs similarity index 100% rename from Cake.Frosting/Internal/ReportPrinter.cs rename to src/Cake.Frosting/Internal/ReportPrinter.cs diff --git a/Cake.Frosting/Internal/TaskFinder.cs b/src/Cake.Frosting/Internal/TaskFinder.cs similarity index 100% rename from Cake.Frosting/Internal/TaskFinder.cs rename to src/Cake.Frosting/Internal/TaskFinder.cs diff --git a/Cake.Frosting/Internal/TaskNameHelper.cs b/src/Cake.Frosting/Internal/TaskNameHelper.cs similarity index 100% rename from Cake.Frosting/Internal/TaskNameHelper.cs rename to src/Cake.Frosting/Internal/TaskNameHelper.cs diff --git a/Cake.Frosting/Internal/ToolInstaller.cs b/src/Cake.Frosting/Internal/ToolInstaller.cs similarity index 100% rename from Cake.Frosting/Internal/ToolInstaller.cs rename to src/Cake.Frosting/Internal/ToolInstaller.cs diff --git a/Cake.Frosting/Internal/WorkingDirectory.cs b/src/Cake.Frosting/Internal/WorkingDirectory.cs similarity index 100% rename from Cake.Frosting/Internal/WorkingDirectory.cs rename to src/Cake.Frosting/Internal/WorkingDirectory.cs diff --git a/src/Cake.sln b/src/Cake.sln index 06cf505e9f..50c028d729 100644 --- a/src/Cake.sln +++ b/src/Cake.sln @@ -1,6 +1,7 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.4 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30516.212 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{E9FAF832-F327-4F36-8AB3-2A96345DB1A9}" ProjectSection(SolutionItems) = preProject @@ -47,6 +48,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake", "Cake\Cake.csproj", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Tests", "Cake.Tests\Cake.Tests.csproj", "{15A49638-46DE-4361-B86E-4873BA5EF136}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Frosting", "Cake.Frosting\Cake.Frosting.csproj", "{636D5F9E-B7D0-4402-8363-1347488BD3B8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Frosting.Example", "Cake.Frosting.Example\Cake.Frosting.Example.csproj", "{2D420F2E-DD8D-432F-908F-CB617C919D77}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.Frosting.Tests", "Cake.Frosting.Tests\Cake.Frosting.Tests.csproj", "{26F4E738-122C-428D-A014-62A357F39023}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Frosting.Template", "Cake.Frosting.Template\Cake.Frosting.Template.csproj", "{E5AE09CE-30D3-4C5D-97A7-A2B95C6898B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +102,22 @@ Global {15A49638-46DE-4361-B86E-4873BA5EF136}.Debug|Any CPU.Build.0 = Debug|Any CPU {15A49638-46DE-4361-B86E-4873BA5EF136}.Release|Any CPU.ActiveCfg = Release|Any CPU {15A49638-46DE-4361-B86E-4873BA5EF136}.Release|Any CPU.Build.0 = Release|Any CPU + {636D5F9E-B7D0-4402-8363-1347488BD3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {636D5F9E-B7D0-4402-8363-1347488BD3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {636D5F9E-B7D0-4402-8363-1347488BD3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {636D5F9E-B7D0-4402-8363-1347488BD3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {2D420F2E-DD8D-432F-908F-CB617C919D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D420F2E-DD8D-432F-908F-CB617C919D77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D420F2E-DD8D-432F-908F-CB617C919D77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D420F2E-DD8D-432F-908F-CB617C919D77}.Release|Any CPU.Build.0 = Release|Any CPU + {26F4E738-122C-428D-A014-62A357F39023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26F4E738-122C-428D-A014-62A357F39023}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26F4E738-122C-428D-A014-62A357F39023}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26F4E738-122C-428D-A014-62A357F39023}.Release|Any CPU.Build.0 = Release|Any CPU + {E5AE09CE-30D3-4C5D-97A7-A2B95C6898B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5AE09CE-30D3-4C5D-97A7-A2B95C6898B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5AE09CE-30D3-4C5D-97A7-A2B95C6898B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5AE09CE-30D3-4C5D-97A7-A2B95C6898B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -105,6 +130,7 @@ Global {B46B6733-38D8-497D-B17B-603F929E8BA7} = {8615F41E-65C7-4BE5-AFD4-C9C78912AF80} {2502455D-AEAC-4AD7-B29C-B1D3AFFF9E84} = {8615F41E-65C7-4BE5-AFD4-C9C78912AF80} {15A49638-46DE-4361-B86E-4873BA5EF136} = {8615F41E-65C7-4BE5-AFD4-C9C78912AF80} + {26F4E738-122C-428D-A014-62A357F39023} = {8615F41E-65C7-4BE5-AFD4-C9C78912AF80} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {35585E1D-D23E-40C8-A01E-2E5FF5B41083}