Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
317c38c
GeneratePackageOnBuild
scott-xu Dec 2, 2023
4eb2360
Add packages to artifacts
scott-xu Dec 2, 2023
1593dd2
Merge branch 'develop' into generate-nuget-package
scott-xu Dec 2, 2023
3c0f4ed
Merge branch 'develop' into generate-nuget-package
scott-xu Dec 2, 2023
f33918a
Update src/Renci.SshNet/Renci.SshNet.csproj
scott-xu Dec 3, 2023
8bad9d6
Merge branch 'develop' into generate-nuget-package
scott-xu Dec 3, 2023
e58ae57
Merge branch 'develop' into generate-nuget-package
scott-xu Dec 4, 2023
2a74e7a
Update Renci.SshNet.csproj
scott-xu Dec 4, 2023
2b47495
Merge branch 'develop' into generate-nuget-package
scott-xu Dec 9, 2023
83f522d
Merge branch 'develop' into generate-nuget-package
scott-xu Jan 7, 2024
dc4deb3
Merge branch 'develop' into generate-nuget-package
scott-xu Jan 7, 2024
faae7d6
Delete build/nuget/SSH.NET.nuspec
scott-xu Jan 7, 2024
196789c
Delete SSH.NET.nuspec from .sln file
scott-xu Jan 28, 2024
f0af300
Merge branch 'develop' into generate-nuget-package
scott-xu Jan 28, 2024
28ad3c1
Update Renci.SshNet.csproj
scott-xu Jan 28, 2024
366c324
Update build.proj
scott-xu Jan 28, 2024
3efc902
init nbgv
scott-xu Jan 28, 2024
f4c3015
Merge branch 'generate-nuget-package' into nbgv
scott-xu Jan 28, 2024
04a8c89
Include version.json in "Solution Items"
scott-xu Jan 28, 2024
8ee48a4
Merge branch 'sshnet:develop' into nbgv
scott-xu Jan 29, 2024
2536152
Update Directory.Build.props
scott-xu Jan 29, 2024
be998ee
define publicReleaseRefSpec
scott-xu Jan 29, 2024
8035be2
update version.json
scott-xu Jan 29, 2024
6b533b6
update version.json
scott-xu Jan 29, 2024
edf8dc6
set cloud build number
scott-xu Jan 29, 2024
e82fc75
fix https://github.com/sshnet/SSH.NET/issues/1292
scott-xu Jan 29, 2024
ea14cbe
remove unexpected code format
scott-xu Jan 29, 2024
4585507
Delete version from csproj
scott-xu Jan 30, 2024
5ab40ea
move nbgv from Directory.Build.props to Renci.SshNet.csproj as only t…
scott-xu Jan 30, 2024
1fc5c65
Use package from CI feed
Rob-Hague Feb 3, 2024
3c6a3e1
Merge branch 'develop' into nbgv
scott-xu Feb 4, 2024
a7905b8
Merge branch 'develop' into nbgv
scott-xu Feb 16, 2024
b5d92f3
Merge remote-tracking branch 'upstream/develop' into nbgv
Rob-Hague Feb 24, 2024
7f4a63e
Bump version to 2024.0.1; Update version precision
scott-xu Feb 25, 2024
2cd7031
Merge remote-tracking branch 'upstream/develop' into nbgv
Rob-Hague Jul 26, 2024
9362bba
Some tweaks:
Rob-Hague Jul 26, 2024
a0bf4b1
Revert unnecessary test changes; remove unnecessary tests
Rob-Hague Jul 26, 2024
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
1 change: 1 addition & 0 deletions Renci.SshNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
stylecop.json = stylecop.json
THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT
version.json = version.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D21A4D03-0AC2-4613-BB6D-74D2D16A72CC}"
Expand Down
10 changes: 9 additions & 1 deletion src/Renci.SshNet/Renci.SshNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<IsPackable>true</IsPackable>
<PackageId>SSH.NET</PackageId>
<Title>SSH.NET</Title>
<Version>2024.1.0</Version>
<Description>SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.</Description>
<Copyright>Copyright © Renci 2010-$([System.DateTime]::UtcNow.Year)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand All @@ -22,6 +21,7 @@
<PackageReleaseNotes>https://github.com/sshnet/SSH.NET/releases/tag/$(Version)</PackageReleaseNotes>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<NBGV_ThisAssemblyIncludesPackageVersion>true</NBGV_ThisAssemblyIncludesPackageVersion>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>
Expand All @@ -33,6 +33,14 @@
<PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')) ">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
<!--
Any version which is 3.7.57-alpha or above, in order to pick up
https://github.com/dotnet/Nerdbank.GitVersioning/pull/1029.
-->
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.70-alpha" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
<!-- Must be kept at version 1.0.0 or higher, see https://github.com/sshnet/SSH.NET/pull/1288 for details. -->
Expand Down
12 changes: 10 additions & 2 deletions src/Renci.SshNet/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class Session : ISession
internal const byte CarriageReturn = 0x0d;
internal const byte LineFeed = 0x0a;

