Skip to content

Commit 057decb

Browse files
committed
Merge branch 'dev'
2 parents d5e64e2 + adf1ed5 commit 057decb

File tree

26 files changed

+491
-365
lines changed

26 files changed

+491
-365
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to **LightQuery** are documented here.
44

5+
## v2.4.0:
6+
- Added a dedicated target for .NET 8
7+
- Added tests for .NET 8
8+
- `forceRefresh` on the Angular client no longer causes a request if no base url for the service is configured
9+
- Dropped tests and dedicated targets for .NET Framework 4.6.1, .NET Core 3.1 and .NET 5.0
10+
511
## v2.3.0:
612
- Added a dedicated target for .NET 7
713
- Added tests for .NET 7

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pipeline {
99
KeyVaultBaseUrl = credentials('AzureCiKeyVaultBaseUrl')
1010
KeyVaultClientId = credentials('AzureCiKeyVaultClientId')
1111
KeyVaultClientSecret = credentials('AzureCiKeyVaultClientSecret')
12+
KeyVaultTenantId = credentials('AzureKeyVaultTenantId')
1213
}
1314
stages {
1415
stage ('Test') {

build.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"
1818

1919
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
2020
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
21-
$DotNetChannel = "Current"
21+
$DotNetChannel = "STS"
2222

2323
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
2424
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
@@ -63,7 +63,12 @@ else {
6363
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
6464
}
6565

66-
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
66+
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
67+
68+
if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
69+
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
70+
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
71+
}
6772

6873
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
6974
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }

build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
1414

1515
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
1616
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
17-
DOTNET_CHANNEL="Current"
17+
DOTNET_CHANNEL="STS"
1818

1919
export DOTNET_CLI_TELEMETRY_OPTOUT=1
2020
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
@@ -56,7 +56,12 @@ else
5656
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
5757
fi
5858

59-
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
59+
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
60+
61+
if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then
62+
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
63+
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
64+
fi
6065

6166
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
6267
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"

build/.build.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
77
<RootNamespace></RootNamespace>
88
<IsPackable>False</IsPackable>
@@ -11,11 +11,11 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageDownload Include="GitVersion.Tool" Version="[5.11.1]" />
15-
<PackageReference Include="Nuke.Common" Version="6.2.1" />
16-
<PackageReference Include="Nuke.WebDocu" Version="4.0.1" />
17-
<PackageReference Include="Nuke.GitHub" Version="3.0.0" />
18-
<PackageReference Include="ReportGenerator" Version="5.1.12" />
14+
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
15+
<PackageReference Include="Nuke.Common" Version="8.0.0" />
16+
<PackageReference Include="Nuke.WebDocu" Version="5.0.1" />
17+
<PackageReference Include="Nuke.GitHub" Version="5.0.1" />
18+
<PackageReference Include="ReportGenerator" Version="5.2.1" />
1919
<PackageReference Include="docfx.console" Version="2.59.4">
2020
<ExcludeAssets>build</ExcludeAssets>
2121
<PrivateAssets>all</PrivateAssets>

build/Build.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Nuke.Common.ProjectModel;
66
using Nuke.Common.Tooling;
77
using Nuke.Common.Tools.AzureKeyVault;
8-
using Nuke.Common.Tools.AzureKeyVault.Attributes;
98
using Nuke.Common.Tools.Coverlet;
109
using Nuke.Common.Tools.DocFX;
1110
using Nuke.Common.Tools.DotNet;
@@ -24,8 +23,6 @@
2423
using System.Xml.Linq;
2524
using System.Xml.XPath;
2625
using static Nuke.Common.ChangeLog.ChangelogTasks;
27-
using static Nuke.Common.IO.FileSystemTasks;
28-
using static Nuke.Common.IO.PathConstruction;
2926
using static Nuke.Common.IO.XmlTasks;
3027
using static Nuke.Common.Tools.DocFX.DocFXTasks;
3128
using static Nuke.Common.Tools.DotNet.DotNetTasks;
@@ -34,34 +31,35 @@
3431
using static Nuke.GitHub.ChangeLogExtensions;
3532
using static Nuke.GitHub.GitHubTasks;
3633
using static Nuke.WebDocu.WebDocuTasks;
37-
using static Nuke.Common.IO.TextTasks;
3834

