Skip to content

Commit a382b29

Browse files
authored
Merge pull request #6193 from dnnsoftware/release/9.13.5
Merged `release/9.13.5` into `mater` to release `v9.13.5`
2 parents b53b76e + 409529e commit a382b29

File tree

363 files changed

+11776
-9519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+11776
-9519
lines changed

.github/workflows/image-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Create Pull Request
3535
if: | # If it's not a Pull Request then commit any changes as a new PR.
3636
github.event_name != 'pull_request' && steps.compress_images.outputs.markdown != ''
37-
uses: peter-evans/create-pull-request@v6
37+
uses: peter-evans/create-pull-request@v7
3838
with:
3939
title: Auto Compress Images
4040
branch-suffix: timestamp

.github/workflows/updateVersions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: yarn install --mode=update-lockfile --no-immutable
2929

3030
- name: Create Pull Request
31-
uses: peter-evans/create-pull-request@v6
31+
uses: peter-evans/create-pull-request@v7
3232
with:
3333
commit-message: Updates versions as per release candidate creation
3434
title: Updates versions as per release candidate creation

Build/Build.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<PackageReference Include="Cake.FileHelpers" Version="7.0.0" />
1919
<PackageReference Include="Cake.Frosting" Version="4.0.0" />
2020
<PackageReference Include="Cake.Frosting.Git" Version="4.0.0" />
21-
<PackageReference Include="Cake.Issues" Version="4.6.0" />
22-
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="4.6.0" />
21+
<PackageReference Include="Cake.Issues" Version="4.10.1" />
22+
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="4.10.1" />
2323
<PackageReference Include="Cake.Json" Version="7.0.1" />
2424
<PackageReference Include="Cake.XdtTransform" Version="2.0.0" />
2525
<PackageReference Include="Dnn.CakeUtils" Version="2.0.2" />

Build/ContextExtensions.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace DotNetNuke.Build;
6+
7+
using System.Diagnostics;
8+
using Cake.Common.IO;
9+
using Cake.Core.IO;
10+
11+
/// <summary>Provides extensions to <see cref="Context"/>.</summary>
12+
public static class ContextExtensions
13+
{
14+
/// <summary>Gets the <see cref="FileVersionInfo.FileVersion"/> for an assembly.</summary>
15+
/// <param name="context">The cake context.</param>
16+
/// <param name="assemblyPath">The path to the assembly file.</param>
17+
/// <returns>The file version.</returns>
18+
public static string GetAssemblyFileVersion(this Context context, FilePath assemblyPath)
19+
{
20+
return FileVersionInfo.GetVersionInfo(context.MakeAbsolute(assemblyPath).FullPath).FileVersion;
21+
}
22+
}

Build/Tasks/PackageAspNetMvc.cs

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information
4-
namespace DotNetNuke.Build.Tasks
5-
{
6-
using System;
7-
using System.Diagnostics;
8-
using System.Linq;
9-
using System.Xml;
10-
11-
using Cake.Common.Diagnostics;
12-
using Cake.Common.IO;
13-
using Cake.Frosting;
14-
using Dnn.CakeUtils;
4+
namespace DotNetNuke.Build.Tasks;
155

16-
/// <summary>A cake task to generate the ASP.NET MVC package.</summary>
17-
public sealed class PackageAspNetMvc : FrostingTask<Context>
6+
/// <summary>A cake task to generate the ASP.NET MVC package.</summary>
7+
public sealed class PackageAspNetMvc : PackageComponentTask
8+
{
9+
/// <summary>Initializes a new instance of the <see cref="PackageAspNetMvc"/> class.</summary>
10+
public PackageAspNetMvc()
11+
: base("AspNetMvc", "System.Web.Mvc.dll", "Microsoft.AspNetMvc")
1812
{
19-
/// <inheritdoc/>
20-
public override void Run(Context context)
21-
{
22-
var binDir = context.WebsiteDir.Path.Combine("bin");
23-
var mainAssemblyPath = binDir.CombineWithFilePath("System.Web.Mvc.dll");
24-
var packageVersion = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(mainAssemblyPath).FullPath).FileVersion;
25-
26-
var packageZip = context.WebsiteDir.Path.CombineWithFilePath($"Install/Library/AspNetMvc_{packageVersion}_Install.zip");
27-
var packageDir = context.Directory("DNN Platform/Components/Microsoft.AspNetMvc");
28-
29-
context.Information($"Creating {packageZip}");
30-
context.Zip(
31-
packageDir.ToString(),
32-
packageZip,
33-
context.GetFilesByPatterns(packageDir, new[] { "*" }, new[] { "*.dnn" }));
34-
35-
var manifestPath = context.GetFiles(packageDir.Path.CombineWithFilePath("*.dnn").ToString()).Single();
36-
context.Information($"Reading manifest from {manifestPath}");
37-
var manifest = new XmlDocument();
38-
manifest.LoadXml(context.ReadFile(manifestPath));
39-
var assemblies =
40-
from XmlNode assemblyNode in manifest.SelectNodes("//assembly")
41-
from XmlNode childNode in assemblyNode.ChildNodes
42-
where childNode.LocalName.Equals("name")
43-
select childNode;
44-
45-
foreach (var assemblyNameNode in assemblies)
46-
{
47-
var assemblyPath = binDir.CombineWithFilePath(assemblyNameNode.InnerText);
48-
context.Information($"Adding {assemblyPath} to {packageZip}");
49-
context.AddFilesToZip(
50-
packageZip,
51-
context.MakeAbsolute(context.WebsiteDir.Path),
52-
context.GetFiles(assemblyPath.ToString()),
53-
append: true);
54-
55-
var versionNode = assemblyNameNode.ParentNode.ChildNodes.Cast<XmlNode>()
56-
.SingleOrDefault(childNode => childNode.LocalName.Equals("version"));
57-
if (versionNode != null)
58-
{
59-
versionNode.InnerText = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(assemblyPath).FullPath).FileVersion;
60-
context.Information($"Set {assemblyPath} version to {versionNode.InnerText}");
61-
}
62-
}
63-
64-
manifest.SelectSingleNode("//package[@version]").Attributes["version"].Value = packageVersion;
65-
66-
context.AddXmlFileToZip(packageZip, manifest, manifestPath.GetFilename().ToString(), append: true);
67-
}
6813
}
6914
}

