diff --git a/Build/UnitsNet.Serialization.JsonNet.nuspec b/Build/UnitsNet.Serialization.JsonNet.nuspec index a427d98a75..331d095aa0 100644 --- a/Build/UnitsNet.Serialization.JsonNet.nuspec +++ b/Build/UnitsNet.Serialization.JsonNet.nuspec @@ -23,7 +23,7 @@ - + diff --git a/Build/UnitsNet.Signed.nuspec b/Build/UnitsNet.Signed.nuspec new file mode 100644 index 0000000000..04171d34c3 --- /dev/null +++ b/Build/UnitsNet.Signed.nuspec @@ -0,0 +1,25 @@ + + + + UnitsNet.Signed + 3.48.1 + Units.NET (signed) + Andreas Gullberg Larsen + Andreas Gullberg Larsen + https://github.com/anjdreas/UnitsNet/blob/master/LICENSE + https://github.com/anjdreas/UnitsNet + false + Strong name signed edition of Units.NET. Only use this if you need a signed version. + Strong name signed edition of Units.NET. + https://raw.githubusercontent.com/anjdreas/UnitsNet/ce85185429be345d77eb2ce09c99d59cc9ab8aed/Docs/Images/logo-32.png + + + Copyright © 2015 Andreas Gullberg Larsen + en-US + unit units measurement si metric imperial abbreviation abbreviations convert conversion parse c# .net immutable + + + + + + \ No newline at end of file diff --git a/Build/UnitsNet.WindowsRuntimeComponent.nuspec b/Build/UnitsNet.WindowsRuntimeComponent.nuspec index c7acd7c7b2..c9bd48dd2a 100644 --- a/Build/UnitsNet.WindowsRuntimeComponent.nuspec +++ b/Build/UnitsNet.WindowsRuntimeComponent.nuspec @@ -19,7 +19,7 @@ unit units measurement si metric imperial abbreviation abbreviations convert conversion parse c# .net immutable uwp uap winrt win10 windows runtime component - + \ No newline at end of file diff --git a/Build/UnitsNet.nuspec b/Build/UnitsNet.nuspec index d4efbf0143..c2f5591c58 100644 --- a/Build/UnitsNet.nuspec +++ b/Build/UnitsNet.nuspec @@ -19,7 +19,7 @@ unit units measurement si metric imperial abbreviation abbreviations convert conversion parse c# .net immutable - + \ No newline at end of file diff --git a/Build/build-all-debug.bat b/Build/build-all-debug.bat index b7b01c203f..08ce6be582 100644 --- a/Build/build-all-debug.bat +++ b/Build/build-all-debug.bat @@ -1,3 +1,13 @@ -SET ROOT=%~dp0.. -"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\all.msbuild /verbosity:normal /p:Configuration=Debug /p:Platform="AnyCPU" /target:CleanAndBuild /p:RestorePackages=false +@echo off +set ROOT=%~dp0.. +set SrcDir="%ROOT%\Artifacts\Bin\Src" +set SrcUnsignedDir="%ROOT%\Artifacts\Bin\Src-unsigned" + +echo Build unsigned binaries. +"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\build-all.msbuild /verbosity:normal /p:Configuration=Debug /target:Clean;Rebuild /p:RestorePackages=false if %errorlevel% neq 0 exit /b %errorlevel% + +echo Move unsigned binaries to: %SrcUnsignedDir% +if exist %SrcUnsignedDir% rmdir /Q /S %SrcUnsignedDir% +ren %SrcDir% "Src-unsigned" +if %errorlevel% neq 0 exit /b %errorlevel% \ No newline at end of file diff --git a/Build/build-all-release.bat b/Build/build-all-release.bat index 98172cc3a1..89cf202add 100644 --- a/Build/build-all-release.bat +++ b/Build/build-all-release.bat @@ -1,4 +1,13 @@ @echo off -SET ROOT=%~dp0.. -"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\all.msbuild /verbosity:normal /p:Configuration=Release /p:Platform="AnyCPU" /target:CleanAndBuild /p:RestorePackages=false +set ROOT=%~dp0.. +set SrcDir="%ROOT%\Artifacts\Bin\Src" +set SrcUnsignedDir="%ROOT%\Artifacts\Bin\Src-unsigned" + +echo Build unsigned binaries. +"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\build-all.msbuild /verbosity:normal /p:Configuration=Release /target:Clean;Rebuild /p:RestorePackages=false if %errorlevel% neq 0 exit /b %errorlevel% + +echo Move unsigned binaries to: %SrcUnsignedDir% +if exist %SrcUnsignedDir% rmdir /Q /S %SrcUnsignedDir% +ren %SrcDir% "Src-unsigned" +if %errorlevel% neq 0 exit /b %errorlevel% \ No newline at end of file diff --git a/Build/all.msbuild b/Build/build-all.msbuild similarity index 65% rename from Build/all.msbuild rename to Build/build-all.msbuild index 10cd4fec26..61a07a813f 100644 --- a/Build/all.msbuild +++ b/Build/build-all.msbuild @@ -6,17 +6,7 @@ Release 14.0 $(MSBuildProjectDirectory)\..\ - - - - - - - - - - - + + + + + + + + + - Properties="Platform=$(Platform);Configuration=$(Configuration);VisualStudioVersion=$(VisualStudioVersion)" - Targets="Build"> - + + - + \ No newline at end of file diff --git a/Build/build-signed-release.bat b/Build/build-signed-release.bat new file mode 100644 index 0000000000..b474902ec2 --- /dev/null +++ b/Build/build-signed-release.bat @@ -0,0 +1,25 @@ +@echo off +set StrongNameSignFile="%1" +set errorlevel=0 +set ROOT=%~dp0.. +set SrcDir="%ROOT%\Artifacts\Bin\Src" +set SrcSignedDir="%ROOT%\Artifacts\Bin\Src-signed" + +if exist "%StrongNameSignFile%" ( + echo Build signed binaries with key: %StrongNameSignFile% + "C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" %ROOT%\Build\build-signed.msbuild /verbosity:Normal /p:Configuration=Release /target:Clean;Rebuild /p:RestorePackages=false /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=%StrongNameSignFile% + + if %errorlevel% neq 0 ( + echo Error: %errorlevel% + exit /b %errorlevel% + ) + + echo %SrcDir% + echo Move signed binaries to: %SrcSignedDir% + @echo on + if exist %SrcSignedDir% rmdir /Q /S %SrcSignedDir% + ren %SrcDir% "Src-signed" + @echo off +) else ( + echo NO STRONG NAME SIGNING FILE: %StrongNameSignFile% +) \ No newline at end of file diff --git a/Build/build-signed.msbuild b/Build/build-signed.msbuild new file mode 100644 index 0000000000..9fa2e81a6f --- /dev/null +++ b/Build/build-signed.msbuild @@ -0,0 +1,39 @@ + + + + + AnyCPU + Release + 14.0 + $(MSBuildProjectDirectory)\..\ + + $(RootPath)\UnitsNet\UnitsNet.Net35.csproj; + $(RootPath)\UnitsNet\UnitsNet.Portable40.csproj; + $(RootPath)\UnitsNet\UnitsNet.NetStandard10.csproj; + $(RootPath)\UnitsNet\UnitsNet.WindowsRuntimeComponent.csproj; + $(RootPath)\UnitsNet.Serialization.JsonNet\UnitsNet.Serialization.JsonNet.Net35.csproj + + + + + + + + + + + + + + + + diff --git a/Build/build.bat b/Build/build.bat index 869aec3779..2a453a982f 100644 --- a/Build/build.bat +++ b/Build/build.bat @@ -1,22 +1,53 @@ @echo off -SET ROOT=%~dp0.. +rem This file builds everything and is run on the build server as part of +rem building, testing and packing nugets for all master commits and pull requests. + +rem Publishing nugets is handled by nuget-publish.bat and run by the build server +rem on the master branch. + +rem Optional strong name signing .pfx key file to produce signed binaries and nugets. +set StrongNameSignFile="%1" + +set ROOT=%~dp0.. + +if exist %StrongNameSignFile% ( + echo Using strong name signing key file: %StrongNameSignFile% +) else ( + echo No strong name signing key file specified. Will only build unsigned binaries and nugets. +) if exist %ROOT%\Artifacts rmdir /Q /S %ROOT%\Artifacts +rem Regenerate all source code and test stubs before building +rem since there is no guarantee that merged pull requests +rem have properly regenerated code. +call %ROOT%\GenerateUnits.bat +if %errorlevel% neq 0 exit /b %errorlevel% + +rem Update AsseemblyInfo.cs versions from .nuspec files call powershell -NoProfile %ROOT%\Build\UpdateAssemblyInfo.ps1 if %errorlevel% neq 0 exit /b %errorlevel% +rem Restore nugets call %ROOT%\Build\nuget-restore.bat if %errorlevel% neq 0 exit /b %errorlevel% +rem Build source and tests call %ROOT%\Build\build-all-release.bat if %errorlevel% neq 0 exit /b %errorlevel% +rem Run all tests call %ROOT%\Build\run-tests.bat if %errorlevel% neq 0 exit /b %errorlevel% +rem Only build signed binaries if tests pass +call %ROOT%\Build\build-signed-release.bat %StrongNameSignFile% +if %errorlevel% neq 0 exit /b %errorlevel% + +rem Pack nugets for both signed and unsigned binaries call %ROOT%\Build\pack-nuget.bat if %errorlevel% neq 0 exit /b %errorlevel% +rem Create a zip bundle of everything, becomes available in TeamCity for download call %ROOT%\Build\zip-artifacts.bat if %errorlevel% neq 0 exit /b %errorlevel% \ No newline at end of file diff --git a/Build/msbuild-signed.msbuild b/Build/msbuild-signed.msbuild new file mode 100644 index 0000000000..c016436f1e --- /dev/null +++ b/Build/msbuild-signed.msbuild @@ -0,0 +1,26 @@ + + + + + AnyCPU + Release + 14.0 + $(MSBuildProjectDirectory)\..\ + + + + + + + + + + + + + + diff --git a/Build/pack-nuget.bat b/Build/pack-nuget.bat index 4a1926a869..e952523246 100644 --- a/Build/pack-nuget.bat +++ b/Build/pack-nuget.bat @@ -1,6 +1,7 @@ @echo off SET ROOT=%~dp0.. SET MainNuspec=%ROOT%\Build\UnitsNet.nuspec +SET MainSignedNuspec=%ROOT%\Build\UnitsNet.Signed.nuspec SET UwpNuspec=%ROOT%\Build\UnitsNet.WindowsRuntimeComponent.nuspec SET SerializationNuspec=%ROOT%\Build\UnitsNet.Serialization.JsonNet.nuspec SET NuGetExe=%ROOT%\Tools\NuGet.exe @@ -10,7 +11,12 @@ mkdir "%NuGetOutDir%" %NuGetExe% pack %MainNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols if %errorlevel% neq 0 exit /b %errorlevel% + +%NuGetExe% pack %MainSignedNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols +if %errorlevel% neq 0 exit /b %errorlevel% + %NuGetExe% pack %UwpNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols if %errorlevel% neq 0 exit /b %errorlevel% + %NuGetExe% pack %SerializationNuspec% -Verbosity detailed -OutputDirectory "%NuGetOutDir%" -BasePath "%ROOT%" -Symbols if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/GenerateUnits.bat b/GenerateUnits.bat index 0b52484ae7..6be05df836 100644 --- a/GenerateUnits.bat +++ b/GenerateUnits.bat @@ -1,4 +1,3 @@ @echo off SET scriptdir=%~dp0 powershell -ExecutionPolicy Bypass -NoProfile -File %scriptdir%UnitsNet\Scripts\GenerateUnits.ps1 -pause diff --git a/UnitsNet.Tests/CustomCode/ForceTests.cs b/UnitsNet.Tests/CustomCode/ForceTests.cs index aed947e846..490efece03 100644 --- a/UnitsNet.Tests/CustomCode/ForceTests.cs +++ b/UnitsNet.Tests/CustomCode/ForceTests.cs @@ -27,11 +27,11 @@ public class ForceTests : ForceTestsBase { protected override double DyneInOneNewton => 1E5; - protected override double KilogramsForceInOneNewton => 1/Constants.Gravity; + protected override double KilogramsForceInOneNewton => 0.101972; protected override double KilonewtonsInOneNewton => 1E-3; - protected override double KiloPondsInOneNewton => 1/Constants.Gravity; + protected override double KiloPondsInOneNewton => 0.101972; protected override double NewtonsInOneNewton => 1; diff --git a/UnitsNet.Tests/UnitSystemTests.cs b/UnitsNet.Tests/UnitSystemTests.cs index 547f4f225e..e2b646b196 100644 --- a/UnitsNet.Tests/UnitSystemTests.cs +++ b/UnitsNet.Tests/UnitSystemTests.cs @@ -83,8 +83,8 @@ private enum CustomUnit private UnitSystem GetCachedUnitSystem() { - CultureInfo cultureInfo = CultureInfo.GetCultureInfo("en-US"); - UnitSystem unitSystem = UnitSystem.GetCached(cultureInfo); + Culture culture = GetCulture("en-US"); + UnitSystem unitSystem = UnitSystem.GetCached(culture); return unitSystem; } @@ -92,14 +92,18 @@ private static IEnumerable GetUnitTypesWithMissingAbbreviations(s IEnumerable unitValues) where TUnit : /*Enum constraint hack*/ struct, IComparable, IFormattable { - UnitSystem unitSystem = UnitSystem.GetCached(new CultureInfo(cultureName)); + UnitSystem unitSystem = UnitSystem.GetCached(GetCulture(cultureName)); var unitsMissingAbbreviations = new List(); foreach (TUnit unit in unitValues) { try { +#if WINDOWS_UWP + unitSystem.GetDefaultAbbreviation(unit.GetType(), Convert.ToInt32(unit)); +#else unitSystem.GetDefaultAbbreviation(unit); +#endif } catch { @@ -138,16 +142,17 @@ public void DecimalRadixPointCultureFormatting(string culture) [TestCase("ar-EG")] [TestCase("en-GB")] [TestCase("es-MX")] - public void CommaDigitGroupingCultureFormatting(string culture) + public void CommaDigitGroupingCultureFormatting(string cultureName) { - Assert.AreEqual("1,111 m", Length.FromMeters(1111).ToString(LengthUnit.Meter, GetCulture(culture))); + Culture culture = GetCulture(cultureName); + Assert.AreEqual("1,111 m", Length.FromMeters(1111).ToString(LengthUnit.Meter, culture)); // Feet/Inch and Stone/Pound combinations are only used (customarily) in the US, UK and maybe Ireland - all English speaking countries. // FeetInches returns a whole number of feet, with the remainder expressed (rounded) in inches. Same for SonePounds. Assert.AreEqual("2,222 ft 3 in", - Length.FromFeetInches(2222, 3).FeetInches.ToString(new CultureInfo(culture))); + Length.FromFeetInches(2222, 3).FeetInches.ToString(culture)); Assert.AreEqual("3,333 st 7 lb", - Mass.FromStonePounds(3333, 7).StonePounds.ToString(new CultureInfo(culture))); + Mass.FromStonePounds(3333, 7).StonePounds.ToString(culture)); } // These cultures use a thin space in digit grouping @@ -178,15 +183,16 @@ public void DecimalPointDigitGroupingCultureFormatting(string culture) Assert.AreEqual("1.111 m", Length.FromMeters(1111).ToString(LengthUnit.Meter, GetCulture(culture))); } +#if !WINDOWS_UWP [TestCase("m^2", Result = AreaUnit.SquareMeter)] [TestCase("cm^2", Result = AreaUnit.Undefined)] public AreaUnit Parse_ReturnsUnitMappedByCustomAbbreviationOrUndefined(string unitAbbreviationToParse) { UnitSystem unitSystem = GetCachedUnitSystem(); unitSystem.MapUnitToAbbreviation(AreaUnit.SquareMeter, "m^2"); - return unitSystem.Parse(unitAbbreviationToParse); } +#endif [TestCase(1, Result = "1.1 m")] [TestCase(2, Result = "1.12 m")] @@ -348,13 +354,18 @@ public void AllUnitsImplementToStringForRussian() [Test] public void GetDefaultAbbreviationFallsBackToDefaultStringIfNotSpecified() { - UnitSystem usUnits = UnitSystem.GetCached(CultureInfo.GetCultureInfo("en-US")); + UnitSystem usUnits = UnitSystem.GetCached(GetCulture("en-US")); +#if WINDOWS_UWP + string abbreviation = usUnits.GetDefaultAbbreviation(typeof(CustomUnit), (int)CustomUnit.Unit1); + Assert.AreEqual("(no abbreviation for CustomUnit with numeric value 1)", abbreviation); +#else string abbreviation = usUnits.GetDefaultAbbreviation(CustomUnit.Unit1); - Assert.AreEqual("(no abbreviation for CustomUnit.Unit1)", abbreviation); +#endif } +#if !WINDOWS_UWP [Test] public void GetDefaultAbbreviationFallsBackToUsEnglishCulture() { @@ -374,7 +385,9 @@ public void GetDefaultAbbreviationFallsBackToUsEnglishCulture() // Assert Assert.AreEqual("US english abbreviation for Unit1", abbreviation); } +#endif +#if !WINDOWS_UWP [Test] public void MapUnitToAbbreviation_AddCustomUnit_DoesNotOverrideDefaultAbbreviationForAlreadyMappedUnits() { @@ -384,6 +397,7 @@ public void MapUnitToAbbreviation_AddCustomUnit_DoesNotOverrideDefaultAbbreviati Assert.AreEqual("m²", unitSystem.GetDefaultAbbreviation(AreaUnit.SquareMeter)); } +#endif [Test] public void NegativeInfinityFormatting() @@ -399,6 +413,7 @@ public void NotANumberFormatting() Is.EqualTo("NaN m")); } +#if !WINDOWS_UWP [Test] public void Parse_AmbiguousUnitsThrowsException() { @@ -410,6 +425,7 @@ public void Parse_AmbiguousUnitsThrowsException() // Act 2 Assert.Throws(() => Volume.Parse("1 tsp")); } +#endif [Test] public void Parse_UnambiguousUnitsDoesNotThrow() diff --git a/UnitsNet/Constants.cs b/UnitsNet/Constants.cs deleted file mode 100644 index 8cb5c58443..0000000000 --- a/UnitsNet/Constants.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright © 2007 Andreas Gullberg Larsen (anjdreas@gmail.com). -// https://github.com/anjdreas/UnitsNet -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -namespace UnitsNet -{ - internal static class Constants - { - public const double Gravity = 9.80665002864; - } -} \ No newline at end of file diff --git a/UnitsNet/CustomCode/UnitClasses/Length.extra.cs b/UnitsNet/CustomCode/UnitClasses/Length.extra.cs index 29ba3abe1b..4ebf35344d 100644 --- a/UnitsNet/CustomCode/UnitClasses/Length.extra.cs +++ b/UnitsNet/CustomCode/UnitClasses/Length.extra.cs @@ -23,6 +23,12 @@ using JetBrains.Annotations; using UnitsNet.Units; +#if WINDOWS_UWP +using Culture=System.String; +#else +using Culture=System.IFormatProvider; +#endif + namespace UnitsNet { /// @@ -126,12 +132,7 @@ public override string ToString() return ToString(null); } -#if WINDOWS_UWP - internal - #else - public -#endif - string ToString([CanBeNull] IFormatProvider cultureInfo) + public string ToString([CanBeNull] Culture cultureInfo) { // Note that it isn't customary to use fractions - one wouldn't say "I am 5 feet and 4.5 inches". // So inches are rounded when converting from base units to feet/inches. diff --git a/UnitsNet/CustomCode/UnitClasses/Mass.extra.cs b/UnitsNet/CustomCode/UnitClasses/Mass.extra.cs index 0ac2f0f521..f8fcbf0224 100644 --- a/UnitsNet/CustomCode/UnitClasses/Mass.extra.cs +++ b/UnitsNet/CustomCode/UnitClasses/Mass.extra.cs @@ -23,6 +23,12 @@ using JetBrains.Annotations; using UnitsNet.Units; +#if WINDOWS_UWP +using Culture = System.String; +#else +using Culture = System.IFormatProvider; +#endif + namespace UnitsNet { #if WINDOWS_UWP @@ -110,12 +116,7 @@ public override string ToString() return ToString(null); } -#if WINDOWS_UWP - internal -#else - public -#endif - string ToString([CanBeNull] IFormatProvider cultureInfo) + public string ToString([CanBeNull] Culture cultureInfo) { // Note that it isn't customary to use fractions - one wouldn't say "I am 11 stone and 4.5 pounds". // So pounds are rounded here. diff --git a/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs b/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs index 2fa5bf904f..f1fbc82bce 100644 --- a/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs +++ b/UnitsNet/GeneratedCode/UnitClasses/Force.g.cs @@ -123,7 +123,7 @@ public double Dyne /// public double KilogramsForce { - get { return _newtons/Constants.Gravity; } + get { return _newtons/9.80665002864; } } /// @@ -139,7 +139,7 @@ public double Kilonewtons /// public double KiloPonds { - get { return _newtons/Constants.Gravity; } + get { return _newtons/9.80665002864; } } /// @@ -171,7 +171,7 @@ public double PoundsForce /// public double TonnesForce { - get { return _newtons/Constants.Gravity/1000; } + get { return _newtons/9.80665002864/1000; } } #endregion @@ -196,7 +196,7 @@ public static Force FromDyne(double dyne) /// public static Force FromKilogramsForce(double kilogramsforce) { - return new Force(kilogramsforce*Constants.Gravity); + return new Force(kilogramsforce*9.80665002864); } /// @@ -212,7 +212,7 @@ public static Force FromKilonewtons(double kilonewtons) /// public static Force FromKiloPonds(double kiloponds) { - return new Force(kiloponds*Constants.Gravity); + return new Force(kiloponds*9.80665002864); } /// @@ -244,7 +244,7 @@ public static Force FromPoundsForce(double poundsforce) /// public static Force FromTonnesForce(double tonnesforce) { - return new Force(tonnesforce*Constants.Gravity*1000); + return new Force(tonnesforce*9.80665002864*1000); } #if !WINDOWS_UWP diff --git a/UnitsNet/Properties/AssemblyInfo.WindowsRuntimeComponent.cs b/UnitsNet/Properties/AssemblyInfo.WindowsRuntimeComponent.cs index 1d3f2ab77c..7159202959 100644 --- a/UnitsNet/Properties/AssemblyInfo.WindowsRuntimeComponent.cs +++ b/UnitsNet/Properties/AssemblyInfo.WindowsRuntimeComponent.cs @@ -40,8 +40,4 @@ [assembly: NeutralResourcesLanguage("")] [assembly: CLSCompliant(true)] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - -// Give access to internal members for testing -[assembly: InternalsVisibleTo("UnitsNet.Tests")] -[assembly: InternalsVisibleTo("UnitsNet.WindowsRuntimeComponent.Tests")] \ No newline at end of file +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/UnitsNet/Properties/AssemblyInfo.cs b/UnitsNet/Properties/AssemblyInfo.cs index 5b26a3641c..fd90166c33 100644 --- a/UnitsNet/Properties/AssemblyInfo.cs +++ b/UnitsNet/Properties/AssemblyInfo.cs @@ -35,7 +35,4 @@ [assembly: NeutralResourcesLanguage("")] [assembly: CLSCompliant(true)] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - -// Give access to internal members for testing -[assembly: InternalsVisibleTo("UnitsNet.Tests")] \ No newline at end of file +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/UnitsNet/Scripts/UnitDefinitions/Force.json b/UnitsNet/Scripts/UnitDefinitions/Force.json index 845cf949e2..2ced4159df 100644 --- a/UnitsNet/Scripts/UnitDefinitions/Force.json +++ b/UnitsNet/Scripts/UnitDefinitions/Force.json @@ -22,8 +22,8 @@ { "SingularName": "KilogramForce", "PluralName": "KilogramsForce", - "FromUnitToBaseFunc": "x*Constants.Gravity", - "FromBaseToUnitFunc": "x/Constants.Gravity", + "FromUnitToBaseFunc": "x*9.80665002864", + "FromBaseToUnitFunc": "x/9.80665002864", "Localization": [ { "Culture": "en-US", @@ -38,8 +38,8 @@ { "SingularName": "TonneForce", "PluralName": "TonnesForce", - "FromUnitToBaseFunc": "x*Constants.Gravity*1000", - "FromBaseToUnitFunc": "x/Constants.Gravity/1000", + "FromUnitToBaseFunc": "x*9.80665002864*1000", + "FromBaseToUnitFunc": "x/9.80665002864/1000", "Localization": [ { "Culture": "en-US", @@ -72,8 +72,8 @@ { "SingularName": "KiloPond", "PluralName": "KiloPonds", - "FromUnitToBaseFunc": "x*Constants.Gravity", - "FromBaseToUnitFunc": "x/Constants.Gravity", + "FromUnitToBaseFunc": "x*9.80665002864", + "FromBaseToUnitFunc": "x/9.80665002864", "Localization": [ { "Culture": "en-US", diff --git a/UnitsNet/UnitsNet.Net35.csproj b/UnitsNet/UnitsNet.Net35.csproj index f79e06f464..a3c7f3bf4a 100644 --- a/UnitsNet/UnitsNet.Net35.csproj +++ b/UnitsNet/UnitsNet.Net35.csproj @@ -48,7 +48,7 @@ - + call $(ProjectDir)..\GenerateUnits.bat