Skip to content

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ceo1647 committed Jul 15, 2020
2 parents 813f291 + 063c772 commit b7dbcf5
Show file tree
Hide file tree
Showing 39 changed files with 356 additions and 273 deletions.
19 changes: 17 additions & 2 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,29 @@ update_configs:
directory: "/"
update_schedule: "daily"
automerged_updates:
- match:
dependency_name: "ApprovalTests"
update_type: "all"
- match:
dependency_name: "Blorc.*"
update_type: "all"
- match:
dependency_name: "Catel.*"
update_type: "all"
- match:
dependency_name: "Fody"
update_type: "all"
- match:
dependency_name: "*.Fody"
update_type: "all"
- match:
dependency_name: "Catel.*"
dependency_name: "Microsoft.*"
update_type: "all"
- match:
dependency_name: "NUnit"
update_type: "all"
- match:
dependency_name: "NUnit3TestAdapter"
update_type: "all"
- match:
dependency_name: "Orc.*"
Expand All @@ -20,5 +35,5 @@ update_configs:
dependency_name: "Orchestra.*"
update_type: "all"
- match:
dependency_name: "Blorc.*"
dependency_name: "PublicApiGenerator"
update_type: "all"
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,12 @@ TestResults
.github/
BundleArtifacts/

# editors
.idea
.vscode
FodyWeavers.xsd

# fody
FodyWeavers.xsd

# Approval tests
*.received.cs
2 changes: 1 addition & 1 deletion GitVersionConfig.yaml → GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mode: ContinuousDeployment
assembly-versioning-scheme: MajorMinorPatch
next-version: 3.0.0
next-version: 4.0.0
6 changes: 3 additions & 3 deletions deployment/cake/apps-uwp-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public class UwpProcessor : ProcessorBase
private string GetArtifactsDirectory(string outputRootDirectory)
{
// 1 directory up since we want to turn "/output/release" into "/output/"
var artifactsDirectoryString = string.Format("{0}/..", outputRootDirectory);
var artifactsDirectoryString = System.IO.Path.Combine(outputRootDirectory, "..");
var artifactsDirectory = CakeContext.MakeAbsolute(CakeContext.Directory(artifactsDirectoryString)).FullPath;

return artifactsDirectory;
}

private string GetAppxUploadFileName(string artifactsDirectory, string solutionName, string versionMajorMinorPatch)
{
var appxUploadSearchPattern = artifactsDirectory + string.Format("/{0}_{1}.0_*.appxupload", solutionName, versionMajorMinorPatch);
var appxUploadSearchPattern = System.IO.Path.Combine(artifactsDirectory, string.Format("{0}_{1}.0_*.appxupload", solutionName, versionMajorMinorPatch));

CakeContext.Information("Searching for appxupload using '{0}'", appxUploadSearchPattern);

Expand Down Expand Up @@ -89,7 +89,7 @@ public class UwpProcessor : ProcessorBase

foreach (var uwpApp in BuildContext.Uwp.Items)
{
var appxManifestFile = string.Format("./src/{0}/Package.appxmanifest", uwpApp);
var appxManifestFile = System.IO.Path.Combine(".", "src", uwpApp, "Package.appxmanifest");
UpdateAppxManifestVersion(appxManifestFile, string.Format("{0}.0", BuildContext.General.Version.MajorMinorPatch));
}
}
Expand Down
14 changes: 10 additions & 4 deletions deployment/cake/apps-web-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class WebProcessor : ProcessorBase
// 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 = string.Format("{0}/{1}/", BuildContext.General.OutputRootDirectory, webApp);
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);
Expand All @@ -114,11 +114,17 @@ public class WebProcessor : ProcessorBase

