Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.CI;
using Nuke.Common.Execution;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
Expand All @@ -16,9 +17,10 @@
using Serilog;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.SignTool.SignToolTasks;

[CheckBuildProjectConfigurations]
[UnsetVisualStudioEnvironmentVariables]
[VerbosityMapping(typeof(DotNetVerbosity), Verbose = nameof(DotNetVerbosity.diagnostic))]
class Build : NukeBuild
{
/// Support plugins are available for:
Expand All @@ -40,9 +42,9 @@ class Build : NukeBuild
Name = "OCTOVERSION_CurrentBranch")]
readonly string BranchName;

[OctoVersion(UpdateBuildNumber = true, BranchParameter = nameof(BranchName),
AutoDetectBranchParameter = nameof(AutoDetectBranch), Framework = "net6.0")]
readonly OctoVersionInfo OctoVersionInfo;
[OctoVersion(BranchMember = nameof(BranchName),
AutoDetectBranchMember = nameof(AutoDetectBranch), Framework = "net8.0")]
public OctoVersionInfo OctoVersionInfo;

AbsolutePath SourceDirectory => RootDirectory / "source";
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
Expand Down Expand Up @@ -145,7 +147,7 @@ class Build : NukeBuild
.SetOutputDirectory(ArtifactsDirectory)
.EnableNoBuild()
.DisableIncludeSymbols()
.SetVerbosity(DotNetVerbosity.Normal)
.SetVerbosity(DotNetVerbosity.normal)
);
}
finally
Expand Down
20 changes: 15 additions & 5 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<!-- Restore insecure BinaryFormatter package until we can move to Nuke 9 which doesn't need it -->
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.3" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.2.1" />
<PackageReference Include="ILRepack" Version="2.0.18" />
<PackageDownload Include="OctoVersion.Tool" Version="[0.2.1058]" />
<PackageReference Include="Nuke.Common" Version="8.1.0" />
<PackageReference Include="ILRepack" Version="2.0.41">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageDownload Include="NuGet.CommandLine" Version="[6.12.2]" />
<PackageDownload Include="Octopus.OctoVersion.Tool" Version="[1.0.6]" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"version": "8.0.407",
"rollForward": "latestFeature"
}
}
11 changes: 5 additions & 6 deletions source/CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="!$([MSBuild]::IsOSUnixLike())">net462;netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSUnixLike())">netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>embedded</DebugType>
<AssemblyName>Octopus.CommandLine</AssemblyName>
Expand All @@ -18,7 +17,7 @@

<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Authors>Octopus Deploy Pty. Ltd.</Authors>
<Copyright>Copyright © Octopus Deploy 2022</Copyright>
<Copyright>Copyright © Octopus Deploy 2025</Copyright>
<PackageProjectUrl>https://github.com/OctopusDeploy/CommandLine</PackageProjectUrl>
<RepositoryUrl>https://github.com/OctopusDeploy/CommandLine</RepositoryUrl>
<Description>The command line parsing library used by many of Octopus apps. Supports global and command specific help, json output, auto-complete and more.</Description>
Expand All @@ -36,11 +35,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog" Version="4.2.0" />
</ItemGroup>
<ItemGroup>
<None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
</Project>
22 changes: 5 additions & 17 deletions source/CommandLine/Octopus.CommandLine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,23 @@
<metadata>
<id>Octopus.CommandLine</id>
<version>$version$</version>
<authors>Octopus Deploy Pty. Ltd.</authors>
<authors>Octopus Deploy</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">Apache-2.0</license>
<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl>
<icon>images\icon.png</icon>
<projectUrl>https://github.com/OctopusDeploy/CommandLine</projectUrl>
<description>The command line parsing library used by many of Octopus apps. Supports global and command specific help, json output, auto-complete and more.</description>
<copyright>Copyright © Octopus Deploy 2022</copyright>
<copyright>Octopus Deploy Pty Ltd</copyright>
<repository url="https://github.com/OctopusDeploy/CommandLine" />
<dependencies>
<group targetFramework=".NETFramework4.6.2">
<dependency id="Serilog" version="2.3.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETCoreApp3.1">
<dependency id="Serilog" version="2.3.0" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="Serilog" version="2.3.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Serilog" version="2.3.0" exclude="Build,Analyzers" />
<group targetFramework="net8.0">
<dependency id="Serilog" version="4.2.0" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
<files>
<file src="icon.png" target="images\" />
<file src="bin\$configuration$\net462\Octopus.CommandLine.dll" target="lib\net462" />
<file src="bin\$configuration$\net6.0\Octopus.CommandLine.dll" target="lib\net6.0" />
<file src="bin\$configuration$\netcoreapp3.1\Octopus.CommandLine.dll" target="lib\netcoreapp3.1" />
<file src="bin\$configuration$\netstandard2.0\Octopus.CommandLine.dll" target="lib\netstandard2.0" />
<file src="bin\$configuration$\net8.0\Octopus.CommandLine.dll" target="lib\net8.0" />
</files>
</package>
7 changes: 0 additions & 7 deletions source/CommandLine/Plumbing/ExecutionEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ namespace Octopus.CommandLine.Plumbing;
[SuppressMessage("ReSharper", "PC003")] // suppresses a warning that libc!uname is unavailable in UWP
static class ExecutionEnvironment
{
/// <summary>
/// If/When we try executing this on another runtime we can 'tweak' this logic.
/// The reccomended way to determine at runtime if executing within the mono framework
/// http://www.mono-project.com/docs/gui/winforms/porting-winforms-applications/#runtime-conditionals
/// </summary>
public static readonly bool IsRunningOnMono = Type.GetType("Mono.Runtime") != null;

/// <summary>
/// Based on some internal methods used my mono itself
/// https://github.com/mono/mono/blob/master/mcs/class/corlib/System/Environment.cs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public PowershellCompletionInstaller(ICommandOutputProvider commandOutputProvide

public override void Install(bool dryRun)
{
if (ExecutionEnvironment.IsRunningOnNix || ExecutionEnvironment.IsRunningOnMac || ExecutionEnvironment.IsRunningOnMono)
if (ExecutionEnvironment.IsRunningOnNix || ExecutionEnvironment.IsRunningOnMac)
throw new CommandException("Unable to install for powershell on non-windows platforms. Please use --shell=pwsh instead.");
base.Install(dryRun);
}
Expand Down
21 changes: 10 additions & 11 deletions source/Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="!$([MSBuild]::IsOSUnixLike())">net462;netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSUnixLike())">netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Sinks.TextWriter" Version="2.1.0" />
<PackageReference Include="NSubstitute" Version="4.4.0" />
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.36" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Sinks.TextWriter" Version="3.0.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="FluentAssertions" Version="8.2.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.41" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CommandLine\CommandLine.csproj" />
</ItemGroup>

</Project>
</Project>