Skip to content

Commit

Permalink
Fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechNagorski committed Apr 24, 2023
1 parent 7126f92 commit 89079bd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 146 deletions.
115 changes: 18 additions & 97 deletions build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,86 +8,37 @@
<MSBuildTasksPackageId>MSBuildTasks</MSBuildTasksPackageId>
<MSBuildTasksPackageVersion>1.5.0.214</MSBuildTasksPackageVersion>
</PropertyGroup>

<ItemGroup>
<VisualStudioVersionClassic Include="2012">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2012.sln</SolutionFile>
<ToolsVersion>14.0</ToolsVersion>
<VisualStudioVersion>14.0</VisualStudioVersion>
</VisualStudioVersionClassic>
<VisualStudioVersionClassic Include="2015">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2015.sln</SolutionFile>
<ToolsVersion>14.0</ToolsVersion>
<VisualStudioVersion>14.0</VisualStudioVersion>
</VisualStudioVersionClassic>
</ItemGroup>

<ItemGroup>
<VisualStudioVersionModern Include="2019">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2019.sln</SolutionFile>
<VisualStudioVersion>16.0</VisualStudioVersion>
</VisualStudioVersionModern>
</ItemGroup>

<ItemGroup>
<TargetFrameworkClassic Include="Windows Phone Silverlight 7.1">
<OutputDirectory>Renci.SshNet.WindowsPhone\bin\$(Configuration)</OutputDirectory>
<Moniker>wp71</Moniker>
</TargetFrameworkClassic>
<TargetFrameworkClassic Include="Windows Phone Silverlight 8.0">
<OutputDirectory>Renci.SshNet.WindowsPhone8\bin\$(Configuration)</OutputDirectory>
<Moniker>wp8</Moniker>
</TargetFrameworkClassic>
<TargetFrameworkClassic Include="Silverlight 4">
<OutputDirectory>Renci.SshNet.Silverlight\bin\$(Configuration)</OutputDirectory>
<Moniker>sl4</Moniker>
</TargetFrameworkClassic>
<TargetFrameworkClassic Include="Silverlight 5">
<OutputDirectory>Renci.SshNet.Silverlight5\bin\$(Configuration)</OutputDirectory>
<Moniker>sl5</Moniker>
</TargetFrameworkClassic>
<TargetFrameworkClassic Include="Universal Windows Platform 10">
<OutputDirectory>Renci.SshNet.UAP10\bin\$(Configuration)</OutputDirectory>
<Moniker>uap10</Moniker>
</TargetFrameworkClassic>
<VisualStudioVersionModern Include="2022">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.sln</SolutionFile>
<VisualStudioVersion>17.0</VisualStudioVersion>
</VisualStudioVersionModern>
</ItemGroup>

<ItemGroup>
<TargetFrameworkModern Include=".NET Framework 3.5">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net35</OutputDirectory>
<Moniker>net35</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NET Framework 4.0">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net40</OutputDirectory>
<Moniker>net40</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NETStandard 1.3">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\netstandard1.3</OutputDirectory>
<Moniker>netstandard1.3</Moniker>
<TargetFrameworkModern Include=".NET Framework 4.6.2">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net462</OutputDirectory>
<Moniker>net462</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NETStandard 2.0">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\netstandard2.0</OutputDirectory>
<Moniker>netstandard2.0</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NET 6.0">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net6.0</OutputDirectory>
<Moniker>net6.0</Moniker>
</TargetFrameworkModern>
<TargetFrameworkModern Include=".NET 7.0">
<OutputDirectory>Renci.SshNet\bin\$(Configuration)\net7.0</OutputDirectory>
<Moniker>net7.0</Moniker>
</TargetFrameworkModern>
</ItemGroup>

<Target Name="CleanClassic" DependsOnTargets="CleanSolutionClassic">
<RemoveDir Directories="$(MSBuildThisFileDirectory)target"/>
</Target>


