Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
259 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
assembly-versioning-scheme: MajorMinor | ||
mode: Mainline | ||
|
||
ignore: | ||
sha: [] |
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,52 @@ | ||
[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 | ||
########################################################################### | ||
|
||
$NuGetVersion = "latest" | ||
$SolutionDirectory = "$PSScriptRoot\.\src" | ||
$BuildProjectFile = "$PSScriptRoot\.\build\.build.csproj" | ||
$BuildExeFile = "$PSScriptRoot\.\build\bin\debug\.build.exe" | ||
|
||
$TempDirectory = "$PSScriptRoot\.tmp" | ||
|
||
$NuGetUrl = "https://dist.nuget.org/win-x86-commandline/$NuGetVersion/nuget.exe" | ||
$NuGetFile = "$TempDirectory\nuget.exe" | ||
$env:NUGET_EXE = $NuGetFile | ||
|
||
########################################################################### | ||
# 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 $TempDirectory > $null | ||
|
||
if (!(Test-Path $NuGetFile)) { (New-Object System.Net.WebClient).DownloadFile($NuGetUrl, $NuGetFile) } | ||
elseif ($NuGetVersion -eq "latest") { & $NuGetFile update -Self } | ||
|
||
ExecSafe { & $NuGetFile restore $BuildProjectFile -SolutionDirectory $SolutionDirectory } | ||
ExecSafe { & $NuGetFile install Nuke.MSBuildLocator -ExcludeVersion -OutputDirectory $TempDirectory -SolutionDirectory $SolutionDirectory } | ||
} | ||
|
||
$MSBuildFile = & "$TempDirectory\Nuke.MSBuildLocator\tools\Nuke.MSBuildLocator.exe" | ||
ExecSafe { & $MSBuildFile $BuildProjectFile } | ||
|
||
########################################################################### | ||
# EXECUTE BUILD | ||
########################################################################### | ||
|
||
ExecSafe { & $BuildExeFile $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,50 @@ | ||
#!/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 | ||
########################################################################### | ||
|
||
NUGET_VERSION="latest" | ||
SOLUTION_DIRECTORY="$SCRIPT_DIR/./src" | ||
BUILD_PROJECT_FILE="$SCRIPT_DIR/./build/.build.csproj" | ||
BUILD_EXE_FILE="$SCRIPT_DIR/./build/bin/Debug/.build.exe" | ||
|
||
TEMP_DIRECTORY="$SCRIPT_DIR/.tmp" | ||
|
||
NUGET_URL="https://dist.nuget.org/win-x86-commandline/$NUGET_VERSION/nuget.exe" | ||
NUGET_FILE="$TEMP_DIRECTORY/nuget.exe" | ||
export NUGET_EXE="$NUGET_FILE" | ||
|
||
########################################################################### | ||
# PREPARE BUILD | ||
########################################################################### | ||
|
||
if ! ((NOINIT)); then | ||
mkdir -p "$TEMP_DIRECTORY" | ||
|
||
if [ ! -f "$NUGET_FILE" ]; then curl -Lsfo "$NUGET_FILE" $NUGET_URL; | ||
elif [ $NUGET_VERSION == "latest" ]; then mono "$NUGET_FILE" update -Self; fi | ||
|
||
mono "$NUGET_FILE" restore "$BUILD_PROJECT_FILE" -SolutionDirectory $SOLUTION_DIRECTORY | ||
fi | ||
|
||
msbuild "$BUILD_PROJECT_FILE" | ||
|
||
########################################################################### | ||
# EXECUTE BUILD | ||
########################################################################### | ||
|
||
mono "$BUILD_EXE_FILE" ${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,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net461</TargetFramework> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<RootNamespace></RootNamespace> | ||
<IsPackable>false</IsPackable> | ||
<NoWarn>CS0649;CS0169</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Nuke.Common" Version="0.1.385" /> | ||
<PackageReference Include="GitVersion.CommandLine" Version="4.0.0-beta0011" /> | ||
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" /> | ||
</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,45 @@ | ||
<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/CSharpFormat/WRAP_ARGUMENTS_STYLE/@EntryValue">WRAP_IF_LONG</s:String> | ||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">True</s:Boolean> | ||
<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_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@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> | ||
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/@KeyIndexDefined">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Applicability/=File/@EntryIndexedValue">True</s:Boolean> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/CustomProperties/=Extension/@EntryIndexedValue">json</s:String> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/CustomProperties/=FileName/@EntryIndexedValue">metadata</s:String> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/CustomProperties/=ValidateFileName/@EntryIndexedValue">True</s:String> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Description/@EntryValue">NUKE tool metadata</s:String> | ||
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Field/=name/@KeyIndexDefined">True</s:Boolean> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Field/=name/Expression/@EntryValue">getFileNameWithoutExtension()</s:String> | ||
<s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Field/=name/InitialRange/@EntryValue">-1</s:Int64> | ||
<s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Field/=name/Order/@EntryValue">0</s:Int64> | ||
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Reformat/@EntryValue">True</s:Boolean> | ||
|
||
|
||
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Scope/=E8F0594528C33E45BBFEC6CFE851095D/@KeyIndexDefined">True</s:Boolean> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Scope/=E8F0594528C33E45BBFEC6CFE851095D/Type/@EntryValue">InCSharpProjectFile</s:String> | ||
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/ShortenQualifiedReferences/@EntryValue">True</s:Boolean> | ||
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A7552288530102459B5E4251A0BDAF86/Text/@EntryValue">{
 | ||
"$schema": "./_schema.json#",
 | ||
"name": "$name$",
 | ||
"customExecutable": true,
 | ||
"tasks": [
 | ||
{
 | ||
"settingsClass": {
 | ||
"properties": [
 | ||
{
 | ||
$END$
 | ||
}
 | ||
]
 | ||
}
 | ||
}
 | ||
]
 | ||
}</s:String></wpf:ResourceDictionary> |
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,85 @@ | ||
// /* | ||
// * Copyright 2007-2015 JetBrains | ||
// * | ||
// * Licensed under the Apache License, Version 2.0 (the "License"); | ||
// * you may not use this file except in compliance with the License. | ||
// * You may obtain a copy of the License at | ||
// * | ||
// * http://www.apache.org/licenses/LICENSE-2.0 | ||
// * | ||
// * Unless required by applicable law or agreed to in writing, software | ||
// * distributed under the License is distributed on an "AS IS" BASIS, | ||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// * See the License for the specific language governing permissions and | ||
// * limitations under the License. | ||
// */ | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Web.UI.WebControls.WebParts; | ||
using Nuke.Common.Tools; | ||
using Nuke.Common.Tools.GitVersion; | ||
using Nuke.Common.Tools.NuGet; | ||
using Nuke.Common.Tools.Nunit; | ||
using Nuke.Core; | ||
using Nuke.Core.IO; | ||
using Nuke.Core.Tooling; | ||
using Nuke.Core.Utilities.Collections; | ||
using static Nuke.Common.Tools.MSBuild.MSBuildTasks; | ||
using static Nuke.Common.Tools.NuGet.NuGetTasks; | ||
using static Nuke.Common.Tools.Nunit.NunitTasks; | ||
using static Nuke.Core.IO.FileSystemTasks; | ||
using static Nuke.Core.IO.PathConstruction; | ||
|
||
class Build : NukeBuild | ||
{ | ||
public static int Main () => Execute<Build>(x => x.Compile); | ||
|
||
[GitVersion] readonly GitVersion GitVersion; | ||
[Parameter] readonly string MyGetApiKey; | ||
|
||
Target Clean => _ => _ | ||
.OnlyWhen(() => false) // Disabled for safety. | ||
.Executes(() => | ||
{ | ||
DeleteDirectories(GlobDirectories(SourceDirectory, "**/bin", "**/obj")); | ||
EnsureCleanDirectory(OutputDirectory); | ||
}); | ||
|
||
Target Restore => _ => _ | ||
.DependsOn(Clean) | ||
.Executes(() => | ||
{ | ||
MSBuild(s => DefaultMSBuildRestore); | ||
}); | ||
|
||
Target Compile => _ => _ | ||
.DependsOn(Restore) | ||
.Executes(() => | ||
{ | ||
MSBuild(s => DefaultMSBuildCompile); | ||
}); | ||
|
||
Target Test => _ => _ | ||
.DependsOn(Compile) | ||
.Executes(() => | ||
{ | ||
Nunit3(s => s | ||
.AddInputFiles(GlobFiles(RootDirectory / "test", $"**/bin/{Configuration}/tests.dll")) | ||
.EnableNoResults() | ||
.SetToolPath(ToolPathResolver.GetPackageExecutable("NUnit.ConsoleRunner", "nunit3-console.exe"))); | ||
}); | ||
|
||
Target Pack => _ => _ | ||
.DependsOn(Compile) | ||
.Executes(() => | ||
{ | ||
GlobFiles(RootDirectory / "install", "*.nuspec") | ||
.ForEach(x => NuGetPack(s => DefaultNuGetPack | ||
.SetTargetPath(x) | ||
.SetBasePath(RootDirectory / "install") | ||
.SetOutputDirectory(OutputDirectory))); | ||
}); | ||
|
||
|
||
} |
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