foreach (var webApp in BuildContext.Web.Items)
{
if (!ShouldDeployProject(BuildContext, webApp))
{
CakeContext.Information("Web app '{0}' should not be deployed", webApp);
continue;
}

BuildContext.CakeContext.LogSeparator("Packaging web app '{0}'", webApp);

var projectFileName = string.Format("./src/{0}/{0}.csproj", webApp);
var projectFileName = System.IO.Path.Combine(".", "src", webApp, $"{webApp}.csproj");

var outputDirectory = string.Format("{0}/{1}/", BuildContext.General.OutputRootDirectory, webApp);
var outputDirectory = System.IO.Path.Combine(BuildContext.General.OutputRootDirectory, webApp);
CakeContext.Information("Output directory: '{0}'", outputDirectory);

CakeContext.Information("1) Using 'dotnet publish' to package '{0}'", webApp);
Expand Down Expand Up @@ -173,7 +179,7 @@ public class WebProcessor : ProcessorBase

BuildContext.CakeContext.LogSeparator("Deploying web app '{0}'", webApp);

var packageToPush = string.Format("{0}/{1}.{2}.nupkg", BuildContext.General.OutputRootDirectory, webApp, BuildContext.General.Version.NuGet);
var packageToPush = System.IO.Path.Combine(BuildContext.General.OutputRootDirectory, string.Format("{0}.{1}.nupkg", webApp, BuildContext.General.Version.NuGet));
var octopusRepositoryUrl = BuildContext.OctopusDeploy.GetRepositoryUrl(webApp);
var octopusRepositoryApiKey = BuildContext.OctopusDeploy.GetRepositoryApiKey(webApp);
var octopusDeploymentTarget = BuildContext.OctopusDeploy.GetDeploymentTarget(webApp);
Expand Down
19 changes: 11 additions & 8 deletions deployment/cake/apps-wpf-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ public class WpfProcessor : ProcessorBase

var channelSuffix = BuildContext.Installer.GetDeploymentChannelSuffix();

var sourceFileName = $"./design/logo/logo{channelSuffix}.ico";
var sourceFileName = System.IO.Path.Combine(".", "design", "logo", $"logo{channelSuffix}.ico");
if (BuildContext.CakeContext.FileExists(sourceFileName))
{
CakeContext.Information("Enforcing channel specific icon '{0}'", sourceFileName);

var projectDirectory = GetProjectDirectory(wpfApp);
var targetFileName = $"{projectDirectory}/Resources/Icons/logo.ico";
var targetFileName = System.IO.Path.Combine(projectDirectory, "Resources", "Icons", "logo.ico");

BuildContext.CakeContext.CopyFile(sourceFileName, targetFileName);
}
Expand Down Expand Up @@ -117,15 +117,12 @@ public class WpfProcessor : ProcessorBase

if (BuildContext.General.IsOfficialBuild)
{
// All channels
channels.Add("alpha");
channels.Add("beta");
// Note: we used to deploy stable to stable, beta and alpha, but want to keep things separated now
channels.Add("stable");
}
else if (BuildContext.General.IsBetaBuild)
{
// Both alpha and beta, since MyApp.beta1 should also be available on the alpha channel
channels.Add("alpha");
// Note: we used to deploy beta to beta and alpha, but want to keep things separated now
channels.Add("beta");
}
else if (BuildContext.General.IsAlphaBuild)
Expand All @@ -143,6 +140,12 @@ public class WpfProcessor : ProcessorBase

foreach (var wpfApp in BuildContext.Wpf.Items)
{
if (!ShouldDeployProject(BuildContext, wpfApp))
{
CakeContext.Information("WPF app '{0}' should not be deployed", wpfApp);
continue;
}

CakeContext.Information("Deleting unnecessary files for WPF app '{0}'", wpfApp);

var outputDirectory = GetProjectOutputDirectory(BuildContext, wpfApp);
Expand Down Expand Up @@ -199,7 +202,7 @@ public class WpfProcessor : ProcessorBase
BuildContext.CakeContext.LogSeparator("Deploying WPF app '{0}'", wpfApp);

//%DeploymentsShare%\%ProjectName% /%ProjectName% -c %AzureDeploymentsStorageConnectionString%
var deploymentShare = string.Format("{0}/{1}", BuildContext.Wpf.DeploymentsShare, wpfApp);
var deploymentShare = System.IO.Path.Combine(BuildContext.Wpf.DeploymentsShare, wpfApp);

var exitCode = CakeContext.StartProcess(azureStorageSyncExe, new ProcessSettings
{
Expand Down
11 changes: 9 additions & 2 deletions deployment/cake/buildserver.cake
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class BuildServerIntegration : IIntegration
}
}

var overrideFile = "./build.cakeoverrides";
var overrideFile = System.IO.Path.Combine(".", "build.cakeoverrides");
if (System.IO.File.Exists(overrideFile))
{
var sb = new StringBuilder(string.Empty, 256);
Expand All @@ -144,7 +144,14 @@ public class BuildServerIntegration : IIntegration
{
CakeContext.Information("Variable '{0}' is specified via build.cakeoverrides", variableName);

return sb.ToString();
var sbValue = sb.ToString();
if (sbValue == "[ignore]" ||
sbValue == "[empty]")
{
return string.Empty;
}

return sbValue;
}
}

Expand Down
18 changes: 14 additions & 4 deletions deployment/cake/components-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public class ComponentsProcessor : ProcessorBase
{
foreach (var component in BuildContext.Components.Items)
{
var cacheDirectory = Environment.ExpandEnvironmentVariables(string.Format("%userprofile%/.nuget/packages/{0}/{1}", component, BuildContext.General.Version.NuGet));
var expandableCacheDirectory = System.IO.Path.Combine("%userprofile%", ".nuget", "packages", component, BuildContext.General.Version.NuGet);
var cacheDirectory = Environment.ExpandEnvironmentVariables(expandableCacheDirectory);

CakeContext.Information("Checking for existing local NuGet cached version at '{0}'", cacheDirectory);

Expand Down Expand Up @@ -175,10 +176,19 @@ public class ComponentsProcessor : ProcessorBase

foreach (var component in BuildContext.Components.Items)
{
// Note: some projects, such as Catel.Fody, require packaging
// of non-deployable projects
if (BuildContext.General.SkipComponentsThatAreNotDeployable &&
!ShouldDeployProject(BuildContext, component))
{
CakeContext.Information("Component '{0}' should not be deployed", component);
continue;
}

BuildContext.CakeContext.LogSeparator("Packaging component '{0}'", component);

var projectDirectory = string.Format("./src/{0}", component);
var projectFileName = string.Format("{0}/{1}.csproj", projectDirectory, component);
var projectDirectory = GetProjectDirectory(component);
var projectFileName = GetProjectFileName(BuildContext, component);
var outputDirectory = GetProjectOutputDirectory(BuildContext, component);
CakeContext.Information("Output directory: '{0}'", outputDirectory);

Expand Down Expand Up @@ -297,7 +307,7 @@ public class ComponentsProcessor : ProcessorBase

BuildContext.CakeContext.LogSeparator("Deploying component '{0}'", component);

var packageToPush = string.Format("{0}/{1}.{2}.nupkg", BuildContext.General.OutputRootDirectory, component, BuildContext.General.Version.NuGet);
var packageToPush = System.IO.Path.Combine(BuildContext.General.OutputRootDirectory, $"{component}.{BuildContext.General.Version.NuGet}.nupkg");
var nuGetRepositoryUrl = GetComponentNuGetRepositoryUrl(component);
var nuGetRepositoryApiKey = GetComponentNuGetRepositoryApiKey(component);

Expand Down
20 changes: 13 additions & 7 deletions deployment/cake/docker-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public class DockerImagesProcessor : ProcessorBase
// 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 = string.Format("{0}/{1}/", BuildContext.General.OutputRootDirectory, dockerImage);
var outputDirectory = GetProjectOutputDirectory(BuildContext, dockerImage);
CakeContext.Information("Output directory: '{0}'", outputDirectory);
msBuildSettings.WithProperty("OverridableOutputRootPath", BuildContext.General.OutputRootDirectory);
msBuildSettings.WithProperty("OverridableOutputPath", outputDirectory);
Expand All @@ -156,18 +156,24 @@ public class DockerImagesProcessor : ProcessorBase

foreach (var dockerImage in BuildContext.DockerImages.Items)
{
if (!ShouldDeployProject(BuildContext, dockerImage))
{
CakeContext.Information("Docker image '{0}' should not be deployed", dockerImage);
continue;
}

BuildContext.CakeContext.LogSeparator("Packaging docker image '{0}'", dockerImage);

var projectFileName = string.Format("./src/{0}/{0}.csproj", dockerImage);
var dockerImageSpecificationDirectory = string.Format("./deployment/docker/{0}/", dockerImage);
var dockerImageSpecificationFileName = string.Format("{0}/{1}", dockerImageSpecificationDirectory, dockerImage);
var projectFileName = GetProjectFileName(BuildContext, dockerImage);
var dockerImageSpecificationDirectory = System.IO.Path.Combine(".", "deployment", "docker", dockerImage);
var dockerImageSpecificationFileName = System.IO.Path.Combine(dockerImageSpecificationDirectory, dockerImage);

var outputRootDirectory = string.Format("{0}/{1}/output", BuildContext.General.OutputRootDirectory, dockerImage);
var outputRootDirectory = System.IO.Path.Combine(BuildContext.General.OutputRootDirectory, dockerImage, "output");

CakeContext.Information("1) Preparing ./config for package '{0}'", dockerImage);

// ./config
var confTargetDirectory = string.Format("{0}/conf", outputRootDirectory);
var confTargetDirectory = System.IO.Path.Combine(outputRootDirectory, "conf");
CakeContext.Information("Conf directory: '{0}'", confTargetDirectory);

CakeContext.CreateDirectory(confTargetDirectory);
Expand All @@ -182,7 +188,7 @@ public class DockerImagesProcessor : ProcessorBase
CakeContext.Information("2) Preparing ./output using 'dotnet publish' for package '{0}'", dockerImage);

// ./output
var outputDirectory = string.Format("{0}/output", outputRootDirectory);
var outputDirectory = System.IO.Path.Combine(outputRootDirectory, "output");
CakeContext.Information("Output directory: '{0}'", outputDirectory);

var msBuildSettings = new DotNetCoreMSBuildSettings();
Expand Down
2 changes: 1 addition & 1 deletion deployment/cake/generic-tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#addin "nuget:?package=Cake.FileHelpers&version=3.0.0"
#addin "nuget:?package=Cake.DependencyCheck&version=1.2.0"

#tool "nuget:?package=DependencyCheck.Runner.Tool&include=./**/dependency-check.sh&include=./**/dependency-check.bat"
#tool "nuget:?package=DependencyCheck.Runner.Tool&version=3.2.1&include=./**/dependency-check.sh&include=./**/dependency-check.bat"
#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.1.3"

//-------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions deployment/cake/generic-variables.cake
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#l "buildserver.cake"

#tool "nuget:?package=GitVersion.CommandLine&version=5.3.5"

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

public class GeneralContext : BuildContextWithItemsBase
{
public GeneralContext(IBuildContext parentBuildContext)
: base(parentBuildContext)
{
SkipComponentsThatAreNotDeployable = true;
}

public string Target { get; set; }
Expand All @@ -21,6 +24,7 @@ public class GeneralContext : BuildContextWithItemsBase
public bool MaximizePerformance { get; set; }
public bool UseVisualStudioPrerelease { get; set; }
public bool VerifyDependencies { get; set; }
public bool SkipComponentsThatAreNotDeployable { get; set; }

public VersionContext Version { get; set; }
public CopyrightContext Copyright { get; set; }
Expand Down Expand Up @@ -77,7 +81,7 @@ public class VersionContext : BuildContextBase

// Make a *BIG* assumption that the solution name == repository name
var repositoryName = generalContext.Solution.Name;
var tempDirectory = $"{System.IO.Path.GetTempPath()}\\{repositoryName}";
var tempDirectory = System.IO.Path.Combine(System.IO.Path.GetTempPath(), repositoryName);

if (CakeContext.DirectoryExists(tempDirectory))
{
Expand Down Expand Up @@ -200,16 +204,11 @@ public class SolutionContext : BuildContextBase
get
{
var directory = System.IO.Directory.GetParent(FileName).FullName;
if (!directory.EndsWith("/") && !directory.EndsWith("\\"))
var separator = System.IO.Path.DirectorySeparatorChar.ToString();

if (!directory.EndsWith(separator))
{
if (directory.Contains("\\"))
{
directory += "\\";
}
else
{
directory += "/";
}
directory += separator;
}

return directory;
Expand Down Expand Up @@ -387,6 +386,7 @@ private GeneralContext InitializeGeneralContext(BuildContext buildContext, IBuil
data.MaximizePerformance = buildContext.BuildServer.GetVariableAsBool("MaximizePerformance", true, showValue: true);
data.UseVisualStudioPrerelease = buildContext.BuildServer.GetVariableAsBool("UseVisualStudioPrerelease", false, showValue: true);
data.VerifyDependencies = !buildContext.BuildServer.GetVariableAsBool("DependencyCheckDisabled", false, showValue: true);
data.SkipComponentsThatAreNotDeployable = buildContext.BuildServer.GetVariableAsBool("SkipComponentsThatAreNotDeployable", true, showValue: true);

// If local, we want full pdb, so do a debug instead
if (data.IsLocalBuild)
Expand Down
Loading

0 comments on commit b7dbcf5

Please sign in to comment.