Skip to content
This repository was archived by the owner on Feb 23, 2025. It is now read-only.

Commit 4c5a7b3

Browse files
update build + add net472 target
1 parent 60716be commit 4c5a7b3

File tree

5 files changed

+29
-43
lines changed

5 files changed

+29
-43
lines changed

build/Program.cs

+20-34
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ namespace build
99
{
1010
class Program
1111
{
12-
private const bool RequireTests = true;
12+
private static class Targets
13+
{
14+
public const string Build = "build";
15+
public const string Test = "test";
16+
public const string Pack = "pack";
17+
}
18+
19+
static string BinaryToSign = "IdentityModel.OidcClient.dll";
1320

14-
private const string ArtifactsDir = "artifacts";
15-
private const string Build = "build";
16-
private const string Test = "test";
17-
private const string Pack = "pack";
1821

1922
static void Main(string[] args)
2023
{
@@ -25,52 +28,35 @@ static void Main(string[] args)
2528

2629
app.OnExecute(() =>
2730
{
28-
Target(Build, () =>
31+
Target(Targets.Build, () =>
2932
{
30-
var solution = Directory.GetFiles(".", "*.sln", SearchOption.TopDirectoryOnly).First();
31-
32-
Run("dotnet", $"build {solution} -c Release");
33+
Run("dotnet", $"build -c Release");
3334

3435
if (sign.HasValue())
3536
{
36-
Sign("IdentityModel.OidcClient.dll", "./src/bin/release");
37+
Sign(BinaryToSign, "./src/bin/release");
3738
}
3839
});
3940

40-
Target(Test, DependsOn(Build), () =>
41+
Target(Targets.Test, DependsOn(Targets.Build), () =>
4142
{
42-
try
43-
{
44-
var tests = Directory.GetFiles("./test", "*.csproj", SearchOption.AllDirectories);
45-
46-
foreach (var test in tests)
47-
{
48-
Run("dotnet", $"test {test} -c Release --no-build");
49-
}
50-
}
51-
catch (System.IO.DirectoryNotFoundException ex)
52-
{
53-
if (RequireTests)
54-
{
55-
throw new Exception($"No tests found: {ex.Message}");
56-
};
57-
}
43+
Run("dotnet", $"test -c Release --no-build");
5844
});
5945

60-
Target(Pack, DependsOn(Build), () =>
46+
Target(Targets.Pack, DependsOn(Targets.Test), () =>
6147
{
6248
var project = Directory.GetFiles("./src", "*.csproj", SearchOption.TopDirectoryOnly).First();
6349

64-
Run("dotnet", $"pack {project} -c Release -o ./{ArtifactsDir} --no-build");
50+
Run("dotnet", $"pack {project} -c Release -o ./artifacts --no-build");
6551

6652
if (sign.HasValue())
6753
{
68-
Sign("*.nupkg", $"./{ArtifactsDir}");
54+
Sign("*.nupkg", $"./artifacts");
6955
}
7056
});
7157

7258

73-
Target("default", DependsOn(Test, Pack));
59+
Target("default", DependsOn(Targets.Test, Targets.Pack));
7460
RunTargetsAndExit(app.RemainingArguments);
7561
});
7662

@@ -97,15 +83,15 @@ private static void Sign(string extension, string directory)
9783
foreach (var file in files)
9884
{
9985
Console.WriteLine(" Signing " + file);
100-
Run("./tools/signclient", $"sign -c {signClientConfig} -i {file} -r [email protected] -s \"{signClientSecret}\" -n 'IdentityServer4'", noEcho: true);
86+
Run("dotnet", $"SignClient sign -c {signClientConfig} -i {file} -r [email protected] -s \"{signClientSecret}\" -n 'IdentityServer4'", noEcho: true);
10187
}
10288
}
10389

10490
private static void CleanArtifacts()
10591
{
106-
Directory.CreateDirectory($"./{ArtifactsDir}");
92+
Directory.CreateDirectory($"./artifacts");
10793

108-
foreach (var file in Directory.GetFiles($"./{ArtifactsDir}"))
94+
foreach (var file in Directory.GetFiles($"./artifacts"))
10995
{
11096
File.Delete(file);
11197
}

build/build.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<TargetFramework>netcoreapp2.2</TargetFramework>
66
</PropertyGroup>
77

8-
<ItemGroup>
9-
<PackageReference Include="Bullseye" Version="2.3.0" />
10-
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.3" />
11-
<PackageReference Include="SimpleExec" Version="5.0.1" />
8+
<ItemGroup>
9+
<PackageReference Include="Bullseye" Version="3.0.0" />
10+
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.4.1" />
11+
<PackageReference Include="SimpleExec" Version="6.0.0" />
1212
</ItemGroup>
1313

1414
</Project>

src/IdentityModel.OidcClient.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
55
</PropertyGroup>
66
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
7-
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
7+
<TargetFrameworks>net461;net472;netstandard2.0</TargetFrameworks>
88
</PropertyGroup>
99

1010
<PropertyGroup>
@@ -34,7 +34,7 @@
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="IdentityModel" Version="4.0.0" />
37+
<PackageReference Include="IdentityModel" Version="4.1.0" />
3838
<PackageReference Include="minver" Version="2.0.0" PrivateAssets="All" />
3939

4040
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />

test/IdentityModel.OidcClient.Tests/IdentityModel.OidcClient.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
7-
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
7+
<TargetFrameworks>net461;net472;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
88
</PropertyGroup>
99

1010
<PropertyGroup>

test/IdentityModel.OidcClient.Tests/Infrastructure/Crypto.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ public static RsaSecurityKey CreateKey()
2626
{
2727
var rsa = RSA.Create();
2828

29-
#if NET452 || NET461
29+
#if NET452 || NET461 || NET472
3030
if (rsa.KeySize < 2048)
3131
{
3232
rsa.Dispose();
3333
rsa = new RSACryptoServiceProvider(2048);
3434
}
3535
#endif
3636
RsaSecurityKey key = null;
37-
#if NET452 || NET461
37+
#if NET452 || NET461 || NET472
3838
if (rsa is RSACryptoServiceProvider)
3939
{
4040
var parameters = rsa.ExportParameters(includePrivateParameters: true);

0 commit comments

Comments
 (0)