Build/Tasks/PackageAspNetWebApi.cs

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information
4-
namespace DotNetNuke.Build.Tasks
5-
{
6-
using System;
7-
using System.Diagnostics;
8-
using System.Linq;
9-
using System.Xml;
10-
11-
using Cake.Common.Diagnostics;
12-
using Cake.Common.IO;
13-
using Cake.Frosting;
14-
using Dnn.CakeUtils;
4+
namespace DotNetNuke.Build.Tasks;
155

16-
/// <summary>A cake task to generate the ASP.NET Web API package.</summary>
17-
public sealed class PackageAspNetWebApi : FrostingTask<Context>
6+
/// <summary>A cake task to generate the ASP.NET Web API package.</summary>
7+
public sealed class PackageAspNetWebApi : PackageComponentTask
8+
{
9+
/// <summary>Initializes a new instance of the <see cref="PackageAspNetWebApi"/> class.</summary>
10+
public PackageAspNetWebApi()
11+
: base("AspNetWebApi", "System.Web.Http.dll", "Microsoft.AspNetWebApi")
1812
{
19-
/// <inheritdoc/>
20-
public override void Run(Context context)
21-
{
22-
var binDir = context.WebsiteDir.Path.Combine("bin");
23-
var mainAssemblyPath = binDir.CombineWithFilePath("System.Web.Http.dll");
24-
var packageVersion = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(mainAssemblyPath).FullPath).FileVersion;
25-
26-
var packageZip = context.WebsiteDir.Path.CombineWithFilePath($"Install/Library/AspNetWebApi_{packageVersion}_Install.zip");
27-
var packageDir = context.Directory("DNN Platform/Components/Microsoft.AspNetWebApi");
28-
29-
context.Information($"Creating {packageZip}");
30-
context.Zip(
31-
packageDir.ToString(),
32-
packageZip,
33-
context.GetFilesByPatterns(packageDir, new[] { "*" }, new[] { "*.dnn" }));
34-
35-
var manifestPath = context.GetFiles(packageDir.Path.CombineWithFilePath("*.dnn").ToString()).Single();
36-
context.Information($"Reading manifest from {manifestPath}");
37-
var manifest = new XmlDocument();
38-
manifest.LoadXml(context.ReadFile(manifestPath));
39-
var assemblies =
40-
from XmlNode assemblyNode in manifest.SelectNodes("//assembly")
41-
from XmlNode childNode in assemblyNode.ChildNodes
42-
where childNode.LocalName.Equals("name")
43-
select childNode;
44-
45-
foreach (var assemblyNameNode in assemblies)
46-
{
47-
var assemblyPath = binDir.CombineWithFilePath(assemblyNameNode.InnerText);
48-
context.Information($"Adding {assemblyPath} to {packageZip}");
49-
context.AddFilesToZip(
50-
packageZip,
51-
context.MakeAbsolute(context.WebsiteDir.Path),
52-
context.GetFiles(assemblyPath.ToString()),
53-
append: true);
54-
55-
var versionNode = assemblyNameNode.ParentNode.ChildNodes.Cast<XmlNode>()
56-
.SingleOrDefault(childNode => childNode.LocalName.Equals("version"));
57-
if (versionNode != null)
58-
{
59-
versionNode.InnerText = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(assemblyPath).FullPath).FileVersion;
60-
context.Information($"Set {assemblyPath} version to {versionNode.InnerText}");
61-
}
62-
}
63-
64-
manifest.SelectSingleNode("//package[@version]").Attributes["version"].Value = packageVersion;
65-
66-
context.AddXmlFileToZip(packageZip, manifest, manifestPath.GetFilename().ToString(), append: true);
67-
}
6813
}
6914
}

