Skip to content

Commit

Permalink
Merge branch 'net8'
Browse files Browse the repository at this point in the history
  • Loading branch information
tompazourek committed Nov 19, 2023
2 parents d93b388 + 62c3425 commit eb30e87
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 55 deletions.
12 changes: 8 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
image: Visual Studio 2022

# Adds "+build.XXX" to MinVer's build metadata
environment:
# Adds "+build.XXX" to MinVer's build metadata
MINVERBUILDMETADATA: build.%APPVEYOR_BUILD_NUMBER%
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

# AppVeyor's displayed version, will get updated by MSBuild target
version: '{build}'

before_build:
- choco install dotnet-sdk --version 8.0.100
- dotnet restore

build_script:
- dotnet build --no-restore --configuration Release
- dotnet build --no-restore --configuration Release -p:GeneratePackageOnBuild=true -p:ContinuousIntegrationBuild=true

test_script:
- dotnet test --no-build --configuration Release -p:CollectCoverage=true

after_test:
- choco install codecov
- pwsh: codecov --file @(ls ./testresults/*.opencover.xml)
- pwsh: codecov --file @(Get-ChildItem -Path artifacts/coverage/*opencover*.xml -Recurse)

artifacts:
- path: ./**/*.nupkg
- path: artifacts/package/**/*.nupkg
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.vs/
bin/
obj/
testresults/
artifacts/
*.user
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
6 changes: 0 additions & 6 deletions src/Rationals/Properties/AssemblyInfo.cs

This file was deleted.

59 changes: 24 additions & 35 deletions src/Rationals/Rationals.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0;net40;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard2.0;net40;net6.0;net8.0</TargetFrameworks>
<LangVersion>7.3</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<!-- Documents, symbols, validation -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ContinuousIntegrationBuild Condition="'$(CI)'=='true'">true</ContinuousIntegrationBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb;$(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EnablePackageValidation>true</EnablePackageValidation>

<!-- Strong-named assembly -->
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)../../rationals.snk</AssemblyOriginatorKeyFile>

<!-- Package/Assembly metadata -->
<Authors>Tomáš Pažourek</Authors>
<Company>$(Authors)</Company>
<Copyright>$(Copyright)</Copyright>
<Copyright>Copyright $([System.DateTime]::Now.Year) $(Company)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/tompazourek/Rationals</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -21,38 +24,24 @@
<PackageReleaseNotes>$(RepositoryUrl)/releases</PackageReleaseNotes>
<PackageIcon>logo_64.png</PackageIcon>
<PackageTags>arbitrary-precision biginteger bigrational c-sharp coefficients continued-fractions fraction fractional rational-numbers rational-number-arithmetic rationals</PackageTags>
<Description>
Implementation of rational number arithmetic for .NET with arbitrary precision.

Supported features:

- implicit conversions - rationals integrate seamlessly with other number types
- unlimited precision - rationals use BigInteger inside
- canonical form - each rational can have its canonical form (irreducible fraction where denominator is always positive)
- separate whole and fractional part - any rational number can be separated into a whole part (integer quotient aka result of integer division) and fractional part (reminder of the integral division aka result of modulo operation)
- comparison &amp;amp; equality
- multiple formatting options - ToString("C") (canonical form), ToString("W") (whole + fractional part), or normal fraction format
- continued fraction expansion - expand rational numbers to continued fraction (sequence of coefficients), construct rational numbers from sequence of continued fraction coefficients
- rational number approximation - approximate floating point numbers (decimal, double, float) as rational numbers with customizable tolerance

Example usage:

Rational left = (Rational) 1 / 2;

Rational right = (Rational) 1 / 4;

Rational sum = left + right; // equals to: 3 / 4
</Description>
<Description>Implementation of rational number arithmetic for .NET with arbitrary precision.</Description>
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.CLSCompliantAttribute">
<_Parameter1>true</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.InteropServices.ComVisibleAttribute">
<_Parameter1>false</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.InteropServices.GuidAttribute">
<_Parameter1>64844312-c711-4e37-ac63-65bcb449afb7</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="MinVer" Version="4.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -62,7 +51,7 @@
<None Include="..\..\assets\logo_64.png" Pack="true" PackagePath="" />
<None Include="..\..\README.md" Pack="true" PackagePath="" />
</ItemGroup>
<Target Name="UpdateAppVeyorBuildVersion" AfterTargets="MinVer" Condition=" '$(APPVEYOR)' == 'true' ">
<Target Name="UpdateAppVeyorBuildVersion" AfterTargets="MinVer" Condition="'$(APPVEYOR)'=='true'">
<Exec Command="appveyor UpdateBuild -Version &quot;$(MinVerVersion)&quot;" />
</Target>
</Project>
13 changes: 7 additions & 6 deletions tests/Rationals.Tests/Rationals.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>

<!-- Coverage -->
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<CoverletOutput>$(MSBuildThisFileDirectory)../../testresults/$(MSBuildProjectName).opencover.xml</CoverletOutput>
<CoverletOutput>$(ArtifactsPath)/coverage/$(MSBuildProjectName)/opencover.xml</CoverletOutput>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="OpenCover" Version="4.7.1221" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit eb30e87

Please sign in to comment.