mirror of https://github.com/winsw/winsw
Upgrade to .NET 7
parent
eef5bade59
commit
fb9c7f396a
|
@ -1,6 +1,6 @@
|
||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'net6.0-windows'">
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'net7.0-windows'">
|
||||||
<DefineConstants>VNEXT</DefineConstants>
|
<DefineConstants>VNEXT</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,6 @@ strategy:
|
||||||
Release:
|
Release:
|
||||||
BuildConfiguration: Release
|
BuildConfiguration: Release
|
||||||
steps:
|
steps:
|
||||||
- task: UseDotNet@2
|
|
||||||
displayName: Install .NET SDK
|
|
||||||
inputs:
|
|
||||||
packageType: sdk
|
|
||||||
version: 6.x
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Build
|
displayName: Build
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -38,8 +33,8 @@ steps:
|
||||||
projects: src\WinSW.sln
|
projects: src\WinSW.sln
|
||||||
arguments: -c $(BuildConfiguration) -p:Version=$(BuildVersion)
|
arguments: -c $(BuildConfiguration) -p:Version=$(BuildVersion)
|
||||||
- script: |
|
- script: |
|
||||||
dotnet publish -c $(BuildConfiguration) -f net6.0-windows -r win-x64 src\WinSW\WinSW.csproj -p:Version=$(BuildVersion)
|
dotnet publish -c $(BuildConfiguration) -f net7.0-windows -r win-x64 --sc src\WinSW\WinSW.csproj -p:Version=$(BuildVersion)
|
||||||
dotnet publish -c $(BuildConfiguration) -f net6.0-windows -r win-x86 src\WinSW\WinSW.csproj -p:Version=$(BuildVersion)
|
dotnet publish -c $(BuildConfiguration) -f net7.0-windows -r win-x86 --sc src\WinSW\WinSW.csproj -p:Version=$(BuildVersion)
|
||||||
displayName: Build
|
displayName: Build
|
||||||
- script: dotnet test -c $(BuildConfiguration) --collect "XPlat Code Coverage" --no-build src\WinSW.Tests\WinSW.Tests.csproj
|
- script: dotnet test -c $(BuildConfiguration) --collect "XPlat Code Coverage" --no-build src\WinSW.Tests\WinSW.Tests.csproj
|
||||||
displayName: Test
|
displayName: Test
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
using System.Runtime.CompilerServices;
|
#if NET
|
||||||
|
using System.Reflection;
|
||||||
|
#endif
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
[assembly: AssemblyMetadata("IsTrimmable", "True")]
|
||||||
|
#endif
|
||||||
[assembly: InternalsVisibleTo("WinSW")]
|
[assembly: InternalsVisibleTo("WinSW")]
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<linker>
|
||||||
|
<assembly fullname="WinSW.Core">
|
||||||
|
<namespace fullname="WinSW.Configuration" />
|
||||||
|
</assembly>
|
||||||
|
</linker>
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net20;net40;net461;net6.0-windows</TargetFrameworks>
|
<TargetFrameworks>net20;net40;net461;net7.0-windows</TargetFrameworks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
@ -18,12 +18,18 @@
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-windows'">
|
||||||
<PackageReference Include="System.Security.AccessControl" Version="5.0.0" />
|
<PackageReference Include="System.Security.AccessControl" Version="6.0.0" />
|
||||||
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0" />
|
<PackageReference Include="System.ServiceProcess.ServiceController" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-windows'">
|
||||||
|
<EmbeddedResource Include="ILLink.Descriptors.xml">
|
||||||
|
<LogicalName>ILLink.Descriptors.xml</LogicalName>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' != 'net7.0-windows'">
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net20;net40;net461;net6.0-windows</TargetFrameworks>
|
<TargetFrameworks>net20;net40;net461;net7.0-windows</TargetFrameworks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
<ItemGroup Condition="'$(TargetFramework)' != 'net7.0-windows'">
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net40;net461;net6.0-windows</TargetFrameworks>
|
<TargetFrameworks>net40;net461;net7.0-windows</TargetFrameworks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -10,13 +10,16 @@
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
<ItemGroup Condition="'$(TargetFramework)' != 'net7.0-windows'">
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
using System.Runtime.CompilerServices;
|
#if NET
|
||||||
|
using System.Reflection;
|
||||||
|
#endif
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
#if NET
|
||||||
|
[assembly: AssemblyMetadata("IsTrimmable", "True")]
|
||||||
|
#endif
|
||||||
[assembly: InternalsVisibleTo("Winsw.Tests")]
|
[assembly: InternalsVisibleTo("Winsw.Tests")]
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFrameworks>net20;net40;net461;net6.0-windows</TargetFrameworks>
|
<TargetFrameworks>net20;net40;net461;net7.0-windows</TargetFrameworks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
|
||||||
|
|
||||||
<AssemblyTitle>Windows Service Wrapper</AssemblyTitle>
|
<AssemblyTitle>Windows Service Wrapper</AssemblyTitle>
|
||||||
<Description>Allows arbitrary process to run as a Windows service by wrapping it.</Description>
|
<Description>Allows arbitrary process to run as a Windows service by wrapping it.</Description>
|
||||||
|
@ -15,15 +14,23 @@
|
||||||
<Copyright>Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors</Copyright>
|
<Copyright>Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors</Copyright>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0-windows' AND '$(RuntimeIdentifier)' != ''">
|
<PropertyGroup>
|
||||||
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
|
<TrimMode>partial</TrimMode>
|
||||||
|
<DebuggerSupport>false</DebuggerSupport>
|
||||||
|
<NullabilityInfoContextSupport>false</NullabilityInfoContextSupport>
|
||||||
|
<_AggressiveAttributeTrimming>true</_AggressiveAttributeTrimming>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0-windows' AND '$(RuntimeIdentifier)' != ''">
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
<PropertyGroup Condition="'$(TargetFramework)' != 'net7.0-windows'">
|
||||||
<ILMergeVersion>3.0.41</ILMergeVersion>
|
<ILMergeVersion>3.0.41</ILMergeVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
<ItemGroup Condition="'$(TargetFramework)' != 'net7.0-windows'">
|
||||||
<PackageReference Include="ilmerge" Version="$(ILMergeVersion)" />
|
<PackageReference Include="ilmerge" Version="$(ILMergeVersion)" />
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -33,7 +40,7 @@
|
||||||
<ProjectReference Include="..\WinSW.Plugins\WinSW.Plugins.csproj" />
|
<ProjectReference Include="..\WinSW.Plugins\WinSW.Plugins.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PublishCoreExe" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net6.0-windows'">
|
<Target Name="PublishCoreExe" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net7.0-windows'">
|
||||||
|
|
||||||
<MakeDir Directories="$(ArtifactsPublishDir)" />
|
<MakeDir Directories="$(ArtifactsPublishDir)" />
|
||||||
<Copy SourceFiles="$(PublishDir)$(TargetName).exe" DestinationFiles="$(ArtifactsPublishDir)WinSW-$(PlatformTarget).exe" />
|
<Copy SourceFiles="$(PublishDir)$(TargetName).exe" DestinationFiles="$(ArtifactsPublishDir)WinSW-$(PlatformTarget).exe" />
|
||||||
|
@ -41,7 +48,7 @@
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Merge plugins and other DLLs into the executable -->
|
<!-- Merge plugins and other DLLs into the executable -->
|
||||||
<Target Name="Merge" BeforeTargets="AfterBuild" Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
<Target Name="Merge" BeforeTargets="AfterBuild" Condition="'$(TargetFramework)' != 'net7.0-windows'">
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net20'">
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net20'">
|
||||||
<TargetPlatform>v2</TargetPlatform>
|
<TargetPlatform>v2</TargetPlatform>
|
||||||
|
|
Loading…
Reference in New Issue