Build/Tasks/PackageAspNetWebPages.cs

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information
4-
namespace DotNetNuke.Build.Tasks
5-
{
6-
using System;
7-
using System.Diagnostics;
8-
using System.Linq;
9-
using System.Xml;
10-
11-
using Cake.Common.Diagnostics;
12-
using Cake.Common.IO;
13-
using Cake.Frosting;
14-
using Dnn.CakeUtils;
4+
namespace DotNetNuke.Build.Tasks;
155

16-
/// <summary>A cake task to generate the ASP.NET Web Pages package.</summary>
17-
public sealed class PackageAspNetWebPages : FrostingTask<Context>
6+
/// <summary>A cake task to generate the ASP.NET Web Pages package.</summary>
7+
public sealed class PackageAspNetWebPages : PackageComponentTask
8+
{
9+
/// <summary>Initializes a new instance of the <see cref="PackageAspNetWebPages"/> class.</summary>
10+
public PackageAspNetWebPages()
11+
: base("AspNetWebPages", "System.Web.WebPages.dll", "Microsoft.AspNetWebPages")
1812
{
19-
/// <inheritdoc/>
20-
public override void Run(Context context)
21-
{
22-
var binDir = context.WebsiteDir.Path.Combine("bin");
23-
var mainAssemblyPath = binDir.CombineWithFilePath("System.Web.WebPages.dll");
24-
var packageVersion = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(mainAssemblyPath).FullPath).FileVersion;
25-
26-
var packageZip = context.WebsiteDir.Path.CombineWithFilePath($"Install/Library/AspNetWebPages_{packageVersion}_Install.zip");
27-
var packageDir = context.Directory("DNN Platform/Components/Microsoft.AspNetWebPages");
28-
29-
context.Information($"Creating {packageZip}");
30-
context.Zip(
31-
packageDir.ToString(),
32-
packageZip,
33-
context.GetFilesByPatterns(packageDir, new[] { "*" }, new[] { "*.dnn" }));
34-
35-
var manifestPath = context.GetFiles(packageDir.Path.CombineWithFilePath("*.dnn").ToString()).Single();
36-
context.Information($"Reading manifest from {manifestPath}");
37-
var manifest = new XmlDocument();
38-
manifest.LoadXml(context.ReadFile(manifestPath));
39-
var assemblies =
40-
from XmlNode assemblyNode in manifest.SelectNodes("//assembly")
41-
from XmlNode childNode in assemblyNode.ChildNodes
42-
where childNode.LocalName.Equals("name")
43-
select childNode;
44-
45-
foreach (var assemblyNameNode in assemblies)
46-
{
47-
var assemblyPath = binDir.CombineWithFilePath(assemblyNameNode.InnerText);
48-
context.Information($"Adding {assemblyPath} to {packageZip}");
49-
context.AddFilesToZip(
50-
packageZip,
51-
context.MakeAbsolute(context.WebsiteDir.Path),
52-
context.GetFiles(assemblyPath.ToString()),
53-
append: true);
54-
55-
var versionNode = assemblyNameNode.ParentNode.ChildNodes.Cast<XmlNode>()
56-
.SingleOrDefault(childNode => childNode.LocalName.Equals("version"));
57-
if (versionNode != null)
58-
{
59-
versionNode.InnerText = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(assemblyPath).FullPath).FileVersion;
60-
context.Information($"Set {assemblyPath} version to {versionNode.InnerText}");
61-
}
62-
}
63-
64-
manifest.SelectSingleNode("//package[@version]").Attributes["version"].Value = packageVersion;
65-
66-
context.AddXmlFileToZip(packageZip, manifest, manifestPath.GetFilename().ToString(), append: true);
67-
}
6813
}
6914
}

