diff --git a/Build/Tasks/Build.cs b/Build/Tasks/Build.cs index eb8d995e687..e9d3852f7ef 100644 --- a/Build/Tasks/Build.cs +++ b/Build/Tasks/Build.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information namespace DotNetNuke.Build.Tasks { + using System; using System.Collections.Generic; using Cake.Common.Build; @@ -13,7 +14,6 @@ namespace DotNetNuke.Build.Tasks using Cake.Frosting; using Cake.Issues; using Cake.Issues.MsBuild; - using DotNetNuke.Build; /// A cake task to compile the platform. @@ -55,13 +55,20 @@ public override void Run(Context context) foreach (var issue in issues) { - context.AzurePipelines() - .Commands.WriteWarning( - issue.MessageText, - new AzurePipelinesMessageData - { - SourcePath = issue.AffectedFileRelativePath?.FullPath, LineNumber = issue.Line, - }); + var messageData = new AzurePipelinesMessageData + { + SourcePath = issue.AffectedFileRelativePath?.FullPath, + LineNumber = issue.Line, + }; + + if (string.Equals(issue.PriorityName, "Error", StringComparison.Ordinal)) + { + context.AzurePipelines().Commands.WriteError(issue.MessageText, messageData); + } + else + { + context.AzurePipelines().Commands.WriteWarning(issue.MessageText, messageData); + } } } } diff --git a/Build/Tasks/OtherPackages.cs b/Build/Tasks/OtherPackages.cs index 1bbd876abc6..9657b5609c5 100644 --- a/Build/Tasks/OtherPackages.cs +++ b/Build/Tasks/OtherPackages.cs @@ -22,6 +22,7 @@ namespace DotNetNuke.Build.Tasks [IsDependentOn(typeof(PackageAspNetWebPages))] [IsDependentOn(typeof(PackageAspNetMvc))] [IsDependentOn(typeof(PackageMicrosoftGlobbing))] + [IsDependentOn(typeof(PackageWebFormsMvp))] public sealed class OtherPackages : FrostingTask { /// diff --git a/Build/Tasks/PackageWebFormsMvp.cs b/Build/Tasks/PackageWebFormsMvp.cs new file mode 100644 index 00000000000..4e4af65e70e --- /dev/null +++ b/Build/Tasks/PackageWebFormsMvp.cs @@ -0,0 +1,68 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information +namespace DotNetNuke.Build.Tasks +{ + using System.Diagnostics; + using System.Linq; + using System.Xml; + + using Cake.Common.Diagnostics; + using Cake.Common.IO; + using Cake.Frosting; + using Dnn.CakeUtils; + + /// A cake task to generate the WebFormsMvp package. + public sealed class PackageWebFormsMvp : FrostingTask + { + /// + public override void Run(Context context) + { + var binDir = context.WebsiteDir.Path.Combine("bin"); + var mainAssemblyPath = binDir.CombineWithFilePath("WebFormsMvp.dll"); + var packageVersion = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(mainAssemblyPath).FullPath).FileVersion; + + var packageZip = context.WebsiteDir.Path.CombineWithFilePath($"Install/Library/WebFormsMvp_{packageVersion}_Install.zip"); + var packageDir = context.Directory("DNN Platform/Components/WebFormsMvp"); + + context.Information($"Creating {packageZip}"); + context.Zip( + packageDir.ToString(), + packageZip, + context.GetFilesByPatterns(packageDir, new[] { "*" }, new[] { "*.dnn" })); + + var manifestPath = context.GetFiles(packageDir.Path.CombineWithFilePath("*.dnn").ToString()).Single(); + context.Information($"Reading manifest from {manifestPath}"); + var manifest = new XmlDocument(); + manifest.LoadXml(context.ReadFile(manifestPath)); + var assemblies = + from XmlNode assemblyNode in manifest.SelectNodes("//assembly") + from XmlNode childNode in assemblyNode.ChildNodes + where childNode.LocalName.Equals("name") + select childNode; + + foreach (var assemblyNameNode in assemblies) + { + var assemblyPath = binDir.CombineWithFilePath(assemblyNameNode.InnerText); + context.Information($"Adding {assemblyPath} to {packageZip}"); + context.AddFilesToZip( + packageZip, + context.MakeAbsolute(context.WebsiteDir.Path), + context.GetFiles(assemblyPath.ToString()), + append: true); + + var versionNode = assemblyNameNode.ParentNode.ChildNodes.Cast() + .SingleOrDefault(childNode => childNode.LocalName.Equals("version")); + if (versionNode != null) + { + versionNode.InnerText = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(assemblyPath).FullPath).FileVersion; + context.Information($"Set {assemblyPath} version to {versionNode.InnerText}"); + } + } + + manifest.SelectSingleNode("//package[@version]").Attributes["version"].Value = packageVersion; + + context.AddXmlFileToZip(packageZip, manifest, manifestPath.GetFilename().ToString(), append: true); + } + } +} diff --git a/DNN Platform/Components/WebFormsMvp/License.txt b/DNN Platform/Components/WebFormsMvp/License.txt new file mode 100644 index 00000000000..3913a7f9f67 --- /dev/null +++ b/DNN Platform/Components/WebFormsMvp/License.txt @@ -0,0 +1,36 @@ +Copyright (c) 2009, The Outercurve Foundation. The software is licensed under the (the "License"); you may not use the software except in compliance with the License. + +The text of the Ms-PL License 2.0 can be found online at: +http://www.opensource.org/licenses/ms-pl + +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + +A "contribution" is the original software, or any additions or changes to the software. + +A "contributor" is any person that distributes its contribution under this license. + +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/DNN Platform/Components/WebFormsMvp/WebFormsMvp.dnn b/DNN Platform/Components/WebFormsMvp/WebFormsMvp.dnn new file mode 100644 index 00000000000..0bbab720d87 --- /dev/null +++ b/DNN Platform/Components/WebFormsMvp/WebFormsMvp.dnn @@ -0,0 +1,28 @@ + + + + WebFormsMvp + Library for module development using MVP pattern. + + + DNN + .NET Foundation + https://dnncommunity.org + info@dnncommunity.org + + + https://github.com/webformsmvp/webformsmvp/releases + + + + + bin + WebFormsMvp.dll + 1.4.5 + + + + + + + diff --git a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj index 39bac822c1d..a2109288838 100644 --- a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj +++ b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj @@ -160,8 +160,9 @@ True - - ..\..\Packages\WebFormsMVP.1.4.1.0\lib\WebFormsMvp.dll + + ..\..\packages\WebFormsMvp.1.4.5.0\lib\WebFormsMvp.dll + True diff --git a/DNN Platform/DotNetNuke.Web/packages.config b/DNN Platform/DotNetNuke.Web/packages.config index caa6d460e5f..efc4fce9256 100644 --- a/DNN Platform/DotNetNuke.Web/packages.config +++ b/DNN Platform/DotNetNuke.Web/packages.config @@ -1,5 +1,6 @@  + @@ -15,5 +16,4 @@ - \ No newline at end of file diff --git a/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj b/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj index d30eaea91b5..ba87026236f 100644 --- a/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj +++ b/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj @@ -83,8 +83,9 @@ - - ..\..\..\packages\WebFormsMVP.1.4.1.0\lib\WebFormsMvp.dll + + ..\..\..\packages\WebFormsMvp.1.4.5.0\lib\WebFormsMvp.dll + True diff --git a/DNN Platform/Modules/HtmlEditorManager/packages.config b/DNN Platform/Modules/HtmlEditorManager/packages.config index 537d21b6b33..864dc3654db 100644 --- a/DNN Platform/Modules/HtmlEditorManager/packages.config +++ b/DNN Platform/Modules/HtmlEditorManager/packages.config @@ -1,5 +1,5 @@  + - \ No newline at end of file diff --git a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj index 9e0f0ec724e..06e28ddcea9 100644 --- a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj +++ b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj @@ -91,8 +91,9 @@ - - ..\..\..\packages\WebFormsMVP.1.4.1.0\lib\WebFormsMvp.dll + + ..\..\..\packages\WebFormsMvp.1.4.5.0\lib\WebFormsMvp.dll + True diff --git a/DNN Platform/Modules/MemberDirectory/packages.config b/DNN Platform/Modules/MemberDirectory/packages.config index 1b8f6b182b1..09fe647b4ff 100644 --- a/DNN Platform/Modules/MemberDirectory/packages.config +++ b/DNN Platform/Modules/MemberDirectory/packages.config @@ -1,10 +1,10 @@  + - \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj index 5fbe3e8c76e..174ae0c7a54 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj @@ -85,8 +85,9 @@ - - ..\..\..\packages\WebFormsMVP.1.4.1.0\lib\WebFormsMvp.dll + + ..\..\..\packages\WebFormsMvp.1.4.5.0\lib\WebFormsMvp.dll + True diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config index 0f0124a87a7..868871f0e2e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config @@ -1,5 +1,6 @@  + @@ -11,5 +12,4 @@ - \ No newline at end of file