<Target Name="CleanModern" DependsOnTargets="CleanSolutionModern">
<RemoveDir Directories="$(MSBuildThisFileDirectory)target"/>
</Target>

<Target Name="CleanSolutionClassic" Outputs="%(VisualStudioVersionClassic.Identity)">
<ItemGroup>
<ProjectToBuild Remove="@(ProjectToBuild)"/>
<ProjectToBuild Include="%(VisualStudioVersionClassic.SolutionFile)">
<Properties>Configuration=Release;VisualStudioVersion=%(VisualStudioVersionClassic.VisualStudioVersion)</Properties>
</ProjectToBuild>
</ItemGroup>
<MSBuild Projects="@(ProjectToBuild)" ToolsVersion="%(VisualStudioVersionClassic.ToolsVersion)" Targets="Clean"/>
</Target>

<Target Name="CleanSolutionModern" Outputs="%(VisualStudioVersionModern.Identity)">
<ItemGroup>
Expand All @@ -99,26 +50,11 @@
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean"/>
</Target>

<Target Name="RestoreNuGetPackagesClassic" DependsOnTargets="DownloadNuGet" Outputs="%(VisualStudioVersionClassic.Identity)">
<Message Text="Restoring nuget packages for '%(VisualStudioVersionClassic.SolutionFile)'..." Importance="High"/>
<Exec Command="$(NuGetExe) restore &quot;%(VisualStudioVersionClassic.SolutionFile)&quot;"/>
</Target>

<Target Name="RestoreNuGetPackagesModern" DependsOnTargets="DownloadNuGet" Outputs="%(VisualStudioVersionModern.Identity)">
<Message Text="Restoring nuget packages for '%(VisualStudioVersionModern.SolutionFile)'..." Importance="High"/>
<Exec Command="$(NuGetExe) restore &quot;%(VisualStudioVersionModern.SolutionFile)&quot;"/>
</Target>

<Target Name="BuildClassic" DependsOnTargets="RestoreNuGetPackagesClassic" Outputs="%(VisualStudioVersionClassic.Identity)">
<ItemGroup>
<ProjectToBuild Remove="@(ProjectToBuild)"/>
<ProjectToBuild Include="%(VisualStudioVersionClassic.SolutionFile)">
<Properties>Configuration=Release;VisualStudioVersion=%(VisualStudioVersionClassic.VisualStudioVersion)</Properties>
</ProjectToBuild>
</ItemGroup>
<MSBuild Projects="@(ProjectToBuild)" ToolsVersion="%(VisualStudioVersionClassic.ToolsVersion)" Targets="Rebuild"/>
</Target>


<Target Name="BuildModern" DependsOnTargets="RestoreNuGetPackagesModern" Outputs="%(VisualStudioVersionModern.Identity)">
<ItemGroup>
<ProjectToBuild Remove="@(ProjectToBuild)"/>
Expand All @@ -131,12 +67,7 @@

<Target Name="Package" DependsOnTargets="CreateNuGetPackage;CreateBinPackage;GenerateHelpFile"/>

<Target Name="ValidatePackage" DependsOnTargets="ValidatePackageClassic;ValidatePackageModern"/>

<Target Name="ValidatePackageClassic" DependsOnTargets="CheckNuGetPackageDirectory" Outputs="%(TargetFrameworkClassic.Identity)">
<Error Text="The 'Renci.SshNet.dll' file is not available for %(TargetFrameworkClassic.Identity) in $(NuGetPackageDirectory)\lib\%(TargetFrameworkClassic.Moniker)." Condition="!Exists('$(NuGetPackageDirectory)\lib\%(TargetFrameworkClassic.Moniker)\Renci.SshNet.dll')"/>
<Error Text="The 'Renci.SshNet.xml' file is not available for %(TargetFrameworkClassic.Identity) in $(NuGetPackageDirectory)\lib\%(TargetFrameworkClassic.Moniker)." Condition="!Exists('$(NuGetPackageDirectory)\lib\%(TargetFrameworkClassic.Moniker)\Renci.SshNet.xml')"/>
</Target>
<Target Name="ValidatePackage" DependsOnTargets="ValidatePackageModern"/>