Build/Tasks/PackageComponentTask.cs

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information
4+
5+
namespace DotNetNuke.Build.Tasks;
6+
7+
using System.Linq;
8+
using System.Xml;
9+
using Cake.Common.Diagnostics;
10+
using Cake.Common.IO;
11+
using Cake.Core.IO;
12+
using Cake.Frosting;
13+
using Dnn.CakeUtils;
14+
15+
/// <summary>Provides the base functionality for packaging a folder inside Components.</summary>
16+
public abstract class PackageComponentTask : FrostingTask<Context>
17+
{
18+
/// <summary>Initializes a new instance of the <see cref="PackageComponentTask"/> class.</summary>
19+
/// <param name="componentName">The name of the component.</param>
20+
/// <param name="primaryAssemblyName">The name of the primary assembly.</param>
21+
/// <param name="componentFolderName">The name of the folder in <c>DNN Platform/Components/</c>.</param>
22+
protected PackageComponentTask(string componentName, FilePath primaryAssemblyName = null, DirectoryPath componentFolderName = null)
23+
{
24+
this.ComponentName = componentName;
25+
this.ComponentFolderName = componentFolderName ?? componentName;
26+
this.PrimaryAssemblyName = primaryAssemblyName ?? $"{componentName}.dll";
27+
}
28+
29+
/// <summary>Gets the name of the component.</summary>
30+
public string ComponentName { get; }
31+
32+
/// <summary>Gets the name of the folder in <c>DNN Platform/Components/</c> where the component files are.</summary>
33+
public DirectoryPath ComponentFolderName { get; }
34+
35+
/// <summary>Gets the name of the primary assembly.</summary>
36+
public FilePath PrimaryAssemblyName { get; }
37+
38+
/// <inheritdoc />
39+
public override void Run(Context context)
40+
{
41+
var binDir = context.WebsiteDir.Path.Combine("bin");
42+
var mainAssemblyPath = binDir.CombineWithFilePath(this.PrimaryAssemblyName);
43+
var packageVersion = context.GetAssemblyFileVersion(mainAssemblyPath);
44+
45+
var packageZip = context.WebsiteDir.Path.CombineWithFilePath($"Install/Library/{this.ComponentName}_{packageVersion}_Install.zip");
46+
var packageDir = context.Directory($"DNN Platform/Components/{this.ComponentFolderName}");
47+
48+
context.Information($"Creating {packageZip}");
49+
context.Zip(
50+
packageDir.ToString(),
51+
packageZip,
52+
context.GetFilesByPatterns(packageDir, new[] { "*" }, new[] { "*.dnn" }));
53+
54+
var manifestPath = context.GetFiles(packageDir.Path.CombineWithFilePath("*.dnn").ToString()).Single();
55+
context.Information($"Reading manifest from {manifestPath}");
56+
var manifest = new XmlDocument();
57+
manifest.LoadXml(context.ReadFile(manifestPath));
58+
var assemblies =
59+
from XmlNode assemblyNode in manifest.SelectNodes("//assembly")
60+
from XmlNode childNode in assemblyNode.ChildNodes
61+
where childNode.LocalName.Equals("name")
62+
select childNode;
63+
64+
foreach (var assemblyNameNode in assemblies)
65+
{
66+
var assemblyPath = binDir.CombineWithFilePath(assemblyNameNode.InnerText);
67+
context.Information($"Adding {assemblyPath} to {packageZip}");
68+
context.AddFilesToZip(
69+
packageZip,
70+
context.MakeAbsolute(context.WebsiteDir.Path),
71+
context.GetFiles(assemblyPath.ToString()),
72+
append: true);
73+
74+
var versionNode = assemblyNameNode.ParentNode?.ChildNodes.Cast<XmlNode>()
75+
.SingleOrDefault(childNode => childNode.LocalName.Equals("version"));
76+
if (versionNode != null)
77+
{
78+
versionNode.InnerText = context.GetAssemblyFileVersion(assemblyPath);
79+
context.Information($"Set {assemblyPath} version to {versionNode.InnerText}");
80+
}
81+
}
82+
83+
manifest.SelectSingleNode("//package[@version]").Attributes["version"].Value = packageVersion;
84+
85+
context.AddXmlFileToZip(packageZip, manifest, manifestPath.GetFilename().ToString(), append: true);
86+
}
87+
}

0 commit comments

Comments
 (0)