Преглед изворни кода

Merge nuspec and CommonAssemblyInfo into csproj (#1256)

* GeneratePackageOnBuild
IncludeSymbols

* Add packages to artifacts

* Update src/Renci.SshNet/Renci.SshNet.csproj

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* Update Renci.SshNet.csproj

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* Delete build/nuget/SSH.NET.nuspec

* Delete SSH.NET.nuspec from .sln file

* Update Renci.SshNet.csproj

* Update build.proj

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Scott Xu пре 1 година
родитељ
комит
323b514be7

+ 0 - 6
Renci.SshNet.sln

@@ -5,11 +5,6 @@ VisualStudioVersion = 17.5.33326.253
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{94EE3919-19FA-4D9B-8DA9-249050B15232}"
-	ProjectSection(SolutionItems) = preProject
-		build\nuget\SSH.NET.nuspec = build\nuget\SSH.NET.nuspec
-	EndProjectSection
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sandcastle", "sandcastle", "{A6C3FFD3-16A5-44D3-8C1F-3613D6DD17D1}"
 	ProjectSection(SolutionItems) = preProject
 		build\sandcastle\SSH.NET.shfbproj = build\sandcastle\SSH.NET.shfbproj
@@ -224,7 +219,6 @@ Global
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 		{2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D} = {04E8CC26-116E-4116-9558-7ED542548E70}
-		{94EE3919-19FA-4D9B-8DA9-249050B15232} = {2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D}
 		{A6C3FFD3-16A5-44D3-8C1F-3613D6DD17D1} = {2D6CAE62-D053-476F-9BDD-2B1F27FA9C5D}
 		{D21A4D03-0AC2-4613-BB6D-74D2D16A72CC} = {04E8CC26-116E-4116-9558-7ED542548E70}
 		{2F4155AA-750A-4D33-B2E6-ED06660016CE} = {04E8CC26-116E-4116-9558-7ED542548E70}

+ 2 - 0
appveyor.yml

@@ -55,5 +55,7 @@ for:
 #    - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap
 
 artifacts:
+  - path: 'src\**\*.nupkg'
+  - path: 'src\**\*.snupkg'
   - path: artifacts
     name: artifacts

+ 2 - 2
build/build.proj

@@ -83,7 +83,7 @@
 	</Target>
 	
 	<Target Name="CreateNuGetPackage" DependsOnTargets="ValidatePackage;CheckNuGetPackageDirectory;CheckReleaseVersion">
-		<Exec Command="$(NuGetExe) pack $(MSBuildThisFileDirectory)nuget\SSH.NET.nuspec -OutputDirectory &quot;$(MSBuildThisFileDirectory)target&quot; -Version &quot;$(ReleaseVersion)&quot; -Properties &quot;copyright=2012-$([System.DateTime]::Now.Year), RENCI&quot; -BasePath &quot;$(NuGetPackageDirectory)&quot; -NonInteractive"/>
+		<Exec Command="dotnet pack $(MSBuildThisFileDirectory)..\src\Renci.SshNet\Renci.SshNet.csproj --no-build --output &quot;$(MSBuildThisFileDirectory)target&quot;"/>
 	</Target>
 	
 	<Target Name="GenerateHelpFile" DependsOnTargets="CheckReleaseVersion">
@@ -160,4 +160,4 @@
 			</Code>
 		</Task>
 	</UsingTask>
-</Project>
+</Project>

+ 0 - 40
build/nuget/SSH.NET.nuspec

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-    <metadata>
-        <id>SSH.NET</id>
-        <version>$version$</version>
-        <title>SSH.NET</title>
-        <authors>Renci</authors>
-        <owners>olegkap,drieseng</owners>
-        <license type="expression">MIT</license>
-        <projectUrl>https://github.com/sshnet/SSH.NET/</projectUrl>
-        <requireLicenseAcceptance>false</requireLicenseAcceptance>
-        <description>SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism and with broad framework support.</description>
-        <releaseNotes>https://github.com/sshnet/SSH.NET/releases/tag/$version$</releaseNotes>
-        <summary>A Secure Shell (SSH) library for .NET, optimized for parallelism.</summary>
-        <copyright>$copyright$</copyright>
-        <language>en-US</language>
-        <tags>ssh scp sftp</tags>
-        <dependencies>
-          <group targetFramework="net462">
-            <dependency id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" />
-          </group>
-          <group targetFramework="netstandard2.0">
-            <dependency id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" />
-            <dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
-          </group>          
-          <group targetFramework="netstandard2.1">
-            <dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
-          </group>
-          <group targetFramework="net6.0">
-            <dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
-          </group>
-          <group targetFramework="net7.0">
-            <dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
-          </group>
-          <group targetFramework="net8.0">
-            <dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
-          </group>
-        </dependencies>
-    </metadata>
-</package>

+ 2 - 2
src/Renci.SshNet/Properties/AssemblyInfo.cs

@@ -1,8 +1,8 @@
-using System.Reflection;
+using System;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
-[assembly: AssemblyTitle("SSH.NET")]
+[assembly: CLSCompliant(false)]
 [assembly: Guid("ad816c5e-6f13-4589-9f3e-59523f8b77a4")]
 [assembly: InternalsVisibleTo("Renci.SshNet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f9194e1eb66b7e2575aaee115ee1d27bc100920e7150e43992d6f668f9737de8b9c7ae892b62b8a36dd1d57929ff1541665d101dc476d6e02390846efae7e5186eec409710fdb596e3f83740afef0d4443055937649bc5a773175b61c57615dac0f0fd10f52b52fedf76c17474cc567b3f7a79de95dde842509fb39aaf69c6c2")]
 [assembly: InternalsVisibleTo("Renci.SshNet.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f9194e1eb66b7e2575aaee115ee1d27bc100920e7150e43992d6f668f9737de8b9c7ae892b62b8a36dd1d57929ff1541665d101dc476d6e02390846efae7e5186eec409710fdb596e3f83740afef0d4443055937649bc5a773175b61c57615dac0f0fd10f52b52fedf76c17474cc567b3f7a79de95dde842509fb39aaf69c6c2")]

+ 0 - 26
src/Renci.SshNet/Properties/CommonAssemblyInfo.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")]
-[assembly: AssemblyCompany("Renci")]
-[assembly: AssemblyProduct("SSH.NET")]
-[assembly: AssemblyCopyright("Copyright © Renci 2010-2023")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: AssemblyVersion("2023.0.1")]
-[assembly: AssemblyFileVersion("2023.0.1")]
-[assembly: AssemblyInformationalVersion("2023.0.1")]
-[assembly: CLSCompliant(false)]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-#if DEBUG
-[assembly: AssemblyConfiguration("Debug")]
-#else
-[assembly: AssemblyConfiguration("Release")]
-#endif

+ 31 - 2
src/Renci.SshNet/Renci.SshNet.csproj

@@ -1,10 +1,27 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <AssemblyName>Renci.SshNet</AssemblyName>
+    <Product>SSH.NET</Product>
+    <AssemblyTitle>SSH.NET</AssemblyTitle>
     <TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
   </PropertyGroup>
 
+  <PropertyGroup>
+    <PackageId>SSH.NET</PackageId>
+    <Title>SSH.NET</Title>
+    <Version>2023.0.1</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>
+    <Authors>Renci</Authors>
+    <PackageIcon>SS-NET-icon-h500.png</PackageIcon>
+    <PackageReadmeFile>README.md</PackageReadmeFile>
+    <PackageTags>ssh; scp; sftp</PackageTags>
+    <PackageReleaseNotes>https://github.com/sshnet/SSH.NET/releases/tag/$(Version)</PackageReleaseNotes>
+    <IncludeSymbols>True</IncludeSymbols>
+    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
+  </PropertyGroup>
+
   <PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')) ">
     <EnableTrimAnalyzer>true</EnableTrimAnalyzer>
     <EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
@@ -22,4 +39,16 @@
   <ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
     <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
   </ItemGroup>
-</Project>
+
+  <ItemGroup>
+    <None Include="..\..\images\logo\png\SS-NET-icon-h500.png">
+      <Pack>True</Pack>
+      <PackagePath>\</PackagePath>
+    </None>
+    <None Include="..\..\README.md">
+      <Pack>True</Pack>
+      <PackagePath>\</PackagePath>
+    </None>
+  </ItemGroup>
+
+</Project>