<Target Name="ValidatePackageModern" DependsOnTargets="CheckNuGetPackageDirectory" Outputs="%(TargetFrameworkModern.Identity)">
<Error Text="The 'Renci.SshNet.dll' file is not available for %(TargetFrameworkModern.Identity) in $(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)." Condition="!Exists('$(NuGetPackageDirectory)\lib\%(TargetFrameworkModern.Moniker)\Renci.SshNet.dll')"/>
Expand All @@ -153,16 +84,6 @@
<Move SourceFiles="$(MSBuildThisFileDirectory)target\help\SshNet.Help.chm" DestinationFiles="$(MSBuildThisFileDirectory)target\SSH.NET-$(ReleaseVersion)-help.chm"/>
</Target>

<Target Name="PreparePackageClassic" DependsOnTargets="BuildClassic;CheckNuGetPackageDirectory;CheckBinaryZipPackageDirectory" Outputs="%(TargetFrameworkClassic.Identity)">
<ItemGroup>
<BuildOutput Remove="@(BuildOutput)"/>
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFrameworkClassic.OutputDirectory)\Renci.SshNet.dll"/>
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFrameworkClassic.OutputDirectory)\Renci.SshNet.xml"/>
</ItemGroup>
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(NuGetPackageDirectory)\lib\%(TargetFrameworkClassic.Moniker)"/>
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(BinPackageDirectory)\lib\%(TargetFrameworkClassic.Moniker)"/>
</Target>

<Target Name="PreparePackageModern" DependsOnTargets="BuildModern;CheckNuGetPackageDirectory" Outputs="%(TargetFrameworkModern.Identity)">
<ItemGroup>
<BuildOutput Remove="@(BuildOutput)"/>
Expand Down
28 changes: 3 additions & 25 deletions build/nuget/SSH.NET.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,15 @@
<language>en-US</language>
<tags>ssh scp sftp</tags>
<dependencies>
<group targetFramework="net35" />
<group targetFramework="net40" />
<group targetFramework="netstandard1.3">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
<dependency id="System.Diagnostics.TraceSource" version="4.3.0" />
<dependency id="System.Net.NameResolution" version="4.3.0" />
<dependency id="System.Net.Sockets" version="4.3.0" />
<dependency id="System.Threading.Thread" version="4.3.0" />
<dependency id="System.Threading.ThreadPool" version="4.3.0" />
<dependency id="System.Threading.Timer" version="4.3.0" />
<dependency id="System.Xml.XmlDocument" version="4.3.0" />
<dependency id="System.Xml.XPath.XmlDocument" version="4.3.0" />
</group>
<group targetFramework="net462" />
<group targetFramework="netstandard2.0">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="sl4">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="sl5">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="wp71">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="wp8">
<group targetFramework="net6.0">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="uap10.0">
<group targetFramework="net7.0">
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
<dependency id="System.Xml.XPath.XmlDocument" version="4.3.0" />
</group>
</dependencies>
</metadata>
Expand Down
33 changes: 12 additions & 21 deletions build/sandcastle/SSH.NET.shfbproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<!--
The configuration and platform will be used to determine which assemblies to include from solution and
project documentation sources
-->
<!-- A target framework version is required by Visual Studio. It can be any version with a targeting pack installed. -->
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<!-- The configuration and platform will be used to determine which assemblies to include from solution and
project documentation sources -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{f7266fb1-f50a-4a5b-b35a-5ea8ebdc1be9}</ProjectGuid>
<SHFBSchemaVersion>2015.6.5.0</SHFBSchemaVersion>
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
<AssemblyName>Documentation</AssemblyName>
<RootNamespace>Documentation</RootNamespace>
<Name>Documentation</Name>
<!-- SHFB properties -->
<FrameworkVersion>.NET Framework 4.0</FrameworkVersion>
<FrameworkVersion>.NET Framework 4.7.2</FrameworkVersion>
<OutputPath>..\target\help</OutputPath>
<HtmlHelpName>SshNet.Help</HtmlHelpName>
<Language>en-US</Language>
Expand All @@ -24,25 +25,15 @@
<SyntaxFilters>C#</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
<RootNamespaceContainer>False</RootNamespaceContainer>
<PresentationStyle>VS2010</PresentationStyle>
<PresentationStyle>VS2013</PresentationStyle>
<Preliminary>False</Preliminary>
<NamingMethod>Guid</NamingMethod>
<HelpTitle>SSH.NET Client Library Documentation</HelpTitle>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<ComponentConfigurations>
<ComponentConfig id="Code Block Component" enabled="True">
<component id="Code Block Component">
<basePath value="{@HtmlEncProjectFolder}" />
<outputPaths>{@HelpFormatOutputPaths}</outputPaths>
<allowMissingSource value="false" />
<removeRegionMarkers value="false" />
<colorizer syntaxFile="{@SHFBROOT}\PresentationStyles\Colorizer\highlight.xml" styleFile="{@SHFBROOT}\PresentationStyles\Colorizer\highlight.xsl" stylesheet="{@SHFBROOT}\PresentationStyles\Colorizer\highlight.css" scriptFile="{@SHFBROOT}\PresentationStyles\Colorizer\highlight.js" disabled="{@DisableCodeBlockComponent}" language="cs" tabSize="0" numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
</component>
</ComponentConfig>
</ComponentConfigurations>

