Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Build/build-functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function Start-PackNugets {
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"
Build-NanoNugets
Invoke-Build-NanoNugets
}


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,10 +2,10 @@
$nugetOutDir = "$root\Artifacts\NuGet"
$nuget = "$root\Tools\NuGet.exe"

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

& $nuget pack "$root\UnitsNet.NanoFramework\GeneratedCode\Temperature\UnitsNet.NanoFramework.Temperature.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir"

}

export-modulemember -function Build-NanoNugets
export-modulemember -function Invoke-Build-NanoNugets
6 changes: 6 additions & 0 deletions Build/set-version-UnitsNet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ Set-AssemblyInfoVersion $winrtAssemblyInfoFile $newVersion
# # Update .nuspec files
Set-NuspecVersion $winrtNuspecFile $newVersion

# # Update .nuspec files for nanoFramework
Get-ChildItem -Path "$root\UnitsNet.NanoFramework\GeneratedCode" -Include '*.nuspec' -Recurse |
Foreach-object {
Set-NuspecVersion $_.FullName $newVersion
}

# Git commit and tag
Invoke-CommitVersionBump @("UnitsNet") $versionFiles $newVersion
Invoke-TagVersionBump "UnitsNet" $newVersion
Expand Down
9 changes: 3 additions & 6 deletions CodeGen/Generators/NanoFrameworkGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,19 @@ public static void Generate(string rootDir, Quantity[] quantities)
Log.Information($"Creating .NET nanoFramework project for {quantity.Name}");

var projectPath = Path.Combine(outputDir, quantity.Name);
var sb = new StringBuilder($"{quantity.Name}:".PadRight(AlignPad));

GeneratePackage(projectPath, quantity.Name);

Log.Information($"Package(OK)");

var sb = new StringBuilder($"{quantity.Name}:".PadRight(AlignPad));
GenerateUnitType(sb, quantity, Path.Combine(outputUnits, $"{quantity.Name}Unit.g.cs"));
GenerateQuantity(sb, quantity, Path.Combine(outputQuantitites, $"{quantity.Name}.g.cs"));
GenerateProject(sb, quantity, projectPath);
Log.Information(sb.ToString());

numberQuantity++;
}

GenerateSolution(quantities, outputDir);
Log.Information("UnitsNet.nanoFrmawork.sln generated");
Log.Information($"Total quantities generated: {numberQuantity}");
Log.Information($"Count of generated projects: {numberQuantity}");
}

private static void GeneratePackage(string projectPath, string quantityName)
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<!-- Default to output to Artifacts folder -->
<OutputPath>$(MSBuildThisFileDirectory)Artifacts/$(MSBuildProjectName)</OutputPath>
<!-- Specific output folder for .NET nanoFramework projects -->
<OutputPath Condition=" '$(TargetFrameworkIdentifier)' == '.NETnanoFramework'">$(MSBuildThisFileDirectory)Artifacts/UnitsNet.NanoFramework/$(MSBuildProjectName)</OutputPath>

</PropertyGroup>

<!-- Workaround for `dotnet test UnitsNet.sln`: https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Duration</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Duration - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Duration units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds Duration units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Duration\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Duration\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.ElectricCurrent</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET ElectricCurrent - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds ElectricCurrent units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds ElectricCurrent units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\ElectricCurrent\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\ElectricCurrent\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.ElectricPotential</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET ElectricPotential - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds ElectricPotential units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds ElectricPotential units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\ElectricPotential\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\ElectricPotential\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.ElectricPotentialDc</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET ElectricPotentialDc - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds ElectricPotentialDc units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds ElectricPotentialDc units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\ElectricPotentialDc\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\ElectricPotentialDc\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.ElectricResistance</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET ElectricResistance - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds ElectricResistance units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds ElectricResistance units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\ElectricResistance\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\ElectricResistance\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Frequency</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Frequency - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Frequency units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds Frequency units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Frequency\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Frequency\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Illuminance</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Illuminance - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Illuminance units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds Illuminance units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Illuminance\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Illuminance\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Length</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Length - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Length units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds Length units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Length\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Length\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Pressure</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Pressure - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Pressure units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds Pressure units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Pressure\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Pressure\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Ratio</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Ratio - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds Ratio units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds Ratio units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Ratio\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Ratio\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.RelativeHumidity</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET RelativeHumidity - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds RelativeHumidity units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds RelativeHumidity units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\RelativeHumidity\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\RelativeHumidity\UnitsNet.*" target="lib" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>UnitsNet.nanoFramework.Temperature</id>
<version>4.89.0</version>
<version>4.90.0</version>
<title>Units.NET Temperature - nanoFramework</title>
<authors>Andreas Gullberg Larsen, nanoFramework project contributors</authors>
<authors>Andreas Gullberg Larsen,nanoFramework project contributors</authors>
<owners>UnitsNet</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/angularsen/UnitsNet</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Adds temperature units for Units.NET on .NET nanoFramework.&#10; For .NET or .NET Core, use UnitsNet instead.</description>
<description>Adds temperature units for Units.NET on .NET nanoFramework. For .NET or .NET Core, use UnitsNet instead.</description>
<iconUrl>https://raw.githubusercontent.com/angularsen/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png</iconUrl>
<releaseNotes>
</releaseNotes>
Expand All @@ -21,6 +21,6 @@
</dependencies>
</metadata>
<files>
<file src="..\..\..\Artifacts\Temperature\UnitsNet.*" target="lib" />
<file src="..\..\..\Artifacts\UnitsNet.NanoFramework\Temperature\UnitsNet.*" target="lib" />
</files>
</package>
Loading