-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use NUKE Build instead of PowerShell scripts for automation
- Loading branch information
1 parent
7c392e1
commit ec07554
Showing
23 changed files
with
565 additions
and
241 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -271,3 +271,4 @@ generated_docs/**/* | |
docs.zip | ||
|
||
docs/docfx.console.**/* | ||
output/ |
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 @@ | ||
Dangl.Calculator.sln |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Changelog | ||
|
||
All notable changes to **Dangl.Calculator** are documented here. | ||
|
||
## v1.0.6 | ||
- Add `netstandard2.0` target | ||
- Switch build system to NUKE | ||
|
||
## v1.0.5 | ||
- Downgrade to netstandard1.1 and net45 for broader compatibility | ||
|
||
## v1.0.4 | ||
- Update ANTLR to latest version | ||
|
||
## v1.0.3 | ||
- Target NETStandard 1.3 |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
assembly-versioning-scheme: MajorMinorPatch | ||
assembly-file-versioning-scheme: MajorMinorPatch | ||
|
||
branches: | ||
master: | ||
regex: (origin/)?master | ||
develop: | ||
increment: Patch | ||
tag: beta | ||
regex: (origin/)?dev(elop)?(ment)?$ |
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 was deleted.
Oops, something went wrong.
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,2 @@ | ||
@echo off | ||
powershell %0\..\build.ps1 %* |
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,54 @@ | ||
[CmdletBinding()] | ||
Param( | ||
[switch]$NoInit, | ||
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] | ||
[string[]]$BuildArguments | ||
) | ||
|
||
Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { $host.SetShouldExit(1) } | ||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent | ||
|
||
########################################################################### | ||
# CONFIGURATION | ||
########################################################################### | ||
|
||
$DotNetChannel = "2.0" | ||
$BuildProjectFile = "$PSScriptRoot\.\build\.build.csproj" | ||
|
||
$TempDirectory = "$PSScriptRoot\.\.tmp" | ||
|
||
$DotNetScriptUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" | ||
$DotNetDirectory = "$TempDirectory\dotnet-win" | ||
$DotNetFile = "$DotNetDirectory\dotnet.exe" | ||
$env:DOTNET_EXE = $DotNetFile | ||
|
||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 | ||
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 | ||
$env:NUGET_XMLDOC_MODE = "skip" | ||
|
||
########################################################################### | ||
# PREPARE BUILD | ||
########################################################################### | ||
|
||
function ExecSafe([scriptblock] $cmd) { | ||
& $cmd | ||
if ($LastExitCode -ne 0) { throw "The following call failed with exit code $LastExitCode. '$cmd'" } | ||
} | ||
|
||
if (!$NoInit) { | ||
md -force $DotNetDirectory > $null | ||
|
||
$DotNetScriptFile = "$TempDirectory\dotnet-install.ps1" | ||
if (!(Test-Path $DotNetScriptFile)) { (New-Object System.Net.WebClient).DownloadFile($DotNetScriptUrl, $DotNetScriptFile) } | ||
ExecSafe { & $DotNetScriptFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } | ||
|
||
ExecSafe { & $DotNetFile restore $BuildProjectFile } | ||
} | ||
|
||
ExecSafe { & $DotNetFile build $BuildProjectFile --no-restore } | ||
|
||
########################################################################### | ||
# EXECUTE BUILD | ||
########################################################################### | ||
|
||
ExecSafe { & $DotNetFile run --project $BuildProjectFile --no-build -- $BuildArguments } |
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,54 @@ | ||
#!/usr/bin/env bash | ||
|
||
NOINIT=0 | ||
BUILD_ARGUMENTS=() | ||
for i in "$@"; do | ||
case $(echo $1 | awk '{print tolower($0)}') in | ||
-noinit) NOINIT=1;; | ||
*) BUILD_ARGUMENTS+=("$1") ;; | ||
esac | ||
shift | ||
done | ||
|
||
set -eo pipefail | ||
SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) | ||
|
||
########################################################################### | ||
# CONFIGURATION | ||
########################################################################### | ||
|
||
DOTNET_CHANNEL="2.0" | ||
BUILD_PROJECT_FILE="$SCRIPT_DIR/./build/.build.csproj" | ||
|
||
TEMP_DIRECTORY="$SCRIPT_DIR/./.tmp" | ||
|
||
DOTNET_SCRIPT_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh" | ||
DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" | ||
DOTNET_FILE="$DOTNET_DIRECTORY/dotnet" | ||
export DOTNET_EXE="$DOTNET_FILE" | ||
|
||
export DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
export NUGET_XMLDOC_MODE="skip" | ||
|
||
########################################################################### | ||
# PREPARE BUILD | ||
########################################################################### | ||
|
||
if ! ((NOINIT)); then | ||
mkdir -p "$DOTNET_DIRECTORY" | ||
|
||
DOTNET_SCRIPT_FILE="$TEMP_DIRECTORY/dotnet-install.sh" | ||
if [ ! -f "$DOTNET_SCRIPT_FILE" ]; then curl -Lsfo "$DOTNET_SCRIPT_FILE" $DOTNET_SCRIPT_URL; chmod +x "$DOTNET_SCRIPT_FILE"; fi | ||
"$DOTNET_SCRIPT_FILE" --install-dir "$DOTNET_DIRECTORY" --channel 2.0 --no-path | ||
|
||
"$DOTNET_FILE" restore "$BUILD_PROJECT_FILE" | ||
fi | ||
|
||
"$DOTNET_FILE" build "$BUILD_PROJECT_FILE" --no-restore | ||
|
||
########################################################################### | ||
# EXECUTE BUILD | ||
########################################################################### | ||
|
||
"$DOTNET_FILE" run --project "$BUILD_PROJECT_FILE" --no-build -- ${BUILD_ARGUMENTS[@]} |
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,35 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<RootNamespace></RootNamespace> | ||
<IsPackable>False</IsPackable> | ||
<NoWarn>CS0649;CS0169</NoWarn> | ||
|
||
<!-- NUKE CONFIGURATION --> | ||
<NukeVersion>0.2.26</NukeVersion> | ||
<NukeCodeGeneration>False</NukeCodeGeneration> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Dangl.Nuke.CoberturaConverter" Version="1.0.1" /> | ||
<PackageReference Include="Nuke.Common" Version="$(NukeVersion)" /> | ||
<PackageReference Include="Nuke.CodeGeneration" Version="$(NukeVersion)" Condition="'$(NukeCodeGeneration)' == 'True'" /> | ||
<PackageReference Include="GitVersion.CommandLine" Version="4.0.0-beta0012" /> | ||
<PackageReference Include="Nuke.WebDocu" Version="1.0.2" /> | ||
<PackageReference Include="Nuke.GitHub" Version="1.0.2" /> | ||
<PackageReference Include="JetBrains.dotCover.CommandLineTools" Version="2018.1.0-eap01" /> | ||
<PackageReference Include="ReportGenerator" Version="3.1.2" /> | ||
<PackageReference Include="docfx.console" Version="2.31.0"> | ||
<ExcludeAssets>build</ExcludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<NukeMetadata Include="**/*.json" Exclude="bin/**;obj/**" /> | ||
<None Remove="*.csproj.DotSettings;*.ref.*.txt" /> | ||
</ItemGroup> | ||
|
||
</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,23 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/ImplicitNullability/EnableFields/@EntryValue">False</s:Boolean> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/METHOD_OR_OPERATOR_BODY/@EntryValue">ExpressionBody</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ThisQualifier/INSTANCE_MEMBERS_QUALIFY_MEMBERS/@EntryValue">0</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String> | ||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_USER_LINEBREAKS/@EntryValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_INVOCATION_LPAR/@EntryValue">False</s:Boolean> | ||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/MAX_ATTRIBUTE_LENGTH_FOR_SAME_LINE/@EntryValue">120</s:Int64> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">IF_OWNER_IS_SINGLE_LINE</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ARGUMENTS_STYLE/@EntryValue">WRAP_IF_LONG</s:String> | ||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE/@EntryValue">False</s:Boolean> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
Oops, something went wrong.