forked from cake-build/cake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cake-buildGH-2874) Merge Frosting into Cake
* fixes cake-build#2874 * Fix Cake styling & breaking changes * Add bootstrappers to template * Add Frosting to build
- Loading branch information
Showing
124 changed files
with
305 additions
and
225 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
2 changes: 1 addition & 1 deletion
2
...ting.Example/Cake.Frosting.Example.csproj → ...ting.Example/Cake.Frosting.Example.csproj
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<PackageType>Template</PackageType> | ||
<AssemblyName>Cake.Frosting.Template</AssemblyName> | ||
<Title>Cake.Frosting templates for the .NET SDK.</Title> | ||
<Description>Cake.Frosting templates for the .NET SDK.</Description> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
||
<IncludeContentInPack>true</IncludeContentInPack> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<ContentTargetFolders>content</ContentTargetFolders> | ||
<NoWarn>NU5110;NU5111;NU5128</NoWarn> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)..\Shared.msbuild" /> | ||
|
||
<ItemGroup> | ||
<Content Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**" /> | ||
<Content Include="../../build.config" Link="templates/cakefrosting/build.config" PackagePath="/content/templates/cakefrosting/build.config" /> | ||
<Content Include="build.ps1" Link="templates/cakefrosting/build.ps1" PackagePath="/content/templates/cakefrosting/build.ps1" /> | ||
<Content Include="build.sh" Link="templates/cakefrosting/build.sh" PackagePath="/content/templates/cakefrosting/build.sh" /> | ||
<Compile Remove="**\*" /> | ||
</ItemGroup> | ||
|
||
<Target Name="VersionBuild" BeforeTargets="PrepareForBuild" Condition="'$(TemplateVersion)'!=''"> | ||
<XmlPoke XmlInputPath="templates\cakefrosting\build\Build.csproj" Query="Project/ItemGroup/PackageReference/@Version" Value="$(TemplateVersion)" /> | ||
</Target> | ||
|
||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 -- "$@" |
11 changes: 11 additions & 0 deletions
11
src/Cake.Frosting.Template/templates/cakefrosting/.template.config/template.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"author": "Patrik Svensson ([email protected])", | ||
"classifications": [ "Cake", "Frosting" ], | ||
"name": "Cake Frosting Build Script", | ||
"identity": "Cake.Frosting", | ||
"shortName": "cakefrosting", | ||
"sourceName": "temp", | ||
"tags": { | ||
"language": "C#" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Cake.Frosting.Template/templates/cakefrosting/build/Build.csproj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<PackAsTool>true</PackAsTool> | ||
<!-- Make sure start same folder .NET Core CLI and Visual Studio --> | ||
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Cake.Frosting" Version="1.0.0" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.