Skip to content

Commit

Permalink
Deterministic builds, AOT and trimming.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Aug 20, 2024
1 parent 07d4833 commit dd996c3
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 66 deletions.
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<CheckNotRecommendedTargetFramework>false</CheckNotRecommendedTargetFramework>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<DefineConstants>TRIMMING_COMPATIBLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">
<DefineConstants>AOT_COMPATIBLE</DefineConstants>
</PropertyGroup>
</Project>
16 changes: 16 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.4" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="ThreadSafeRandomizer" Version="1.1.4" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Mark Cilia Vincenti
Copyright (c) 2024 Mark Cilia Vincenti

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions ThreadSafeRandomizer.Tests.NetFramework/Tests.cs

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<TargetFrameworks>net48;net6.0;net7.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
14 changes: 7 additions & 7 deletions ThreadSafeRandomizer.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThreadSafeRandomizer", "ThreadSafeRandomizer\ThreadSafeRandomizer.csproj", "{3BB254B4-CC11-4C29-8836-F59C752A9362}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreadSafeRandomizer.Tests.NetFramework", "ThreadSafeRandomizer.Tests.NetFramework\ThreadSafeRandomizer.Tests.NetFramework.csproj", "{314E61C6-7817-4BC7-BA17-611285F2B511}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThreadSafeRandomizer.Tests", "ThreadSafeRandomizer.Tests\ThreadSafeRandomizer.Tests.csproj", "{E4C139A2-160E-4609-B375-8FB378F7C226}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreadSafeRandomizer.Tests.Net60", "ThreadSafeRandomizer.Tests.Net60\ThreadSafeRandomizer.Tests.Net60.csproj", "{E4C139A2-160E-4609-B375-8FB378F7C226}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B84D63AB-004D-4338-8E5F-3C4E45E2F512}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -19,10 +23,6 @@ Global
{3BB254B4-CC11-4C29-8836-F59C752A9362}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BB254B4-CC11-4C29-8836-F59C752A9362}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BB254B4-CC11-4C29-8836-F59C752A9362}.Release|Any CPU.Build.0 = Release|Any CPU
{314E61C6-7817-4BC7-BA17-611285F2B511}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{314E61C6-7817-4BC7-BA17-611285F2B511}.Debug|Any CPU.Build.0 = Debug|Any CPU
{314E61C6-7817-4BC7-BA17-611285F2B511}.Release|Any CPU.ActiveCfg = Release|Any CPU
{314E61C6-7817-4BC7-BA17-611285F2B511}.Release|Any CPU.Build.0 = Release|Any CPU
{E4C139A2-160E-4609-B375-8FB378F7C226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4C139A2-160E-4609-B375-8FB378F7C226}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4C139A2-160E-4609-B375-8FB378F7C226}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
32 changes: 20 additions & 12 deletions ThreadSafeRandomizer/ThreadSafeRandomizer.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard1.0;net6.0;net7.0</TargetFrameworks>
<Authors>Mark Cilia Vincenti</Authors>
<RepositoryUrl>https://github.com/MarkCiliaVincenti/ThreadSafeRandomizer.git</RepositoryUrl>
<PackageProjectUrl>https://github.com/MarkCiliaVincenti/ThreadSafeRandomizer</PackageProjectUrl>
<Copyright>MIT</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>1.1.4</Version>
<Version>1.2.0</Version>
<PackageIcon>logo.png</PackageIcon>
<PackageReleaseNotes>Enabled deterministic builds, allowing debugging of this library from your code.</PackageReleaseNotes>
<PackageReleaseNotes>Deterministic builds, AOT and trimming.</PackageReleaseNotes>
<Description>An efficient thread-safe randomizer.</Description>
<Copyright2023 Mark Cilia Vincenti</Copyright>
<Copyright2024 Mark Cilia Vincenti</Copyright>
<PackageTags>random,randomizer,randomiser,threadsafe,thread-safe</PackageTags>
<RepositoryType>git</RepositoryType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<AssemblyVersion>1.1.4.0</AssemblyVersion>
<FileVersion>1.1.4.0</FileVersion>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsPackable>true</IsPackable>
<IsTrimmable>true</IsTrimmable>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<PublishTrimmed>true</PublishTrimmed>
<TrimmerDefaultAction>link</TrimmerDefaultAction>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>ThreadSafeRandomizer.snk</AssemblyOriginatorKeyFile>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="$(DefineConstants.Contains(AOT_COMPATIBLE))">
<IsAotCompatible>true</IsAotCompatible>
<PublishAot>true</PublishAot>
</PropertyGroup>

<PropertyGroup Condition="$(DefineConstants.Contains(TRIMMING_COMPATIBLE))">
<PublishTrimmed>true</PublishTrimmed>
<TrimmerDefaultAction>link</TrimmerDefaultAction>
</PropertyGroup>


<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="DotNet.ReproducibleBuilds" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit dd996c3

Please sign in to comment.