Skip to content

Commit 146ee4c

Browse files
tmilnthorpangularsen
authored andcommitted
Split wrc (#458)
* Adding WRC specific code generation script and and removing WCR specific constructor from shared/UnitsNet code. Moving it to WCR code only script. * Creating code generator script for .NET-only code. Using existing script to generate "common" code for both .NET and WRC. Removing #if WINDOWS_UWP from Value property in Common code and moving each to their seperate .NET and WCR code generators. * Fixing consistent newlines
1 parent 6c83e6f commit 146ee4c

File tree

276 files changed

+12492
-1647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+12492
-1647
lines changed

Build/build-functions.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function Start-PackNugets {
8989
dotnet pack --configuration Release -o $nugetOutDir "$root\$projectPath"
9090
if ($lastexitcode -ne 0) { exit 1 }
9191
}
92+
9293
write-host -foreground yellow "WindowsRuntimeComponent project not yet supported by dotnet CLI, using nuget.exe instead"
9394
& $nuget pack "$root\UnitsNet.WindowsRuntimeComponent\UnitsNet.WindowsRuntimeComponent.nuspec" -Verbosity detailed -OutputDirectory "$nugetOutDir" -Symbols
9495

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
13+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
14+
//
15+
// </auto-generated>
16+
//------------------------------------------------------------------------------
17+
18+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
19+
// https://github.com/angularsen/UnitsNet
20+
//
21+
// Permission is hereby granted, free of charge, to any person obtaining a copy
22+
// of this software and associated documentation files (the "Software"), to deal
23+
// in the Software without restriction, including without limitation the rights
24+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25+
// copies of the Software, and to permit persons to whom the Software is
26+
// furnished to do so, subject to the following conditions:
27+
//
28+
// The above copyright notice and this permission notice shall be included in
29+
// all copies or substantial portions of the Software.
30+
//
31+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37+
// THE SOFTWARE.
38+
39+
using System;
40+
using System.Collections.Generic;
41+
using System.Globalization;
42+
using System.Text.RegularExpressions;
43+
using System.Linq;
44+
using JetBrains.Annotations;
45+
using UnitsNet.Units;
46+
47+
// ReSharper disable once CheckNamespace
48+
49+
namespace UnitsNet
50+
{
51+
/// <summary>
52+
/// Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration.
53+
/// </summary>
54+
// ReSharper disable once PartialTypeWithSinglePart
55+
56+
// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
57+
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
58+
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
59+
public sealed partial class Acceleration
60+
{
61+
/// <summary>
62+
/// The numeric value this quantity was constructed with.
63+
/// </summary>
64+
public double Value => Convert.ToDouble(_value);
65+
66+
// Windows Runtime Component requires a default constructor
67+
public Acceleration()
68+
{
69+
_value = 0;
70+
_unit = BaseUnit;
71+
}
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
13+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
14+
//
15+
// </auto-generated>
16+
//------------------------------------------------------------------------------
17+
18+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
19+
// https://github.com/angularsen/UnitsNet
20+
//
21+
// Permission is hereby granted, free of charge, to any person obtaining a copy
22+
// of this software and associated documentation files (the "Software"), to deal
23+
// in the Software without restriction, including without limitation the rights
24+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25+
// copies of the Software, and to permit persons to whom the Software is
26+
// furnished to do so, subject to the following conditions:
27+
//
28+
// The above copyright notice and this permission notice shall be included in
29+
// all copies or substantial portions of the Software.
30+
//
31+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37+
// THE SOFTWARE.
38+
39+
using System;
40+
using System.Collections.Generic;
41+
using System.Globalization;
42+
using System.Text.RegularExpressions;
43+
using System.Linq;
44+
using JetBrains.Annotations;
45+
using UnitsNet.Units;
46+
47+
// ReSharper disable once CheckNamespace
48+
49+
namespace UnitsNet
50+
{
51+
/// <summary>
52+
/// Mole is the amount of substance containing Avagadro's Number (6.02 x 10 ^ 23) of real particles such as molecules,atoms, ions or radicals.
53+
/// </summary>
54+
// ReSharper disable once PartialTypeWithSinglePart
55+
56+
// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
57+
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
58+
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
59+
public sealed partial class AmountOfSubstance
60+
{
61+
/// <summary>
62+
/// The numeric value this quantity was constructed with.
63+
/// </summary>
64+
public double Value => Convert.ToDouble(_value);
65+
66+
// Windows Runtime Component requires a default constructor
67+
public AmountOfSubstance()
68+
{
69+
_value = 0;
70+
_unit = BaseUnit;
71+
}
72+
}
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
13+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
14+
//
15+
// </auto-generated>
16+
//------------------------------------------------------------------------------
17+
18+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
19+
// https://github.com/angularsen/UnitsNet
20+
//
21+
// Permission is hereby granted, free of charge, to any person obtaining a copy
22+
// of this software and associated documentation files (the "Software"), to deal
23+
// in the Software without restriction, including without limitation the rights
24+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25+
// copies of the Software, and to permit persons to whom the Software is
26+
// furnished to do so, subject to the following conditions:
27+
//
28+
// The above copyright notice and this permission notice shall be included in
29+
// all copies or substantial portions of the Software.
30+
//
31+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37+
// THE SOFTWARE.
38+
39+
using System;
40+
using System.Collections.Generic;
41+
using System.Globalization;
42+
using System.Text.RegularExpressions;
43+
using System.Linq;
44+
using JetBrains.Annotations;
45+
using UnitsNet.Units;
46+
47+
// ReSharper disable once CheckNamespace
48+
49+
namespace UnitsNet
50+
{
51+
/// <summary>
52+
/// The strength of a signal expressed in decibels (dB) relative to one volt RMS.
53+
/// </summary>
54+
// ReSharper disable once PartialTypeWithSinglePart
55+
56+
// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
57+
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
58+
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
59+
public sealed partial class AmplitudeRatio
60+
{
61+
/// <summary>
62+
/// The numeric value this quantity was constructed with.
63+
/// </summary>
64+
public double Value => Convert.ToDouble(_value);
65+
66+
// Windows Runtime Component requires a default constructor
67+
public AmplitudeRatio()
68+
{
69+
_value = 0;
70+
_unit = BaseUnit;
71+
}
72+
}
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
13+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
14+
//
15+
// </auto-generated>
16+
//------------------------------------------------------------------------------
17+
18+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
19+
// https://github.com/angularsen/UnitsNet
20+
//
21+
// Permission is hereby granted, free of charge, to any person obtaining a copy
22+
// of this software and associated documentation files (the "Software"), to deal
23+
// in the Software without restriction, including without limitation the rights
24+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25+
// copies of the Software, and to permit persons to whom the Software is
26+
// furnished to do so, subject to the following conditions:
27+
//
28+
// The above copyright notice and this permission notice shall be included in
29+
// all copies or substantial portions of the Software.
30+
//
31+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37+
// THE SOFTWARE.
38+
39+
using System;
40+
using System.Collections.Generic;
41+
using System.Globalization;
42+
using System.Text.RegularExpressions;
43+
using System.Linq;
44+
using JetBrains.Annotations;
45+
using UnitsNet.Units;
46+
47+
// ReSharper disable once CheckNamespace
48+
49+
namespace UnitsNet
50+
{
51+
/// <summary>
52+
/// In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle.
53+
/// </summary>
54+
// ReSharper disable once PartialTypeWithSinglePart
55+
56+
// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
57+
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
58+
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
59+
public sealed partial class Angle
60+
{
61+
/// <summary>
62+
/// The numeric value this quantity was constructed with.
63+
/// </summary>
64+
public double Value => Convert.ToDouble(_value);
65+
66+
// Windows Runtime Component requires a default constructor
67+
public Angle()
68+
{
69+
_value = 0;
70+
_unit = BaseUnit;
71+
}
72+
}
73+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by \generate-code.bat.
4+
//
5+
// Changes to this file will be lost when the code is regenerated.
6+
// The build server regenerates the code before each build and a pre-build
7+
// step will regenerate the code on each local build.
8+
//
9+
// See https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit for how to add or edit units.
10+
//
11+
// Add CustomCode\Quantities\MyQuantity.extra.cs files to add code to generated quantities.
12+
// Add Extensions\MyQuantityExtensions.cs to decorate quantities with new behavior.
13+
// Add UnitDefinitions\MyQuantity.json and run GeneratUnits.bat to generate new units or quantities.
14+
//
15+
// </auto-generated>
16+
//------------------------------------------------------------------------------
17+
18+
// Copyright (c) 2013 Andreas Gullberg Larsen ([email protected]).
19+
// https://github.com/angularsen/UnitsNet
20+
//
21+
// Permission is hereby granted, free of charge, to any person obtaining a copy
22+
// of this software and associated documentation files (the "Software"), to deal
23+
// in the Software without restriction, including without limitation the rights
24+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25+
// copies of the Software, and to permit persons to whom the Software is
26+
// furnished to do so, subject to the following conditions:
27+
//
28+
// The above copyright notice and this permission notice shall be included in
29+
// all copies or substantial portions of the Software.
30+
//
31+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37+
// THE SOFTWARE.
38+
39+
using System;
40+
using System.Collections.Generic;
41+
using System.Globalization;
42+
using System.Text.RegularExpressions;
43+
using System.Linq;
44+
using JetBrains.Annotations;
45+
using UnitsNet.Units;
46+
47+
// ReSharper disable once CheckNamespace
48+
49+
namespace UnitsNet
50+
{
51+
/// <summary>
52+
/// A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules.
53+
/// </summary>
54+
// ReSharper disable once PartialTypeWithSinglePart
55+
56+
// Windows Runtime Component has constraints on public types: https://msdn.microsoft.com/en-us/library/br230301.aspx#Declaring types in Windows Runtime Components
57+
// Public structures can't have any members other than public fields, and those fields must be value types or strings.
58+
// Public classes must be sealed (NotInheritable in Visual Basic). If your programming model requires polymorphism, you can create a public interface and implement that interface on the classes that must be polymorphic.
59+
public sealed partial class ApparentEnergy
60+
{
61+
/// <summary>
62+
/// The numeric value this quantity was constructed with.
63+
/// </summary>
64+
public double Value => Convert.ToDouble(_value);
65+
66+
// Windows Runtime Component requires a default constructor
67+
public ApparentEnergy()
68+
{
69+
_value = 0;
70+
_unit = BaseUnit;
71+
}
72+
}
73+
}

0 commit comments

Comments
 (0)