3935
class Build : NukeBuild
4036
{
4137
public static int Main () => Execute<Build>(x => x.Compile);
4238

43-
[KeyVaultSettings(
44-
BaseUrlParameterName = nameof(KeyVaultBaseUrl),
45-
ClientIdParameterName = nameof(KeyVaultClientId),
46-
ClientSecretParameterName = nameof(KeyVaultClientSecret))]
47-
readonly KeyVaultSettings KeyVaultSettings;
39+
[AzureKeyVaultConfiguration(
40+
BaseUrlParameterName = nameof(KeyVaultBaseUrl),
41+
ClientIdParameterName = nameof(KeyVaultClientId),
42+
ClientSecretParameterName = nameof(KeyVaultClientSecret),
43+
TenantIdParameterName = nameof(KeyVaultTenantId))]
44+
readonly AzureKeyVaultConfiguration KeyVaultSettings;
4845

49-
[KeyVault] readonly KeyVault KeyVault;
46+
[AzureKeyVault] readonly AzureKeyVault KeyVault;
5047

5148
[Parameter] readonly string KeyVaultBaseUrl;
5249
[Parameter] readonly string KeyVaultClientId;
5350
[Parameter] readonly string KeyVaultClientSecret;
51+
[Parameter] readonly string KeyVaultTenantId;
5452

5553
[GitVersion(Framework = "net6.0")] readonly GitVersion GitVersion;
5654
[GitRepository] readonly GitRepository GitRepository;
5755

58-
[KeyVaultSecret] readonly string DocuBaseUrl;
59-
[KeyVaultSecret] readonly string PublicMyGetSource;
60-
[KeyVaultSecret] readonly string PublicMyGetApiKey;
61-
[KeyVaultSecret] readonly string NuGetApiKey;
62-
[KeyVaultSecret("LightQuery-DocuApiKey")] readonly string DocuApiKey;
63-
[KeyVaultSecret] readonly string GitHubAuthenticationToken;
64-
[KeyVaultSecret] readonly string DanglCiCdTeamsWebhookUrl;
56+
[AzureKeyVaultSecret] readonly string DocuBaseUrl;
57+
[AzureKeyVaultSecret] readonly string DanglPublicFeedSource;
58+
[AzureKeyVaultSecret] readonly string FeedzAccessToken;
59+
[AzureKeyVaultSecret] readonly string NuGetApiKey;
60+
[AzureKeyVaultSecret("LightQuery-DocuApiKey")] readonly string DocuApiKey;
61+
[AzureKeyVaultSecret] readonly string GitHubAuthenticationToken;
62+
[AzureKeyVaultSecret] readonly string DanglCiCdTeamsWebhookUrl;
6563

6664
[Parameter] readonly string Configuration = IsLocalBuild ? "Debug" : "Release";
6765

@@ -100,14 +98,14 @@ void SendTeamsMessage(string title, string message, bool isError)
10098
Target Clean => _ => _
10199
.Executes(() =>
102100
{
103-
GlobDirectories(SourceDirectory / "LightQuery", "**/bin", "**/obj").ForEach(DeleteDirectory);
104-
GlobDirectories(SourceDirectory / "LightQuery.Client", "**/bin", "**/obj").ForEach(DeleteDirectory);
105-
GlobDirectories(SourceDirectory / "LightQuery.EntityFrameworkCore", "**/bin", "**/obj").ForEach(DeleteDirectory);
106-
GlobDirectories(SourceDirectory / "LightQuery.Shared", "**/bin", "**/obj").ForEach(DeleteDirectory);
107-
GlobDirectories(SourceDirectory / "LightQuery.NSwag", "**/bin", "**/obj").ForEach(DeleteDirectory);
108-
GlobDirectories(SourceDirectory / "LightQuery.Swashbuckle", "**/bin", "**/obj").ForEach(DeleteDirectory);
109-
GlobDirectories(RootDirectory / "test", "**/bin", "**/obj").ForEach(DeleteDirectory);
110-
EnsureCleanDirectory(OutputDirectory);
101+
(SourceDirectory / "LightQuery").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
102+
(SourceDirectory / "LightQuery.Client").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
103+
(SourceDirectory / "LightQuery.EntityFrameworkCore").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
104+
(SourceDirectory / "LightQuery.Shared").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
105+
(SourceDirectory / "LightQuery.NSwag").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
106+
(SourceDirectory / "LightQuery.Swashbuckle").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
107+
(RootDirectory / "test").GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
108+
OutputDirectory.CreateOrCleanDirectory();
111109
});
112110

113111
Target Restore => _ => _
@@ -149,7 +147,8 @@ void SendTeamsMessage(string title, string message, bool isError)
149147
.DependsOn(Compile)
150148
.Executes(() =>
151149
{
152-
var testProjects = GlobFiles(SolutionDirectory / "test", "**/*.csproj")
150+
var testProjects = (SolutionDirectory / "test").GlobFiles("**/*.csproj")
151+
.Select(t => t.ToString())
153152
.Where(t => !t.EndsWith("LightQuery.IntegrationTestsServer.csproj"))
154153
.ToList();
155154

@@ -211,9 +210,9 @@ void SendTeamsMessage(string title, string message, bool isError)
211210
}
212211
});
213212

