Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 Release #982

Merged
merged 75 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
2712b8a
UnitsNet: 5.0.0-alpha001
angularsen Nov 1, 2021
618a1d4
CHG: Removed explicit support for net40 and net47. (#981)
ebfortin Nov 1, 2021
93d3b9b
Fix warning about invalid powershell function name
angularsen Nov 1, 2021
e950084
codegen: Fix parsing semver version with suffix in codegen
angularsen Nov 1, 2021
496ed5d
🔥 Remove Windows Runtime Component (WRC) target
angularsen Nov 1, 2021
d11361c
JsonNet: 5.0.0-alpha001
angularsen Nov 1, 2021
a2da56c
Rename json field "BaseType" to "ValueType"
angularsen Nov 1, 2021
4e88583
💥 Rename BaseUnit to ConversionBaseUnit
angularsen Nov 1, 2021
b5e0269
Fix deploying nugets on release/support branches
angularsen Nov 1, 2021
35d383e
Whitespace fixes
angularsen Nov 1, 2021
7d699a7
Add README to nuget
angularsen Nov 1, 2021
916b375
Rename TargetFrameworks to TargetFramework
angularsen Nov 1, 2021
6ec95f1
Remove System.ValueTuple ref for net40 target
angularsen Nov 1, 2021
8cfc026
Remove TypeWrapper
angularsen Nov 1, 2021
ae3bf03
🔥 Replace JetBrains.Annotations with #nullable enable
angularsen Nov 1, 2021
826d392
json: Fix nullable issues
angularsen Nov 1, 2021
1bd9cc8
Rename json field XmlDoc to XmlDocSummary
angularsen Nov 1, 2021
6c4f4d9
🔥 Remove QuantityType enum
angularsen Nov 1, 2021
245460b
🔥 Remove IQuantity.Units and .UnitNames
angularsen Nov 1, 2021
dcca62a
🔥 Remove obsolete methods in quantity classes
angularsen Nov 1, 2021
d096b6d
🔥 Remove GlobalConfiguration
angularsen Nov 1, 2021
6dd046d
🔥 json: Remove UnitsNetJsonConverter
angularsen Nov 1, 2021
1e6a823
🔥 QuantityNotFoundException
angularsen Nov 1, 2021
51fff33
🔥 Molarity ctor and operator overloads
angularsen Nov 1, 2021
9577dd3
Misc R# code fixes
angularsen Nov 1, 2021
c5c1227
Fix spelling
angularsen Nov 2, 2021
2cf619a
Fix argex
angularsen Nov 2, 2021
6187c63
UnitsNet: 5.0.0-alpha002
angularsen Nov 2, 2021
fdbb778
JsonNet: 5.0.0-alpha002
angularsen Nov 2, 2021
f3c7e25
🔥 Remove IEquatable<T> and equality operators/methods
angularsen Nov 2, 2021
64afc59
Fix tests
angularsen Nov 2, 2021
ba903bc
Fix singular name VolumeFlow.MillionUsGallonsPerDay
angularsen Nov 2, 2021
5767608
Remove UnitsNet.WindowsRuntimeComponent.sln
angularsen Nov 2, 2021
bdcea55
Use CurrentCulture rather than CurrentUICulture (#986)
pgrawehr Nov 13, 2021
a1069ef
Upgrade samples
angularsen Nov 13, 2021
17db45f
appveyor: Use VS2022 image to support net6.0
angularsen Nov 13, 2021
40893db
appveyor: skip_branch_with_pr: false
angularsen Nov 13, 2021
ad2ebba
UnitsNet: 5.0.0-alpha003
angularsen Nov 13, 2021
b17494a
Upgrade nugets
angularsen Nov 13, 2021
3ea84ee
benchmark: Add net6.0, remove netcore2.1, 3.1 and net4.7.2
angularsen Nov 13, 2021
d96bec6
Fix nullable warnings
angularsen Nov 13, 2021
721287d
Remove "s" and "v" string formats
angularsen Nov 13, 2021
5865069
Remove Undefined unit value
angularsen Nov 13, 2021
60ee7ed
fixup! Remove Undefined unit value
angularsen Nov 13, 2021
55a2904
Fix test cases after removing Undefinde
angularsen Nov 16, 2021
47cdd1f
README: Update with v5 info
angularsen Nov 16, 2021
cd37792
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Feb 8, 2022
0ddfd57
Rename ConversionBaseUnit back to BaseUnit
angularsen Feb 8, 2022
ad5311a
Revert MaxValue, MinValue, QuantityType merged in from origin/master
angularsen Feb 8, 2022
e7aeb4e
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Feb 8, 2022
3d8f632
UnitsNet: 5.0.0-alpha004
angularsen Feb 8, 2022
e2118ef
JsonNet: 5.0.0-alpha003
angularsen Feb 8, 2022
74e5072
JsonNet: 5.0.0-alpha004
angularsen Feb 8, 2022
92d4144
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Mar 20, 2022
6e2f40c
UnitsNet: 5.0.0-alpha005
angularsen Mar 20, 2022
0171225
QuantityValue: 16 bytes instead of 40 bytes (#1084)
AndreasLeeb Jun 3, 2022
d6cfbf8
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Jun 3, 2022
97a6d16
⬆️ Upgrade all net5.0 projects to net6.0
angularsen Jun 3, 2022
4fe83be
UnitsNet: 5.0.0-alpha006
angularsen Jun 3, 2022
06da6d1
Log debug info for nanoframework installation
angularsen Jun 3, 2022
8474896
Switch nanoFramework build to x64 (#1095)
josesimoes Jun 7, 2022
37fa690
appveyor: Re-enable flag to not build release/v5 twice
angularsen Jun 7, 2022
34b2b9e
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Jun 9, 2022
e9f6991
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Jun 14, 2022
3038381
💚 Fix stack overflow in tests
angularsen Jun 14, 2022
c1a2ba7
Disable azure pipelines trigger
angularsen Jun 14, 2022
eae2fd5
IQuantity with QuantityValue as Value type (PoC)
lipchev Aug 23, 2022
1a16ddb
Revert "IQuantity with QuantityValue as Value type (PoC)"
lipchev Aug 23, 2022
142a1fb
🔥 Remove UnitsNet.Serialization.JsonNet.CompatibilityTests
angularsen Sep 2, 2022
9bafef0
Return decimal for decimal-based quantities (#1074)
pgrawehr Nov 29, 2022
d8aafb5
Merge remote-tracking branch 'origin/master' into release/v5
angularsen Nov 29, 2022
9ff8142
Remove UnitsNet.Serialization.JsonNet.CompatibilityTests from build s…
angularsen Nov 29, 2022
5dc048b
cleanup
angularsen Nov 29, 2022
0838cd4
Update stats in readme
angularsen Nov 29, 2022
ac3d3cd
typo
angularsen Nov 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 3 additions & 30 deletions Build/build-functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Update-GeneratedCode {
write-host -foreground blue "Generate code...END`n"
}

function Start-Build([boolean] $IncludeWindowsRuntimeComponent = $false, [boolean] $IncludeNanoFramework = $false) {
function Start-Build([boolean] $IncludeNanoFramework = $false) {
write-host -foreground blue "Start-Build...`n---"

$fileLoggerArg = "/logger:FileLogger,Microsoft.Build;logfile=$testReportDir\UnitsNet.msbuild.log"
Expand All @@ -40,24 +40,6 @@ function Start-Build([boolean] $IncludeWindowsRuntimeComponent = $false, [boolea
dotnet build --configuration Release "$root\UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg
if ($lastexitcode -ne 0) { exit 1 }

if (-not $IncludeWindowsRuntimeComponent)
{
write-host -foreground yellow "Skipping WindowsRuntimeComponent build."
}
else
{
write-host -foreground green "Build WindowsRuntimeComponent."
$fileLoggerArg = "/logger:FileLogger,Microsoft.Build;logfile=$testReportDir\UnitsNet.WindowsRuntimeComponent.msbuild.log"
$appVeyorLoggerArg = if (Test-Path "$appVeyorLoggerDll") { "/logger:$appVeyorLoggerDll" } else { "" }

# dontnet CLI does not support WindowsRuntimeComponent project type yet
# msbuild does not auto-restore nugets for this project type
write-host -foreground yellow "WindowsRuntimeComponent project not yet supported by dotnet CLI, using MSBuild15 instead"
& "$msbuild" "$root\UnitsNet.WindowsRuntimeComponent.sln" /verbosity:minimal /p:Configuration=Release /t:restore
& "$msbuild" "$root\UnitsNet.WindowsRuntimeComponent.sln" /verbosity:minimal /p:Configuration=Release $fileLoggerArg $appVeyorLoggerArg
if ($lastexitcode -ne 0) { exit 1 }
}

if (-not $IncludeNanoFramework)
{
write-host -foreground yellow "Skipping .NET nanoFramework build."
Expand All @@ -82,8 +64,7 @@ function Start-Tests {
$projectPaths = @(
"UnitsNet.Tests\UnitsNet.Tests.csproj",
"UnitsNet.NumberExtensions.Tests\UnitsNet.NumberExtensions.Tests.csproj",
"UnitsNet.Serialization.JsonNet.Tests\UnitsNet.Serialization.JsonNet.Tests.csproj",
"UnitsNet.Serialization.JsonNet.CompatibilityTests\UnitsNet.Serialization.JsonNet.CompatibilityTests.csproj"
"UnitsNet.Serialization.JsonNet.Tests\UnitsNet.Serialization.JsonNet.Tests.csproj"
)

# Parent dir must exist before xunit tries to write files to it
Expand Down Expand Up @@ -129,21 +110,13 @@ function Start-PackNugets {
if ($lastexitcode -ne 0) { exit 1 }
}

if (-not $IncludeWindowsRuntimeComponent) {
write-host -foreground yellow "Skipping WindowsRuntimeComponent nuget pack."
} else {
write-host -foreground yellow "WindowsRuntimeComponent project not yet supported by dotnet CLI, using nuget.exe instead"
& $nuget pack "$root\UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir"
}

if (-not $IncludeNanoFramework) {
write-host -foreground yellow "Skipping nanoFramework nuget pack."
} else {
write-host -foreground yellow "nanoFramework project not yet supported by dotnet CLI, using nuget.exe instead"
Invoke-Build-NanoNugets
Invoke-BuildNanoNugets
}


write-host -foreground blue "Pack nugets...END`n"
}

Expand Down
4 changes: 2 additions & 2 deletions Build/build-pack-nano-nugets.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$nugetOutDir = "$root\Artifacts\NuGet"
$nuget = "$root\Tools\NuGet.exe"

function Invoke-Build-NanoNugets {
function Invoke-BuildNanoNugets {

& $nuget pack "$root\UnitsNet.NanoFramework\GeneratedCode\Duration\UnitsNet.NanoFramework.Duration.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir"
& $nuget pack "$root\UnitsNet.NanoFramework\GeneratedCode\ElectricCurrent\UnitsNet.NanoFramework.ElectricCurrent.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir"
Expand All @@ -25,4 +25,4 @@ function Invoke-Build-NanoNugets {

}

export-modulemember -function Invoke-Build-NanoNugets
export-modulemember -function Invoke-BuildNanoNugets
8 changes: 2 additions & 6 deletions Build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@

Publishing nugets is handled by nuget-publish.bat and run by the build server
on the master branch.
.PARAMETER skipUWP
If flag is set, will skip the UWP (Windows Runtime Component) build step as this requires
some large, extra Visual Studio features to be installed.
.EXAMPLE
powershell ./build.ps1
powershell ./build.ps1 -IncludeWindowsRuntimeComponent -IncludeNanoFramework
powershell ./build.ps1 -IncludeNanoFramework

.NOTES
Author: Andreas Gullberg Larsen
Last modified: Jan 21, 2018
#>
[CmdletBinding()]
Param(
[switch] $IncludeWindowsRuntimeComponent,
[switch] $IncludeNanoFramework
)

Expand All @@ -32,7 +28,7 @@ try {

Remove-ArtifactsDir
Update-GeneratedCode
Start-Build -IncludeWindowsRuntimeComponent $IncludeWindowsRuntimeComponent -IncludeNanoFramework $IncludeNanoFramework
Start-Build -IncludeNanoFramework $IncludeNanoFramework
Start-Tests
Start-PackNugets
Compress-ArtifactsAsZip
Expand Down
15 changes: 10 additions & 5 deletions Build/init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,24 @@ if (!(Test-Path "$msbuildPath/nanoFramework")) {
$extensionVersion = $vs2019Tag
}

Write-Output "Downloading visx..." -NoNewline
Write-Output "Downloading visx..."

# download VS extension
Write-Debug "Download VSIX file from $extensionUrl to $vsixPath"
Write-Host "Download VSIX file from $extensionUrl to $vsixPath"
$webClient.DownloadFile($extensionUrl, $vsixPath)

$outputPath = "$tempDir\nf-extension"

$vsixPath = Join-Path -Path $tempDir -ChildPath "nf-extension.zip"
$webClient.DownloadFile($extensionUrl,$vsixPath)
Expand-Archive -LiteralPath $vsixPath -DestinationPath $outputPath | Write-Host
$webClient.DownloadFile($extensionUrl, $vsixPath)

Write-Host "Extract VSIX file to $outputPath"
Expand-Archive -LiteralPath $vsixPath -DestinationPath $outputPath -Force | Write-Host

$copyFrom = "$outputPath\`$MSBuild\nanoFramework"

Copy-Item -Path "$outputPath\`$MSBuild\nanoFramework" -Destination $msbuildPath -Recurse
Write-Host "Copy from $copyFrom to $msbuildPath"
Copy-Item -Path "$copyFrom" -Destination $msbuildPath -Recurse

Write-Host "Installed VS extension $extensionVersion"
}
Expand Down
8 changes: 0 additions & 8 deletions Build/set-version-UnitsNet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ $projFile = "$root\UnitsNet\UnitsNet.csproj"
$numberExtensionsProjFile = "$root\UnitsNet.NumberExtensions\UnitsNet.NumberExtensions.csproj"
$nanoFrameworkNuspecGeneratorFile = "$root\CodeGen\Generators\NanoFrameworkGen\NuspecGenerator.cs"
$nanoFrameworkAssemblyInfoFile = "$root\UnitsNet.NanoFramework\GeneratedCode\Properties\AssemblyInfo.cs"
$winrtAssemblyInfoFile = "$root\UnitsNet.WindowsRuntimeComponent\Properties\AssemblyInfo.cs"
$winrtNuspecFile = "$root\UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec"

# Use UnitsNet.Common.props version as base if bumping major/minor/patch
$newVersion = Get-NewProjectVersion $projFile $paramSet $setVersion $bumpVersion
Expand All @@ -68,15 +66,9 @@ $didStash = Invoke-StashPush
Set-ProjectVersion $projFile $newVersion
Set-ProjectVersion $numberExtensionsProjFile $newVersion

# Update AssemblyInfo.cs files
Set-AssemblyInfoVersion $winrtAssemblyInfoFile $newVersion

# Update AssemblyInfo.cs file for .NET nanoFramework
Set-AssemblyInfoVersion $nanoFrameworkAssemblyInfoFile $newVersion

# Update .nuspec files
Set-NuspecVersion $winrtNuspecFile $newVersion

# Update codegen and .nuspec files for nanoFramework
Set-NuspecVersion $nanoFrameworkNuspecGeneratorFile $newVersion
Get-ChildItem -Path "$root\UnitsNet.NanoFramework\GeneratedCode" -Include '*.nuspec' -Recurse |
Expand Down
16 changes: 16 additions & 0 deletions Build/set-version-json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# Sets version of nuget UnitNets.Serialization.JsonNet.
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
set_version_script="$script_dir/set-version-UnitsNet.Serialization.JsonNet.ps1"

if [ $# -eq 1 ]; then
powershell -NoProfile $set_version_script -setVersion $1
exit 0
else
echo "Usage: ./set-version-json.sh <version>"
echo ""
echo "Examples:"
echo "$ ./set-version-json.sh 5.0.0-alpha001"
echo "$ ./set-version-json.sh 5.1.2"
exit 1
fi
2 changes: 1 addition & 1 deletion CodeGen/CodeGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFramework>netcoreapp6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<!-- Allow compile with various nullability warnings until fixed. -->
Expand Down
5 changes: 2 additions & 3 deletions CodeGen/Generators/GeneratorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ namespace CodeGen.Generators
{
internal abstract class GeneratorBase
{
protected readonly MyTextWriter Writer = new MyTextWriter();
public abstract string Generate();
protected readonly MyTextWriter Writer = new();

public const string GeneratedFileHeader = @"//------------------------------------------------------------------------------
protected const string GeneratedFileHeader = @"//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
Expand Down
6 changes: 3 additions & 3 deletions CodeGen/Generators/NanoFrameworkGen/NuspecGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public NuspecGenerator(
_mathNuGetVersion = mathNuGetVersion;
}

public override string Generate()
public string Generate()
{
Writer.WL($@"<?xml version=""1.0"" encoding=""utf-8""?>
<package xmlns=""http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"">
<metadata>
<id>UnitsNet.nanoFramework.{_quantity.Name}</id>
<version>4.149.0</version>
<version>5.0.0-alpha006</version>
<title>Units.NET {_quantity.Name} - nanoFramework</title>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
Expand All @@ -38,7 +38,7 @@ public override string Generate()
</releaseNotes>
<copyright>Copyright 2013 Andreas Gullberg Larsen ([email protected]).</copyright>
<language>en-US</language>
<tags>nanoframework unit units measurement si metric imperial abbreviation abbreviations convert conversion parse c# .net immutable uwp uap winrt win10 windows runtime component {_quantity.Name.ToLower()}</tags>
<tags>nanoframework {_quantity.Name.ToLower()} unit units quantity quantities measurement si metric imperial abbreviation abbreviations convert conversion parse immutable</tags>
<dependencies>
<dependency id=""nanoFramework.CoreLibrary"" version=""{_mscorlibNuGetVersion}"" />");

Expand Down
2 changes: 1 addition & 1 deletion CodeGen/Generators/NanoFrameworkGen/ProjectGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public ProjectGenerator(Quantity quantity, NanoFrameworkVersions versions)
_versions = versions;
}

public override string Generate()
public string Generate()
{
Writer.WL($@"<?xml version=""1.0"" encoding=""utf-8""?>
<Project ToolsVersion=""15.0"" DefaultTargets=""Build"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
Expand Down
2 changes: 1 addition & 1 deletion CodeGen/Generators/NanoFrameworkGen/PropertyGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public PropertyGenerator(string version)
_version = version;
}

public override string Generate()
public string Generate()
{
Writer.WL(GeneratedFileHeader);
Writer.W($@"using System.Reflection;
Expand Down
Loading