Skip to content

Commit

Permalink
feat: Updated to net9
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Dec 10, 2024
1 parent b2faa13 commit 96aae73
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 19 deletions.
9 changes: 9 additions & 0 deletions H.InputSimulator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.InputSimulator.UnitTests"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "H.InputSimulator.IntegrationTests", "src\tests\H.InputSimulator.IntegrationTests\H.InputSimulator.IntegrationTests.csproj", "{AA028745-7520-4DB3-A047-9299D6FD2413}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "helpers", "helpers", "{87192D70-B0E1-4BFC-A05E-06A16765E1C5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingHelper", "src\helpers\TrimmingHelper\TrimmingHelper.csproj", "{0816DBD8-AD39-497F-824B-6DCD5B16D37D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -48,6 +52,10 @@ Global
{AA028745-7520-4DB3-A047-9299D6FD2413}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA028745-7520-4DB3-A047-9299D6FD2413}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA028745-7520-4DB3-A047-9299D6FD2413}.Release|Any CPU.Build.0 = Release|Any CPU
{0816DBD8-AD39-497F-824B-6DCD5B16D37D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0816DBD8-AD39-497F-824B-6DCD5B16D37D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0816DBD8-AD39-497F-824B-6DCD5B16D37D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0816DBD8-AD39-497F-824B-6DCD5B16D37D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -56,6 +64,7 @@ Global
{8C39C5CD-A8D1-4528-9FCE-0190BD515466} = {6E5BF389-3D3F-4D74-9DD0-3B199CB529C5}
{F2548AE2-D736-4C21-942F-55C4F592EFF2} = {9CAA231D-7BE1-46C9-ACD6-EB2E569CEBEA}
{AA028745-7520-4DB3-A047-9299D6FD2413} = {9CAA231D-7BE1-46C9-ACD6-EB2E569CEBEA}
{0816DBD8-AD39-497F-824B-6DCD5B16D37D} = {87192D70-B0E1-4BFC-A05E-06A16765E1C5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1493AEE4-9211-46E9-BFE6-8F629EAC5693}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Allows you to simulate global mouse and keyboard events.
Features:
- Supports scan codes and multi-language input.
- Supports WPF/WinForms/Console windows apps.
- Supports .NET Standard, .Net Core and .Net 5.
- Supports .NET Standard 2.0+, .Net Framework 4.6.2 and .Net 8+.
- Supports trimming/nativeAOT, nullability, and other modern C# features.

Supported OS:
- Windows
Expand Down
1 change: 1 addition & 0 deletions src/helpers/TrimmingHelper/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine("Build, rebuild or publish this app to see trimming warnings.");
30 changes: 30 additions & 0 deletions src/helpers/TrimmingHelper/TrimmingHelper.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>

<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\libs\H.InputSimulator\H.InputSimulator.csproj" />
</ItemGroup>

<ItemGroup>
<TrimmerRootAssembly Include="H.InputSimulator" />
</ItemGroup>

<PropertyGroup Label="Publish">
<RuntimeIdentifier Condition="$([MSBuild]::IsOSPlatform('windows'))">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="!$([MSBuild]::IsOSPlatform('windows'))">osx-arm64</RuntimeIdentifier>

<SelfContained>true</SelfContained>
</PropertyGroup>

<Target Name="ProduceTrimmingWarnings" AfterTargets="Build">
<CallTarget Targets="Publish"/>
</Target>

</Project>
34 changes: 23 additions & 11 deletions src/libs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@
</PropertyGroup>

<ItemGroup Label="Nuget">
<None Include="$(SolutionDir)assets\nuget_icon.png" Pack="true" PackagePath="\"/>
<None Include="$(SolutionDir)README.md" Pack="true" PackagePath="\"/>
<PackageReference Include="ConventionalCommitsGitInfo" Version="0.3.6">
<None Include="$(MSBuildThisFileDirectory)../../assets/nuget_icon.png" Pack="true" PackagePath="\" Visible="false" />
<None Include="$(MSBuildThisFileDirectory)../../README.md" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>

<PropertyGroup Label="Versioning">
<MinVerMinimumMajorMinor>2.1</MinVerMinimumMajorMinor>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleaseIdentifiers>dev</MinVerDefaultPreReleaseIdentifiers>
</PropertyGroup>

<ItemGroup Label="Versioning">
<PackageReference Include="MinVer" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="SetSemanticVersionSettings" BeforeTargets="SetSemanticVersion">
<PropertyGroup>
<ConventionalCommitsGitInfo_BaseVersion>1.3.0</ConventionalCommitsGitInfo_BaseVersion>
<ConventionalCommitsGitInfo_BaseCommit>ae6fb7890fc1938c3c85eacd6e40bd0e9aa38b3d</ConventionalCommitsGitInfo_BaseCommit>
</PropertyGroup>
</Target>

<ItemGroup Label="Source Link">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -60,7 +62,17 @@
<PropertyGroup Label="Analyzers">
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<AnalysisMode>All</AnalysisMode>
</PropertyGroup>

<PropertyGroup Label="Trimmable" Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<IsAotCompatible>true</IsAotCompatible>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsTrimmable>true</IsTrimmable>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>

</Project>
12 changes: 10 additions & 2 deletions src/libs/H.InputSimulator/H.InputSimulator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net4.5.1;netstandard2.0;netstandard1.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net4.6.2;netstandard2.0;net8.0;net9.0</TargetFrameworks>
<RootNamespace>WindowsInput</RootNamespace>
<NoWarn>$(NoWarn);CA1707;CA1720;CA1712;CA1069;CA5392</NoWarn>
<NoWarn>$(NoWarn);IDE0190</NoWarn>
Expand All @@ -18,12 +18,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta">
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net4.6.2' ">
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Memory" Version="4.6.0" />
</ItemGroup>

<PropertyGroup Label="NuGet">
<Description>Allows you to simulate global mouse and keyboard events.
Features:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net4.8;net8.0-windows</TargetFrameworks>
<TargetFrameworks>net4.8;net9.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.ComponentModel;

namespace WindowsInput.Tests.UnicodeText;

public partial class UnicodeTestForm : Form
Expand All @@ -7,6 +9,7 @@ public UnicodeTestForm()
InitializeComponent();
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Expected
{
get { return ExpectedTextBox.Text; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-windows;net4.8</TargetFrameworks>
<TargetFrameworks>net9.0-windows;net4.8</TargetFrameworks>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest" Version="3.6.4" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
</ItemGroup>

Expand Down

0 comments on commit 96aae73

Please sign in to comment.