214-
private void MakeSourceEntriesRelativeInCoberturaFormat(string coberturaReportPath)
213+
private void MakeSourceEntriesRelativeInCoberturaFormat(AbsolutePath coberturaReportPath)
215214
{
216-
var originalText = ReadAllText(coberturaReportPath);
215+
var originalText = coberturaReportPath.ReadAllText();
217216
var xml = XDocument.Parse(originalText);
218217

219218
var xDoc = XDocument.Load(coberturaReportPath);
@@ -275,15 +274,16 @@ IEnumerable<string> GetTestFrameworksForProjectFile(string projectFile)
275274

276275
Target Push => _ => _
277276
.DependsOn(Pack)
278-
.Requires(() => PublicMyGetSource)
279-
.Requires(() => PublicMyGetApiKey)
277+
.Requires(() => DanglPublicFeedSource)
278+
.Requires(() => FeedzAccessToken)
280279
.Requires(() => NuGetApiKey)
281280
.Requires(() => Configuration.EqualsOrdinalIgnoreCase("Release"))
282281
.OnlyWhenDynamic(() => Jenkins.Instance == null
283282
|| Jenkins.Instance.ChangeId == null)
284283
.Executes(() =>
285284
{
286-
var packages = GlobFiles(OutputDirectory, "*.nupkg")
285+
var packages = OutputDirectory.GlobFiles("*.nupkg")
286+
.Select(p => p.ToString())
287287
.Where(x => !x.EndsWith("symbols.nupkg"))
288288
.ToList();
289289
Assert.NotEmpty(packages);
@@ -292,8 +292,8 @@ IEnumerable<string> GetTestFrameworksForProjectFile(string projectFile)
292292
{
293293
DotNetNuGetPush(s => s
294294
.SetTargetPath(x)
295-
.SetSource(PublicMyGetSource)
296-
.SetApiKey(PublicMyGetApiKey));
295+
.SetSource(DanglPublicFeedSource)
296+
.SetApiKey(FeedzAccessToken));
297297

298298
if (GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master"))
299299
{
@@ -376,7 +376,7 @@ IEnumerable<string> GetTestFrameworksForProjectFile(string projectFile)
376376
var completeChangeLog = $"## {releaseTag}" + Environment.NewLine + latestChangeLog;
377377

378378
var repositoryInfo = GetGitHubRepositoryInfo(GitRepository);
379-
var nuGetPackages = GlobFiles(OutputDirectory, "*.nupkg").ToArray();
379+
var nuGetPackages = OutputDirectory.GlobFiles("*.nupkg").Select(f => f.ToString()).ToArray();
380380
Assert.NotEmpty(nuGetPackages);
381381

382382
await PublishRelease(x => x
@@ -391,7 +391,7 @@ await PublishRelease(x => x
391391

392392
void PrependFrameworkToTestresults()
393393
{
394-
var testResults = GlobFiles(OutputDirectory, "*testresults*.xml").ToList();
394+
var testResults = OutputDirectory.GlobFiles("*testresults*.xml").ToList();
395395
Serilog.Log.Debug($"Found {testResults.Count} test result files on which to append the framework.");
396396
foreach (var testResultFile in testResults)
397397
{
@@ -438,7 +438,7 @@ void PrependFrameworkToTestresults()
438438
}
439439

440440
firstXdoc.Save(OutputDirectory / "testresults.xml");
441-
testResults.ForEach(DeleteFile);
441+
testResults.ForEach(d => d.DeleteFile());
442442
}
443443

444444
string GetFrameworkNameFromFilename(string filename)
@@ -454,9 +454,9 @@ string GetFrameworkNameFromFilename(string filename)
454454
.Executes(() =>
455455
{
456456
var ngAppDir = SourceDirectory / "ng-lightquery";
457-
DeleteDirectory(ngAppDir / "dist");
458-
DeleteDirectory(ngAppDir / "coverage");
459-
DeleteFile(ngAppDir / "karma-results.xml");
457+
(ngAppDir / "dist").DeleteDirectory();
458+
(ngAppDir / "coverage").DeleteDirectory();
459+
(ngAppDir / "karma-results.xml").DeleteFile();
460460

461461
Npm("ci", ngAppDir);
462462
Npm("run test:ci", ngAppDir);
@@ -469,7 +469,7 @@ string GetFrameworkNameFromFilename(string filename)
469469
{
470470
var ngAppDir = SourceDirectory / "ng-lightquery";
471471
var ngLibraryDir = ngAppDir / "dist" / "ng-lightquery";
472-
DeleteDirectory(ngAppDir / "dist");
472+
(ngAppDir / "dist").DeleteDirectory();
473473

474474
Npm("ci", ngAppDir);
475475

src/LightQuery.Client/LightQuery.Client.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;netstandard2.0;net461</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;netstandard2.0</TargetFrameworks>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
66
<Authors>Georg Dangl</Authors>
77
<Company />
@@ -20,12 +20,8 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="System.Reactive" Version="4.3.2" />
24-
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
25-
</ItemGroup>
26-
27-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
28-
<PackageReference Include="System.Net.Http" Version="4.3.4" />
23+
<PackageReference Include="System.Reactive" Version="6.0.0" />
24+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2925
</ItemGroup>
3026

3127
<ItemGroup>

src/LightQuery.EntityFrameworkCore/LightQuery.EntityFrameworkCore.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net6.0;net5.0;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
66
<Authors>Georg Dangl</Authors>
77
<Company />
@@ -20,11 +20,10 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Condition="'$(TargetFramework)'=='netstandard2.0' Or '$(TargetFramework)'=='net461'" Include="Microsoft.EntityFrameworkCore" Version="2.1.3" />
24-
<PackageReference Condition="'$(TargetFramework)'=='netcoreapp3.1'" Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
25-
<PackageReference Condition="'$(TargetFramework)'=='net5.0'" Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
23+
<PackageReference Condition="'$(TargetFramework)'=='netstandard2.0'" Include="Microsoft.EntityFrameworkCore" Version="2.1.3" />
2624
<PackageReference Condition="'$(TargetFramework)'=='net6.0'" Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
2725
<PackageReference Condition="'$(TargetFramework)'=='net7.0'" Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
26+
<PackageReference Condition="'$(TargetFramework)'=='net8.0'" Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
2827
</ItemGroup>
2928

3029
<ItemGroup>

src/LightQuery.NSwag/LightQuery.NSwag.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net5.0;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;netstandard2.0</TargetFrameworks>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
66
<Authors>Georg Dangl</Authors>
77
<Company />
@@ -20,7 +20,7 @@
2020
</PropertyGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="NSwag.AspNetCore" Version="13.18.0" />
23+
<PackageReference Include="NSwag.AspNetCore" Version="14.0.2" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

src/LightQuery.Shared/LightQuery.Shared.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net5.0;netcoreapp3.1;netstandard2.0;net461</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;netstandard2.0</TargetFrameworks>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
66
<Authors>Georg Dangl</Authors>
77
<Company />
@@ -19,11 +19,11 @@
1919
<CheckEolTargetFramework>false</CheckEolTargetFramework>
2020
</PropertyGroup>
2121

22-
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1' Or '$(TargetFramework)'=='net5.0' Or '$(TargetFramework)'=='net7.0'">
22+
<ItemGroup Condition="'$(TargetFramework)'=='net7.0' Or '$(TargetFramework)'=='net8.0'">
2323
<FrameworkReference Include="Microsoft.AspNetCore.App" />
2424
</ItemGroup>
2525

26-
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0' Or '$(TargetFramework)'=='net461'">
26+
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
2727
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.3" />
2828
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.2" />
2929
</ItemGroup>

0 commit comments

Comments
 (0)