Skip to content

Commit 28085bc

Browse files
committed
Some updates
1 parent 2489ee4 commit 28085bc

File tree

14 files changed

+110
-43
lines changed

14 files changed

+110
-43
lines changed

build-packages.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
$output = "./nupkgs"
2+
$testsSln = "./src/tests.sln"
3+
$publishConfig = "./nuget/publish-config.json"
4+
$version = Get-Date -Format "MM.dd.yy.FFFFFF"
25

3-
$version = "0.0.1"
46
if ($null -ne $Env:NugetVersion){
57
$version = $Env:NugetVersion
68
}
79

8-
$publishConfig = "./nuget/publish-config.json"
9-
1010
$json = Get-Content $publishConfig -Raw | ConvertFrom-Json
1111

1212
Write-Host "Packages to publish"
1313
Write-Host "--------------------------------------------------------"
1414
Write-Host ($json.packagesPaths -join "`n")
1515

1616
dotnet restore
17-
1817
dotnet build --no-restore --configuration Release
1918

2019
if($LASTEXITCODE -ne 0)
2120
{
2221
throw "dotnet build failed"
2322
}
2423

25-
dotnet test --no-build --verbosity normal --configuration Release
24+
dotnet test $testsSln --configuration Release
2625

2726
if($LASTEXITCODE -ne 0)
2827
{

publish-nuget.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
$artifacts = "./nupkgs"
22
$publishConfig = "./nuget/publish-config.json"
3+
$apiKey = $Env:NugetApiKey
34

45
$json = Get-Content $publishConfig -Raw | ConvertFrom-Json
56

@@ -14,5 +15,5 @@ if($count -ne $actualCount)
1415
}
1516

1617
foreach($name in $filenames){
17-
dotnet nuget push ./nupkgs/$name --source https://api.nuget.org/v3/index.json --api-key $Env:NugetApiKey
18+
dotnet nuget push ./nupkgs/$name --source https://api.nuget.org/v3/index.json --api-key $apiKey
1819
}

src/GenOne.Blazor.BottomSheet/src/GenOne.Blazor.BottomSheet.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-preview.6.23329.11" />
18-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-preview.6.23329.11" PrivateAssets="all" />
17+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0-preview.7.23375.9" />
1918
</ItemGroup>
2019

2120
<ItemGroup>

src/GenOne.Blazor.BottomSheet/src/_Imports.razor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
@using Microsoft.AspNetCore.Components.Routing
55
@using Microsoft.AspNetCore.Components.Web
66
@using Microsoft.AspNetCore.Components.Web.Virtualization
7-
@using Microsoft.AspNetCore.Components.WebAssembly.Http
87
@using Microsoft.JSInterop
98
@using GenOne.Blazor.BottomSheet

src/GenOne.Blazor.Map/src/GenOne.Blazor.Map.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="GenOne.DPBlazorMapLibrary" Version="0.0.2" />
10-
9+
<PackageReference Include="GenOne.DPBlazorMapLibrary" Version="0.0.2" />
1110
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0-preview.7.23375.9" />
12-
1311
<PackageReference Include="System.Reactive.Core" Version="6.0.0" />
1412
</ItemGroup>
1513

src/GenOne.Blazor.Map/src/IMapPosition.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/GenOne.Geolocation/src/GeoBounds.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,18 @@ public GeoBounds(GpsLocation locationMin, GpsLocation locationMax)
1717
LocationMin = locationMin;
1818
LocationMax = locationMax;
1919
}
20+
21+
public virtual bool Equals(GeoBounds? other)
22+
{
23+
if (ReferenceEquals(null, other)) return false;
24+
if (ReferenceEquals(this, other)) return true;
25+
26+
return LocationMin.Equals(other.LocationMin) && LocationMax.Equals(other.LocationMax);
27+
}
28+
29+
public override int GetHashCode()
30+
{
31+
return HashCode.Combine(LocationMin, LocationMax);
32+
}
2033
}
2134
}

src/GenOne.Geolocation/src/GeoUtils.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Text.RegularExpressions;
2-
3-
namespace GenOne.Geolocation
1+
namespace GenOne.Geolocation
42
{
53
public static class GeoUtils
64
{

src/GenOne.Geolocation/src/GpsLocation.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using System.Runtime.InteropServices;
32

43
namespace GenOne.Geolocation
54
{
6-
[StructLayout(LayoutKind.Auto)]
75
public record GpsLocation
86
{
97
public const double MinLatitude = -90;
@@ -25,16 +23,28 @@ public GpsLocation(double latitude, double longitude)
2523
Longitude = longitude;
2624
}
2725

26+
[Obsolete("Use Parse")]
2827
public static GpsLocation ParseComma(string locationString)
2928
{
3029
return GpsLocationParser.Parse(locationString, ',');
3130
}
3231

33-
public static bool TryParseComma(string locationString, out GpsLocation gpsLocation)
32+
[Obsolete("Use TryParse")]
33+
public static bool TryParseComma(string locationString, [NotNullWhen(true)] out GpsLocation? gpsLocation)
3434
{
3535
return GpsLocationParser.TryParse(locationString, ',', out gpsLocation);
3636
}
3737

38+
public static GpsLocation Parse(string locationString, char separator)
39+
{
40+
return GpsLocationParser.Parse(locationString, separator);
41+
}
42+
43+
public static bool TryParse(string locationString, char separator, [NotNullWhen(true)] out GpsLocation? gpsLocation)
44+
{
45+
return GpsLocationParser.TryParse(locationString, separator, out gpsLocation);
46+
}
47+
3848
public virtual bool Equals(GpsLocation? other)
3949
{
4050
if (ReferenceEquals(null, other)) return false;

src/GenOne.Geolocation/src/GpsLocationParser.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ internal static class GpsLocationParser
1010
public static GpsLocation Parse(string locationString, char separator)
1111
{
1212
var i = locationString.Split(separator);
13+
14+
if (i.Length != 2)
15+
{
16+
throw new FormatException($"Wrong location string format: {locationString}");
17+
}
18+
1319
return new GpsLocation(double.Parse(i[0], CultureInfo.InvariantCulture), double.Parse(i[1], CultureInfo.InvariantCulture));
1420
}
1521

16-
public static bool TryParse(string locationString, char separator, out GpsLocation gpsLocation)
22+
public static bool TryParse(string locationString, char separator, [NotNullWhen(true)] out GpsLocation? gpsLocation)
1723
{
1824
var i = locationString.Split(separator);
1925
if (i.Length != 2)

0 commit comments

Comments
 (0)