Skip to content

Commit

Permalink
Merge branch 'release/1.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Oct 9, 2024
2 parents a1496d0 + 9dac577 commit 55fef29
Show file tree
Hide file tree
Showing 33 changed files with 757 additions and 662 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "3.2.0",
"version": "4.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---support-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

---

ONLY active OSS contributors OR people who buy me a coffee can ask questions here. If you don't do either of these things - DO NOT FILE HERE OR I WILL SIMPLY REMOVE YOUR ACCOUNT :)
ONLY active OSS contributors OR people who buy us a coffee can ask questions here. If you don't do either of these things - DO NOT FILE HERE :)

Give as much details as humanly possible if you want any sort of answer!

Expand Down
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/--bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ assignees: ''
## Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

- [ ] WPF
- [ ] UWP
- [ ] iOS
- [ ] Android
- [ ] .NET Standard
- [ ] Blazor WASM
- [ ] .NET Core

## Component
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/--thank-you.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: "❤️Thank You"
about: Just want to say thank you, this is the guy to do it in
about: Just want to say thank you, this is the one to do it in
title: Thank You
labels: ''
assignees: ''
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ None
### PR Checklist ###

- [ ] I have included examples or tests
- [ ] I have updated the change log
- [ ] I am listed in the CONTRIBUTORS file
- [ ] I have updated the change log or created a GitHub ticket with the change
- [ ] I am listed in the CONTRIBUTORS file (if it exists)
- [ ] Changes adhere to coding standard
- [ ] I checked the licenses of Third Party software and discussed new dependencies with at least 1 other team member
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ updates:
interval: weekly

- package-ecosystem: nuget
directory: "/"
directories:
- "/"
- "/src"
schedule:
interval: daily
open-pull-requests-limit: 10
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and test

on:
push:
branches:
- develop
- master
pull_request:

#permissions:
#pull-requests: write
#contents: write

jobs:
build-and-test:
runs-on: windows-latest # Required for some (WPF) projects

steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
id: checkout
with:
fetch-depth: 0

- name: Setup .NET Core
id: setup-dotnet
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: '8.0.x'

