Updated nuke
This commit is contained in:
10
build/.editorconfig
Normal file
10
build/.editorconfig
Normal file
@ -0,0 +1,10 @@
|
||||
[*.cs]
|
||||
dotnet_style_qualification_for_field = false:warning
|
||||
dotnet_style_qualification_for_property = false:warning
|
||||
dotnet_style_qualification_for_method = false:warning
|
||||
dotnet_style_qualification_for_event = false:warning
|
||||
dotnet_style_require_accessibility_modifiers = never:warning
|
||||
|
||||
csharp_style_expression_bodied_properties = true:warning
|
||||
csharp_style_expression_bodied_indexers = true:warning
|
||||
csharp_style_expression_bodied_accessors = true:warning
|
@ -2,53 +2,60 @@ using System;
|
||||
using System.Linq;
|
||||
using Nuke.Common;
|
||||
using Nuke.Common.CI.AppVeyor;
|
||||
using Nuke.Common.Execution;
|
||||
using Nuke.Common.Git;
|
||||
using Nuke.Common.ProjectModel;
|
||||
using Nuke.Common.Tools.GitVersion;
|
||||
using Nuke.Common.Tools.MSBuild;
|
||||
using Nuke.Common.Tooling;
|
||||
using Nuke.Common.Tools.DotNet;
|
||||
using Nuke.Common.Utilities.Collections;
|
||||
using static Nuke.Common.EnvironmentInfo;
|
||||
using static Nuke.Common.IO.FileSystemTasks;
|
||||
using static Nuke.Common.IO.PathConstruction;
|
||||
using static Nuke.Common.Tools.MSBuild.MSBuildTasks;
|
||||
using static Nuke.Common.Tools.DotNet.DotNetTasks;
|
||||
|
||||
[CheckBuildProjectConfigurations]
|
||||
[UnsetVisualStudioEnvironmentVariables]
|
||||
class Build : NukeBuild
|
||||
{
|
||||
/// Support plugins are available for:
|
||||
/// - JetBrains ReSharper https://nuke.build/resharper
|
||||
/// - JetBrains Rider https://nuke.build/rider
|
||||
/// - Microsoft VisualStudio https://nuke.build/visualstudio
|
||||
/// - Microsoft VSCode https://nuke.build/vscode
|
||||
|
||||
public static int Main () => Execute<Build>(x => x.Compile);
|
||||
|
||||
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
|
||||
readonly string Configuration = IsLocalBuild ? "Debug" : "Release";
|
||||
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
|
||||
|
||||
[Solution("PInvokeSerialPort.sln")] readonly Solution Solution;
|
||||
[Solution] readonly Solution Solution;
|
||||
[GitRepository] readonly GitRepository GitRepository;
|
||||
[GitVersion] readonly GitVersion GitVersion;
|
||||
|
||||
Target Clean => _ => _
|
||||
.Before(Restore)
|
||||
.Executes(() =>
|
||||
{
|
||||
});
|
||||
|
||||
Target Restore => _ => _
|
||||
.DependsOn(Clean)
|
||||
.Executes(() =>
|
||||
{
|
||||
MSBuild(s => s
|
||||
.SetTargetPath(Solution)
|
||||
.SetTargets("Restore"));
|
||||
DotNetRestore(_ => _
|
||||
.SetProjectFile(Solution));
|
||||
});
|
||||
|
||||
Target Compile => _ => _
|
||||
.DependsOn(Restore)
|
||||
.Executes(() =>
|
||||
{
|
||||
MSBuild(s => s
|
||||
.SetTargetPath(Solution)
|
||||
.SetTargets("Rebuild")
|
||||
DotNetBuild(_ => _
|
||||
.SetProjectFile(Solution)
|
||||
.SetConfiguration(Configuration)
|
||||
.EnableNoRestore()
|
||||
.SetAssemblyVersion(AppVeyor.Instance.BuildVersion)
|
||||
.SetFileVersion(AppVeyor.Instance.BuildVersion)
|
||||
.SetInformationalVersion(AppVeyor.Instance.BuildVersion)
|
||||
.SetMaxCpuCount(Environment.ProcessorCount)
|
||||
.SetNodeReuse(IsLocalBuild));
|
||||
.SetVersionSuffix(AppVeyor.Instance.BuildVersion)
|
||||
.SetVersion(AppVeyor.Instance.BuildVersion));
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,27 +11,28 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nuke.Common" Version="0.23.4" />
|
||||
<PackageReference Include="GitVersion.CommandLine.DotNetCore" Version="5.0.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<NukeMetadata Include="**\*.json" Exclude="bin\**;obj\**" />
|
||||
<NukeSpecificationFiles Include="**\*.json" Exclude="bin\**;obj\**" />
|
||||
<NukeExternalFiles Include="**\*.*.ext" Exclude="bin\**;obj\**" />
|
||||
<None Remove="*.csproj.DotSettings;*.ref.*.txt" />
|
||||
|
||||
|
||||
<!-- Common build related files -->
|
||||
<None Include="..\build.ps1" />
|
||||
<None Include="..\build.sh" />
|
||||
<None Include="..\.nuke" />
|
||||
<None Include="..\global.json" Condition="Exists('..\global.json')" />
|
||||
<None Include="..\nuget.config" Condition="Exists('..\nuget.config')" />
|
||||
<None Include="..\Jenkinsfile" Condition="Exists('..\Jenkinsfile')" />
|
||||
<None Include="..\appveyor.yml" Condition="Exists('..\appveyor.yml')" />
|
||||
<None Include="..\.travis.yml" Condition="Exists('..\.travis.yml')" />
|
||||
<None Include="..\GitVersion.yml" Condition="Exists('..\GitVersion.yml')" />
|
||||
|
||||
<None Include="..\.nuke" LinkBase="config" />
|
||||
<None Include="..\global.json" LinkBase="config" Condition="Exists('..\global.json')" />
|
||||
<None Include="..\nuget.config" LinkBase="config" Condition="Exists('..\nuget.config')" />
|
||||
<None Include="..\GitVersion.yml" LinkBase="config" Condition="Exists('..\GitVersion.yml')" />
|
||||
|
||||
<None Include="..\.teamcity\settings.kts" LinkBase="ci" Condition="Exists('..\.teamcity\settings.kts')" />
|
||||
<None Include="..\.github\workflows\*.yml" LinkBase="ci" />
|
||||
<None Include="..\azure-pipelines.yml" LinkBase="ci" Condition="Exists('..\azure-pipelines.yml')" />
|
||||
<None Include="..\Jenkinsfile" LinkBase="ci" Condition="Exists('..\Jenkinsfile')" />
|
||||
<None Include="..\appveyor.yml" LinkBase="ci" Condition="Exists('..\appveyor.yml')" />
|
||||
<None Include="..\.travis.yml" LinkBase="ci" Condition="Exists('..\.travis.yml')" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user