Skip to content

Commit 435ab5c

Browse files
authored
[breaking changes] cleanup targets (#361)
* remove target xamarin ios and android (supported by netstandard) * remove 1.4 * build warning cleared * remove bom * fix ci failed
1 parent b07e78a commit 435ab5c

File tree

9 files changed

+21
-48
lines changed

9 files changed

+21
-48
lines changed

ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ echo Generating Code Coverage reports
3131
export PATH="$PATH:$HOME/.dotnet/tools"
3232
export DOTNET_ROOT=$(dirname $(realpath $(which dotnet))) # https://github.com/dotnet/cli/issues/9114#issuecomment-401670622
3333
dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.0.15
34-
reportgenerator "-reports:**/*.opencover.xml" "-targetdir:coveragereport" "-reporttypes:HTMLInline;Cobertura"
34+
reportgenerator "-reports:**/*.opencover*.xml" "-targetdir:coveragereport" "-reporttypes:HTMLInline;Cobertura"
3535

3636
ls coveragereport
3737
ls coveragereport/Cobertura.xml

gen/KubernetesWatchGenerator/KubernetesWatchGenerator.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -9,7 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
1111
<PackageReference Include="NSwag.Core" Version="11.17.2" />
12-
<PackageReference Include="Nustache" Version="1.16.0.8" />
12+
<PackageReference Include="Nustache" Version="1.16.0.8" NoWarn="NU1701" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/KubernetesClient/Kubernetes.ConfigInit.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ public Kubernetes(KubernetesClientConfiguration config, HttpClient httpClient, b
5656
/// Optional. The delegating handlers to add to the http client pipeline.
5757
/// </param>
5858
public Kubernetes(KubernetesClientConfiguration config, params DelegatingHandler[] handlers)
59-
#if MONOANDROID8_1
60-
: this(new Xamarin.Android.Net.AndroidClientHandler(), handlers)
61-
#else
6259
: this(handlers)
63-
#endif
6460
{
6561
ValidateConfig(config);
6662
CaCerts = config.SslCaCerts;
@@ -162,7 +158,7 @@ private void InitializeFromConfig(KubernetesClientConfiguration config)
162158

163159
partial void CustomInitialize()
164160
{
165-
#if NET452 || XAMARINIOS1_0 || MONOANDROID8_1
161+
#if NET452
166162
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
167163
#endif
168164
AppendDelegatingHandler<WatcherDelegatingHandler>();

src/KubernetesClient/KubernetesClient.csproj

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
<PackageIconUrl>https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png</PackageIconUrl>
1010
<PackageTags>kubernetes;docker;containers;</PackageTags>
1111

12-
<TargetFrameworks>netstandard1.4;netstandard2.0;net452;net461;netcoreapp2.1;xamarinios10;monoandroid81</TargetFrameworks>
13-
<TargetFrameworks Condition="'$(MSBuildRuntimeType)' == 'Core'">netstandard1.4;netstandard2.0;net452;net461;netcoreapp2.1</TargetFrameworks>
14-
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.4;netstandard2.0;netcoreapp2.1</TargetFrameworks>
12+
<TargetFrameworks>netstandard2.0;net452;netcoreapp2.1</TargetFrameworks>
13+
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0;netcoreapp2.1</TargetFrameworks>
1514
<RootNamespace>k8s</RootNamespace>
1615
<SignAssembly>true</SignAssembly>
1716
<AssemblyOriginatorKeyFile>kubernetes-client.snk</AssemblyOriginatorKeyFile>
@@ -34,30 +33,13 @@
3433
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="1.1.2" Condition="'$(TargetFramework)' != 'netstandard2.0'" />
3534
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
3635
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
37-
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.6.68" PrivateAssets="all" Condition="'$(MSBuildRuntimeType)' != 'Core'" />
3836
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" Condition="'$(TargetFramework)' != 'netstandard2.0' and '$(TargetFramework)' != 'netcoreapp2.1'" />
3937
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'" />
4038
<PackageReference Include="YamlDotNet" Version="6.0.0" />
4139
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
4240
</ItemGroup>
43-
<ItemGroup Condition="'$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net461'">
41+
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
4442
<Reference Include="System.Net.Http.WebRequest" />
4543
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
4644
</ItemGroup>
47-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.4'">
48-
<PackageReference Include="System.Net.WebSockets.Client" Version="4.3.2" />
49-
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
50-
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
51-
</ItemGroup>
52-
<ItemGroup Condition="'$(TargetFramework)' == 'xamarinios10'">
53-
<Reference Include="System.Numerics" />
54-
<Reference Include="System.Runtime.Serialization" />
55-
<Reference Include="Xamarin.iOS" />
56-
</ItemGroup>
57-
<ItemGroup Condition="'$(TargetFramework)' == 'monoandroid81'">
58-
<Reference Include="Mono.Android" />
59-
<Reference Include="System.Numerics" />
60-
<Reference Include="System.Runtime.Serialization" />
61-
</ItemGroup>
62-
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
6345
</Project>

src/KubernetesClient/KubernetesClientConfiguration.HttpClientHandler.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ public HttpClientHandler CreateDefaultHttpClientHandler() {
3333
}
3434

3535
public void AddCertificates(HttpClientHandler handler) {
36-
#if XAMARINIOS1_0 || MONOANDROID8_1
37-
// handle.ClientCertificates is not implemented in Xamarin.
38-
return;
39-
#endif
40-
4136
if ((!string.IsNullOrWhiteSpace(this.ClientCertificateData) ||
4237
!string.IsNullOrWhiteSpace(this.ClientCertificateFilePath)) &&
4338
(!string.IsNullOrWhiteSpace(this.ClientCertificateKeyData) ||

src/KubernetesClient/KubernetesException.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using k8s.Models;
22
using System;
3-
#if !NETSTANDARD1_4
43
using System.Runtime.Serialization;
5-
#endif
64

75
namespace k8s
86
{
@@ -58,7 +56,6 @@ public KubernetesException(string message, Exception innerException)
5856
{
5957
}
6058

61-
#if !NETSTANDARD1_4
6259
/// <summary>
6360
/// Initializes a new instance of the <see cref="KubernetesException"/> class with serialized data.
6461
/// </summary>
@@ -74,7 +71,6 @@ protected KubernetesException(SerializationInfo info, StreamingContext context)
7471
: base(info, context)
7572
{
7673
}
77-
#endif
7874

7975
/// <summary>
8076
/// Gets, when this exception was raised because of a Kubernetes status message, the underlying

tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
9+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9">
10+
<!-- this is due to aspnet core 2.1 is not compatible with our code -->
11+
<AllowExplicitVersion>true</AllowExplicitVersion>
12+
</PackageReference>
13+
1014
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
11-
<PackageReference Include="System.Reactive" Version="4.1.3" />
12-
<PackageReference Include="Nito.AsyncEx" Version="4.0.1" />
15+
<PackageReference Include="System.Reactive" Version="4.3.2" />
16+
<PackageReference Include="Nito.AsyncEx" Version="5.0.0" />
1317
</ItemGroup>
1418

1519
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
@@ -21,15 +25,15 @@
2125

2226
<ItemGroup>
2327

24-
<PackageReference Include="coverlet.msbuild" Version="2.6.0">
28+
<PackageReference Include="coverlet.msbuild" Version="2.8.0">
2529
<PrivateAssets>all</PrivateAssets>
2630
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2731
</PackageReference>
2832

2933
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
3034
<PackageReference Include="xunit" Version="2.4.1" />
31-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" NoWarn="NU1701" />
32-
<PackageReference Include="Moq" Version="4.10.1" />
35+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
36+
<PackageReference Include="Moq" Version="4.13.1" />
3337

3438
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
3539
</ItemGroup>

tests/KubernetesClient.Tests/Mock/MockKubeApiServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace k8s.Tests.Mock
1616
{
17-
public class MockKubeApiServer : IDisposable
17+
public sealed class MockKubeApiServer : IDisposable
1818
{
1919
// paste from minikube /api/v1/namespaces/default/pods
2020
public const string MockPodResponse =

tests/KubernetesClient.Tests/YamlTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public void LoadAllFromString()
2828
types.Add("v1/Namespace", typeof(V1Namespace));
2929

3030
var objs = Yaml.LoadAllFromString(content, types);
31-
Assert.Equal(objs.Count, 2);
31+
Assert.Equal(2, objs.Count);
3232
Assert.IsType<V1Pod>(objs[0]);
3333
Assert.IsType<V1Namespace>(objs[1]);
34-
Assert.Equal(((V1Pod) objs[0]).Metadata.Name, "foo");
35-
Assert.Equal(((V1Namespace) objs[1]).Metadata.Name, "ns");
34+
Assert.Equal("foo", ((V1Pod) objs[0]).Metadata.Name);
35+
Assert.Equal("ns", ((V1Namespace) objs[1]).Metadata.Name);
3636
}
3737

3838
[Fact]

0 commit comments

Comments
 (0)