- name: Cake Action
id: cake-action
uses: cake-build/cake-action@1223b6fa067ad192159f43b50cd4f953679b0934 #v2.0.0
with:
target: BuildAndTest
arguments: |
IsCiBuild: true
5 changes: 2 additions & 3 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 #1.6.0
uses: dependabot/fetch-metadata@5e5f99653a5b510e8555840e80cbf1514ad4af38 #2.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve Dependabot PR
Expand All @@ -21,8 +21,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for Dependabot PRs
if: |
(startsWith(steps.dependabot-metadata.outputs.dependency-names, 'approvaltests.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'catel.') ||
(startsWith(steps.dependabot-metadata.outputs.dependency-names, 'catel.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'fody') ||
endsWith(steps.dependabot-metadata.outputs.dependency-names, '.fody') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'microsoft.') ||
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ build.cakeoverrides
TestResults
.vs/
.sonarqube/
.github/
BundleArtifacts/

# docker / tye
Expand Down
13 changes: 13 additions & 0 deletions deployment/cake/components-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ public class ComponentsProcessor : ProcessorBase

// Special exception for Blazor projects
var isBlazorProject = IsBlazorProject(BuildContext, component);
var isPackageContainerProject = IsPackageContainerProject(BuildContext, component);

BuildContext.CakeContext.LogSeparator("Packaging component '{0}'", component);
CakeContext.Information("IsPackageContainerProject = '{0}'", isPackageContainerProject);

var projectDirectory = GetProjectDirectory(component);
var projectFileName = GetProjectFileName(BuildContext, component);
Expand Down Expand Up @@ -287,6 +289,17 @@ public class ComponentsProcessor : ProcessorBase
noBuild = false;
}

if (isPackageContainerProject)
{
// In debug / local builds, automatic building of reference projects
// is enabled for convenience. If that is the case, noBuild must be
// set to false, but *only* in debug mode
if (BuildContext.General.IsLocalBuild)
{
noBuild = false;
}
}

// As described in the this issue: https://github.com/NuGet/Home/issues/4360
// we should not use IsTool, but set BuildOutputTargetFolder instead
msBuildSettings.WithProperty("CopyLocalLockFileAssemblies", "true");
Expand Down
2 changes: 1 addition & 1 deletion deployment/cake/docker-tasks.cake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#l "docker-variables.cake"
#l "lib-octopusdeploy.cake"

#addin "nuget:?package=Cake.Docker&version=1.2.3"
#addin "nuget:?package=Cake.Docker&version=1.3.0"

//-------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions deployment/cake/generic-variables.cake
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public class SonarQubeContext : BuildContextBase
public string Url { get; set; }
public string Organization { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Token { get; set; }
public string Project { get; set; }

protected override void ValidateContext()
Expand Down Expand Up @@ -514,7 +514,7 @@ private GeneralContext InitializeGeneralContext(BuildContext buildContext, IBuil
Url = buildContext.BuildServer.GetVariable("SonarUrl", showValue: true),
Organization = buildContext.BuildServer.GetVariable("SonarOrganization", showValue: true),
Username = buildContext.BuildServer.GetVariable("SonarUsername", showValue: false),
Password = buildContext.BuildServer.GetVariable("SonarPassword", showValue: false),
Token = buildContext.BuildServer.GetVariable("SonarToken", showValue: false),
Project = buildContext.BuildServer.GetVariable("SonarProject", data.Solution.Name, showValue: true)
};

Expand Down
2 changes: 1 addition & 1 deletion deployment/cake/github-pages-tasks.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#l "github-pages-variables.cake"

#addin "nuget:?package=Cake.Git&version=3.0.0"
#addin "nuget:?package=Cake.Git&version=4.0.0"

//-------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion deployment/cake/issuetrackers-github.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#tool "nuget:?package=gitreleasemanager&version=0.16.0"
#tool "nuget:?package=gitreleasemanager&version=0.18.0"

//-------------------------------------------------------------

Expand Down
102 changes: 90 additions & 12 deletions deployment/cake/lib-generic.cake
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,35 @@ private static bool IsCppProject(string projectName)
return projectName.EndsWith(".vcxproj");
}

//--------------------------------------------------------------

private static bool IsPackageContainerProject(BuildContext buildContext, string projectName)
{
var isPackageContainer = false;

var projectFileName = CreateInlinedProjectXml(buildContext, projectName);

var projectFileContents = System.IO.File.ReadAllText(projectFileName);

var xmlDocument = XDocument.Parse(projectFileContents);
var projectElement = xmlDocument.Root;

foreach (var propertyGroupElement in projectElement.Elements("PropertyGroup"))
{
var packageContainerElement = propertyGroupElement.Element("PackageContainer");
if (packageContainerElement != null)
{
if (packageContainerElement.Value.ToLower() == "true")
{
isPackageContainer = true;
}
break;
}
}

return isPackageContainer;
}

//-------------------------------------------------------------

private static bool IsBlazorProject(BuildContext buildContext, string projectName)
Expand Down Expand Up @@ -488,16 +517,7 @@ private static bool IsDotNetCoreProject(BuildContext buildContext, string projec
var lowerCase = line.ToLower();
if (lowerCase.Contains("targetframework"))
{
if (lowerCase.Contains("netcore"))
{
isDotNetCore = true;
break;
}

if (lowerCase.Contains("net5") ||
lowerCase.Contains("net6") ||
lowerCase.Contains("net7") ||
lowerCase.Contains("net8"))
if (IsDotNetCoreTargetFramework(buildContext, lowerCase))
{
isDotNetCore = true;
break;
Expand All @@ -513,6 +533,30 @@ private static bool IsDotNetCoreProject(BuildContext buildContext, string projec

//-------------------------------------------------------------

private static bool IsDotNetCoreTargetFramework(BuildContext buildContext, string targetFramework)
{
var lowerCase = targetFramework.ToLower();

if (lowerCase.Contains("netcore"))
{
return true;
}

if (lowerCase.Contains("net5") ||
lowerCase.Contains("net6") ||
lowerCase.Contains("net7") ||
lowerCase.Contains("net8") ||
lowerCase.Contains("net9") ||
lowerCase.Contains("net10"))
{
return true;
}

return false;
}

//-------------------------------------------------------------

private static bool ShouldProcessProject(BuildContext buildContext, string projectName,
bool checkDeployment = true)
{
Expand Down Expand Up @@ -595,9 +639,43 @@ private static bool ShouldProcessProject(BuildContext buildContext, string proje
return true;
}

private static string CreateInlinedProjectXml(BuildContext buildContext, string projectName)
{
buildContext.CakeContext.Information($"Running 'msbuild /pp' for project '{projectName}'");

var projectInlinedFileName = System.IO.Path.Combine(GetProjectOutputDirectory(buildContext, projectName),
"..", $"{projectName}.inlined.xml");

// Note: disabled caching until we correctly clean up everything
//if (!buildContext.CakeContext.FileExists(projectInlinedFileName))
{
// Run "msbuild /pp" to create a single project file

var msBuildSettings = new MSBuildSettings
{
Verbosity = Verbosity.Quiet,
ToolVersion = MSBuildToolVersion.Default,
Configuration = buildContext.General.Solution.ConfigurationName,
MSBuildPlatform = MSBuildPlatform.x86, // Always require x86, see platform for actual target platform
PlatformTarget = PlatformTarget.MSIL
};

ConfigureMsBuild(buildContext, msBuildSettings, projectName, "pp");

msBuildSettings.Target = string.Empty;
msBuildSettings.ArgumentCustomization = args => args.Append($"/pp:{projectInlinedFileName}");

var projectFileName = GetProjectFileName(buildContext, projectName);

RunMsBuild(buildContext, projectName, projectFileName, msBuildSettings, "pp");
}

return projectInlinedFileName;
}

//-------------------------------------------------------------

private static List<string> GetProjectRuntimesIdentifiers(BuildContext buildContext, Cake.Core.IO.FilePath solutionOrProjectFileName, List<string> runtimeIdentifiersToInvestigate)
private static List<string> GetProjectRuntimesIdentifiers(BuildContext buildContext, Cake.Core.IO.FilePath solutionOrProjectFileName, IReadOnlyList<string> runtimeIdentifiersToInvestigate)
{
var projectFileContents = System.IO.File.ReadAllText(solutionOrProjectFileName.FullPath)?.ToLower();

Expand All @@ -607,7 +685,7 @@ private static List<string> GetProjectRuntimesIdentifiers(BuildContext buildCont
{
if (!string.IsNullOrWhiteSpace(runtimeIdentifier))
{
if (!projectFileContents.Contains(runtimeIdentifier.ToLower()))
if (!projectFileContents.Contains(runtimeIdentifier, StringComparison.OrdinalIgnoreCase))
{
buildContext.CakeContext.Information("Project '{0}' does not support runtime identifier '{1}', removing from supported runtime identifiers list", solutionOrProjectFileName, runtimeIdentifier);
continue;
Expand Down
Loading

0 comments on commit 55fef29

Please sign in to comment.