Skip to content

Commit

Permalink
Merge branch 'release/6.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Sep 3, 2022
2 parents 44f36f5 + 089a694 commit 5b8af5c
Show file tree
Hide file tree
Showing 80 changed files with 1,901 additions and 362 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": "2.1.0",
"version": "2.2.0",
"commands": [
"dotnet-cake"
]
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for Dependabot PRs
if: |
(startsWith(steps.dependabot-metadata.outputs.dependency-names, 'catel.') ||
(startsWith(steps.dependabot-metadata.outputs.dependency-names, 'approvaltests.') ||
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.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'nunit') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'nunit3testadapter') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'orc.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'orchestra.')) &&
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'orchestra.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'verify.')) &&
(steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' ||
steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch')
run: gh pr merge --auto --merge "$PR_URL"
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,17 @@ TestResults
.github/
BundleArtifacts/

# docker / tye
.tye

# editors
.idea
.vscode

# Binaries
*.dll
*.exe

# fody
FodyWeavers.xsd

Expand All @@ -148,3 +155,7 @@ FodyWeavers.xsd
# ANTLR
data/dsl/*.class
data/dsl/*.java

# Nodejs / NPM
node_modules
package-lock.json
9 changes: 8 additions & 1 deletion cake.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
; The configuration file for Cake.

[Settings]
SkipVerification=true
SkipVerification=true

[Settings]
EnableScriptCache=true

[Paths]
; Cache=%temp%/cake-build/cache/
; Note: cache-path is set via environment variables
16 changes: 0 additions & 16 deletions deployment/cake/apps-web-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,6 @@ public class WebProcessor : ProcessorBase
// Always disable SourceLink
msBuildSettings.WithProperty("EnableSourceLink", "false");

// Note: we need to set OverridableOutputPath because we need to be able to respect
// AppendTargetFrameworkToOutputPath which isn't possible for global properties (which
// are properties passed in using the command line)
var outputDirectory = System.IO.Path.Combine(BuildContext.General.OutputRootDirectory, webApp);
CakeContext.Information("Output directory: '{0}'", outputDirectory);
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
msBuildSettings.WithProperty("PackageOutputPath", BuildContext.General.OutputRootDirectory);

// TODO: Enable GitLink / SourceLink, see RepositoryUrl, RepositoryBranchName, RepositoryCommitId variables

RunMsBuild(BuildContext, webApp, projectFileName, msBuildSettings, "build");
}
}
Expand Down Expand Up @@ -127,11 +116,6 @@ public class WebProcessor : ProcessorBase

var msBuildSettings = new DotNetMSBuildSettings();

// Note: we need to set OverridableOutputPath because we need to be able to respect
// AppendTargetFrameworkToOutputPath which isn't possible for global properties (which
// are properties passed in using the command line)
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
msBuildSettings.WithProperty("PackageOutputPath", outputDirectory);
msBuildSettings.WithProperty("ConfigurationName", BuildContext.General.Solution.ConfigurationName);
msBuildSettings.WithProperty("PackageVersion", BuildContext.General.Version.NuGet);
Expand Down
9 changes: 0 additions & 9 deletions deployment/cake/apps-wpf-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ public class WpfProcessor : ProcessorBase
// Always disable SourceLink
msBuildSettings.WithProperty("EnableSourceLink", "false");

// Note: we need to set OverridableOutputPath because we need to be able to respect
// AppendTargetFrameworkToOutputPath which isn't possible for global properties (which
// are properties passed in using the command line)
var outputDirectory = GetProjectOutputDirectory(BuildContext, wpfApp);
CakeContext.Information("Output directory: '{0}'", outputDirectory);
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
msBuildSettings.WithProperty("PackageOutputPath", BuildContext.General.OutputRootDirectory);

RunMsBuild(BuildContext, wpfApp, projectFileName, msBuildSettings, "build");
}
}
Expand Down
7 changes: 7 additions & 0 deletions deployment/cake/codesigning-tasks.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#l "codesigning-variables.cake"

using System.Xml.Linq;

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

// Empty by design for now
52 changes: 52 additions & 0 deletions deployment/cake/codesigning-variables.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#l "buildserver.cake"

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

public class CodeSigningContext : BuildContextBase
{
public CodeSigningContext(IBuildContext parentBuildContext)
: base(parentBuildContext)
{
}

public List<string> ProjectsToSignImmediately { get; set; }

protected override void ValidateContext()
{

}

protected override void LogStateInfoForContext()
{
//CakeContext.Information($"Found '{Items.Count}' component projects");
}
}

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

private CodeSigningContext InitializeCodeSigningContext(BuildContext buildContext, IBuildContext parentBuildContext)
{
var data = new CodeSigningContext(parentBuildContext)
{
ProjectsToSignImmediately = CodeSignImmediately ?? new List<string>(),
};

return data;
}

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

List<string> _codeSignImmediately;

public List<string> CodeSignImmediately
{
get
{
if (_codeSignImmediately is null)
{
_codeSignImmediately = new List<string>();
}

return _codeSignImmediately;
}
}
19 changes: 2 additions & 17 deletions deployment/cake/components-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,9 @@ public class ComponentsProcessor : ProcessorBase
};

ConfigureMsBuild(BuildContext, msBuildSettings, component, "build");

// Note: we need to set OverridableOutputPath because we need to be able to respect
// AppendTargetFrameworkToOutputPath which isn't possible for global properties (which
// are properties passed in using the command line)
var outputDirectory = GetProjectOutputDirectory(BuildContext, component);
CakeContext.Information("Output directory: '{0}'", outputDirectory);
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
msBuildSettings.WithProperty("PackageOutputPath", BuildContext.General.OutputRootDirectory);

// SourceLink specific stuff
if (IsSourceLinkSupported(BuildContext, projectFileName))
if (IsSourceLinkSupported(BuildContext, component, projectFileName))
{
var repositoryUrl = BuildContext.General.Repository.Url;
var repositoryCommitId = BuildContext.General.Repository.CommitId;
Expand All @@ -152,7 +143,7 @@ public class ComponentsProcessor : ProcessorBase
msBuildSettings.WithProperty("RepositoryUrl", repositoryUrl);
msBuildSettings.WithProperty("RevisionId", repositoryCommitId);

InjectSourceLinkInProjectFile(BuildContext, projectFileName);
InjectSourceLinkInProjectFile(BuildContext, component, projectFileName);
}

RunMsBuild(BuildContext, component, projectFileName, msBuildSettings, "build");
Expand Down Expand Up @@ -230,12 +221,6 @@ public class ComponentsProcessor : ProcessorBase

ConfigureMsBuild(BuildContext, msBuildSettings, component, "pack");

// Note: we need to set OverridableOutputPath because we need to be able to respect
// AppendTargetFrameworkToOutputPath which isn't possible for global properties (which
// are properties passed in using the command line)
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
msBuildSettings.WithProperty("PackageOutputPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("ConfigurationName", configurationName);
msBuildSettings.WithProperty("PackageVersion", BuildContext.General.Version.NuGet);

Expand Down
43 changes: 29 additions & 14 deletions deployment/cake/dependencies-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ public class DependenciesProcessor : ProcessorBase
// is required to prevent issues with foreach
foreach (var dependency in BuildContext.Dependencies.Items.ToList())
{
// Note: dependencies should always be built
// if (!ShouldProcessProject(BuildContext, dependency))
// {
// BuildContext.Dependencies.Items.Remove(dependency);
// }
if (!BuildContext.Dependencies.ShouldBuildDependency(dependency))
{
BuildContext.CakeContext.Information("Skipping dependency '{0}' because no dependent projects are included", dependency);

BuildContext.Dependencies.Dependencies.Remove(dependency);
BuildContext.Dependencies.Items.Remove(dependency);
}
}
}

Expand Down Expand Up @@ -64,7 +66,7 @@ public class DependenciesProcessor : ProcessorBase
}

foreach (var dependency in BuildContext.Dependencies.Items)
{
{
BuildContext.CakeContext.LogSeparator("Building dependency '{0}'", dependency);

var projectFileName = GetProjectFileName(BuildContext, dependency);
Expand Down Expand Up @@ -92,14 +94,8 @@ public class DependenciesProcessor : ProcessorBase
msBuildSettings.PlatformTarget = PlatformTarget.Win32;
}

var outputDirectory = GetProjectOutputDirectory(BuildContext, dependency);
CakeContext.Information("Output directory: '{0}'", outputDirectory);
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
msBuildSettings.WithProperty("PackageOutputPath", BuildContext.General.OutputRootDirectory);

// SourceLink specific stuff
if (IsSourceLinkSupported(BuildContext, projectFileName))
if (IsSourceLinkSupported(BuildContext, dependency, projectFileName))
{
var repositoryUrl = BuildContext.General.Repository.Url;
var repositoryCommitId = BuildContext.General.Repository.CommitId;
Expand All @@ -116,7 +112,26 @@ public class DependenciesProcessor : ProcessorBase
msBuildSettings.WithProperty("RepositoryUrl", repositoryUrl);
msBuildSettings.WithProperty("RevisionId", repositoryCommitId);

InjectSourceLinkInProjectFile(BuildContext, projectFileName);
InjectSourceLinkInProjectFile(BuildContext, dependency, projectFileName);
}

// Specific code signing, requires the following MSBuild properties:
// * CodeSignEnabled
// * CodeSignCommand
//
// This feature is built to allow projects that have post-build copy
// steps (e.g. for assets) to be signed correctly before being embedded
if (ShouldSignImmediately(BuildContext, dependency))
{
var codeSignToolFileName = FindSignToolFileName(BuildContext);
var codeSignVerifyCommand = $"verify /pa";
var codeSignCommand = string.Format("sign /a /t {0} /n {1}", BuildContext.General.CodeSign.TimeStampUri,
BuildContext.General.CodeSign.CertificateSubjectName);

msBuildSettings.WithProperty("CodeSignToolFileName", codeSignToolFileName);
msBuildSettings.WithProperty("CodeSignVerifyCommand", codeSignVerifyCommand);
msBuildSettings.WithProperty("CodeSignCommand", codeSignCommand);
msBuildSettings.WithProperty("CodeSignEnabled", "true");
}

RunMsBuild(BuildContext, dependency, projectFileName, msBuildSettings, "build");
Expand Down
42 changes: 34 additions & 8 deletions deployment/cake/dependencies-variables.cake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

public class DependenciesContext : BuildContextWithItemsBase
{
public DependenciesContext(IBuildContext parentBuildContext)
public DependenciesContext(IBuildContext parentBuildContext, Dictionary<string, List<string>> dependencies)
: base(parentBuildContext)
{
Dependencies = dependencies ?? new Dictionary<string, List<string>>();
Items = Dependencies.Keys.ToList();
}

public Dictionary<string, List<string>> Dependencies { get; private set; }

protected override void ValidateContext()
{

Expand All @@ -18,31 +22,53 @@ public class DependenciesContext : BuildContextWithItemsBase
{
CakeContext.Information($"Found '{Items.Count}' dependency projects");
}

public bool ShouldBuildDependency(string dependencyProject)
{
if (!Dependencies.TryGetValue(dependencyProject, out var dependencyInfo))
{
return false;
}

if (dependencyInfo.Count == 0)
{
// No explicit projects defined, always build dependency
return true;
}

foreach (var projectRequiringDependency in dependencyInfo)
{
// Check if we should build this project
if (ShouldProcessProject((BuildContext)ParentContext, projectRequiringDependency))
{
return true;
}
}

return false;
}
}

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

private DependenciesContext InitializeDependenciesContext(BuildContext buildContext, IBuildContext parentBuildContext)
{
var data = new DependenciesContext(parentBuildContext)
{
Items = Dependencies ?? new List<string>()
};
var data = new DependenciesContext(parentBuildContext, Dependencies);

return data;
}

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

List<string> _dependencies;
Dictionary<string, List<string>> _dependencies;

public List<string> Dependencies
public Dictionary<string, List<string>> Dependencies
{
get
{
if (_dependencies is null)
{
_dependencies = new List<string>();
_dependencies = new Dictionary<string, List<string>>();
}

return _dependencies;
Expand Down
Loading

0 comments on commit 5b8af5c

Please sign in to comment.