private static readonly string ClientVersionString =
"SSH-2.0-Renci.SshNet.SshClient." + ThisAssembly.NuGetPackageVersion.Replace('-', '_');

/// <summary>
/// Specifies maximum packet size defined by the protocol.
/// </summary>
Expand Down Expand Up @@ -313,7 +316,13 @@ public bool IsConnected
/// <value>
/// The client version.
/// </value>
public string ClientVersion { get; private set; }
public string ClientVersion
{
get
{
return ClientVersionString;
}
}

/// <summary>
/// Gets the connection info.
Expand Down Expand Up @@ -534,7 +543,6 @@ internal Session(ConnectionInfo connectionInfo, IServiceFactory serviceFactory,
throw new ArgumentNullException(nameof(socketFactory));
}

ClientVersion = "SSH-2.0-Renci.SshNet.SshClient.0.0.1";
ConnectionInfo = connectionInfo;
_serviceFactory = serviceFactory;
_socketFactory = socketFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ protected override void Act()
}
}

[TestMethod]
public void ClientVersionIsRenciSshNet()
{
Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient.0.0.1", _session.ClientVersion);
}

[TestMethod]
public void ConnectionInfoShouldReturnConnectionInfoPassedThroughConstructor()
{
Expand Down
6 changes: 5 additions & 1 deletion test/Renci.SshNet.Tests/Classes/SessionTest_Connected.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;

using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -31,7 +32,10 @@ protected override void Act()
[TestMethod]
public void ClientVersionIsRenciSshNet()
{
Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient.0.0.1", Session.ClientVersion);
Assert.IsTrue(Regex.IsMatch(
Session.ClientVersion,
// Ends with e.g. 2024.1.1 plus some optional metadata not containing '-'
@"^SSH-2\.0-Renci\.SshNet\.SshClient\.\d{4}\.\d+\.\d+(_[a-zA-Z0-9_\.]+)?$"));
}

[TestMethod]
Expand Down
6 changes: 0 additions & 6 deletions test/Renci.SshNet.Tests/Classes/SessionTest_NotConnected.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ protected override void Act()
_session = new Session(_connectionInfo, ServiceFactoryMock.Object, SocketFactoryMock.Object);
}

[TestMethod]
public void ClientVersionIsRenciSshNet()
{
Assert.AreEqual("SSH-2.0-Renci.SshNet.SshClient.0.0.1", _session.ClientVersion);
}

[TestMethod]
public void ConnectionInfoShouldReturnConnectionInfoPassedThroughConstructor()
{
Expand Down
14 changes: 14 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "2024.1.1-prerelease.{height}",
"publicReleaseRefSpec": [
"^refs/heads/develop$",
"^refs/tags/\\d{4}\\.\\d+\\.\\d+"
],
"assemblyVersion": {
"precision": "revision"
},
"nugetPackageVersion": {
"semVer": 2
}
}