<DocumentationSources>
<DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\net40\Renci.SshNet.dll" xmlns="" />
<DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\net40\Renci.SshNet.xml" xmlns="" />
<DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\net462\Renci.SshNet.dll" xmlns="" />
<DocumentationSource sourceFile="..\..\src\Renci.SshNet\bin\Release\net462\Renci.SshNet.xml" xmlns="" />
</DocumentationSources>
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
Expand All @@ -54,7 +45,7 @@
<CleanIntermediates>True</CleanIntermediates>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
the build. The others are optional common platform types that may appear. -->
the build. The others are optional common platform types that may appear. -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
Expand Down
6 changes: 3 additions & 3 deletions src/Renci.SshNet/Renci.SshNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<AssemblyOriginatorKeyFile>../Renci.SshNet.snk</AssemblyOriginatorKeyFile>
<LangVersion>6</LangVersion>
<SignAssembly>true</SignAssembly>
<TargetFrameworks>net462;netstandard2.0;net7.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
<DefineConstants>FEATURE_STRINGBUILDER_CLEAR;FEATURE_HASHALGORITHM_DISPOSE;FEATURE_REGEX_COMPILE;FEATURE_BINARY_SERIALIZATION;FEATURE_RNG_CREATE;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_EAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_SOCKET_DISPOSE;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_WAITHANDLE_DISPOSE;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_ENCODING_ASCII;FEATURE_ECDSA;FEATURE_TAP</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="SshNet.Security.Cryptography" Version="[1.3.0]" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net7.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' ">
<DefineConstants>FEATURE_STRINGBUILDER_CLEAR;FEATURE_HASHALGORITHM_DISPOSE;FEATURE_ENCODING_ASCII;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_DIRECTORYINFO_ENUMERATEFILES;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_EAP;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_SOCKET_DISPOSE;FEATURE_DNS_SYNC;FEATURE_DNS_APM;FEATURE_DNS_TAP;FEATURE_STREAM_APM;FEATURE_STREAM_TAP;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_TAP;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_WAITHANDLE_DISPOSE;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_ECDSA;FEATURE_TAP</DefineConstants>
</PropertyGroup>
</Project>

0 comments on commit 89079bd

Please sign in to comment.