Skip to content

Commit

Permalink
Strong name assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam committed Nov 18, 2024
1 parent 54e2668 commit 394875d
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 45 deletions.
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
<PackageReleaseNotes>https://github.com/searchpioneer/ranklib-dotnet/releases</PackageReleaseNotes>
<PackageTags>search;ranking;learning-to-rank;ranklib;machine-learning;ltr;ml;lambdamart;mart;ranknet;rankboost;adarank;lambdarank</PackageTags>
<LangVersion>latest</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup>
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), RankLib.sln))</SolutionRoot>
<AssemblyOriginatorKeyFile>$(SolutionRoot)build\keys\keypair.snk</AssemblyOriginatorKeyFile>
<PublicKey>0024000004800000940000000602000000240000525341310004000001000100190c74f306768e3fb8f83a87bad2bd8629d2c7e1632dc9122bdd142e949899d0c0955417f7864a71ec6baa64ab2d77dd73440778672a3575005912cec51f7fafe904d0e168645766084730f9c31b41498ec9084cd7c11f5562af4e3a9e1786de2932b9d5347b78ec0c66a3f04298a8fa92da26b430b50690ac8898ffff3697f8</PublicKey>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
Expand Down
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="MathNet.Numerics" Version="5.0.0" />
<PackageVersion Include="MathNet.Numerics.Signed" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.1"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
Expand All @@ -22,6 +22,7 @@
<ItemGroup>
<PackageVersion Include="Meziantou.Extensions.Logging.Xunit" Version="1.0.7" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="StrongNamer" Version="0.2.5"/>
<PackageVersion Include="xunit" Version="2.9.2"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
Expand Down
Binary file added build/keys/keypair.snk
Binary file not shown.
Binary file added build/keys/publickey.snk
Binary file not shown.
Binary file modified nuget-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<PropertyGroup>
<IsPackable>true</IsPackable>
<SignAssembly>true</SignAssembly>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugSymbols>true</DebugSymbols>
Expand Down
7 changes: 5 additions & 2 deletions src/RankLib.Cli/RankLib.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<PackageId>SearchPioneer.RankLib.Cli</PackageId>
<Title>RankLib.Cli</Title>
<Description>Learning to Rank (LTR) command line interface (CLI) tool for .NET, with implementations of popular ranking algorithms</Description>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -24,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests"/>
<InternalsVisibleTo Include="RankLib.Comparison.Tests"/>
<InternalsVisibleTo Include="$(AssemblyName).Tests" Key="$(PublicKey)" />
<InternalsVisibleTo Include="RankLib.Comparison.Tests" Key="$(PublicKey)" />
</ItemGroup>

</Project>
9 changes: 6 additions & 3 deletions src/RankLib/RankLib.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>SearchPioneer.RankLib</PackageId>
<Title>RankLib</Title>
<Description>Learning to Rank (LTR) library for .NET, with implementations of popular ranking algorithms</Description>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -9,12 +12,12 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="MathNet.Numerics" />
<PackageReference Include="MathNet.Numerics.Signed" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
<InternalsVisibleTo Include="$(AssemblyName).Cli" />
<InternalsVisibleTo Include="$(AssemblyName).Tests" Key="$(PublicKey)" />
<InternalsVisibleTo Include="$(AssemblyName).Cli" Key="$(PublicKey)" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
<PropertyGroup>
<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
</Project>
15 changes: 3 additions & 12 deletions tests/RankLib.Cli.Tests/ProgramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ public class ProgramTests

private static readonly object DataPointLock = new();

[Fact]
public void TestCLINoArgs()
{
lock (DataPointLock)
{
Program.Main([]);
}
}

[Fact]
public void TestCoorAscent()
{
Expand Down Expand Up @@ -91,7 +82,7 @@ private void WriteRandomDataCount(TempFile dataFile, int numQ, int numD)
}

[Fact]
public void TestRF()
public void TestRandomForests()
{
using var dataFile = new TempFile();
using var modelFile = new TempFile();
Expand All @@ -101,7 +92,7 @@ public void TestRF()
}

[Fact]
public void TestLinearReg()
public void TestLinearRegression()
{
using var dataFile = new TempFile();
using var modelFile = new TempFile();
Expand All @@ -111,7 +102,7 @@ public void TestLinearReg()
}

[Fact]
public void TestCAscent()
public void TestCoordinateAscent()
{
using var dataFile = new TempFile();
using var modelFile = new TempFile();
Expand Down
1 change: 1 addition & 0 deletions tests/RankLib.Cli.Tests/RankLib.Cli.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="Meziantou.Extensions.Logging.Xunit" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="StrongNamer" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ItemGroup>
<PackageReference Include="Meziantou.Extensions.Logging.Xunit" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="StrongNamer" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
Expand Down
55 changes: 28 additions & 27 deletions tests/RankLib.Tests/RankLib.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\RankLib\RankLib.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Meziantou.Extensions.Logging.Xunit" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\RankLib\RankLib.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Meziantou.Extensions.Logging.Xunit"/>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="StrongNamer"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Content Include="..\data\lambdamart.model">
<Link>lambdamart.model</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\data\sample_judgments_with_features.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="..\data\lambdamart.model">
<Link>lambdamart.model</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\data\sample_judgments_with_features.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>

0 comments on commit 394875d

Please sign in to comment.