Skip to content

Commit

Permalink
Created package for Microsoft.Extensions.FileSystemGlobbing
Browse files Browse the repository at this point in the history
Supercedes dnnsoftware#4821
  • Loading branch information
valadas committed Oct 4, 2021
1 parent edbbfc3 commit aedd078
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 5 deletions.
1 change: 1 addition & 0 deletions Build/Tasks/OtherPackages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace DotNetNuke.Build.Tasks
[Dependency(typeof(PackageAspNetWebApi))]
[Dependency(typeof(PackageAspNetWebPages))]
[Dependency(typeof(PackageAspNetMvc))]
[Dependency(typeof(PackageMicrosoftGlobbing))]
public sealed class OtherPackages : FrostingTask<Context>
{
/// <inheritdoc/>
Expand Down
68 changes: 68 additions & 0 deletions Build/Tasks/PackageMicrosoftGlobbing.cs
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>A cake task to generate the ASP.NET MVC package.</summary>
public sealed class PackageMicrosoftGlobbing : FrostingTask<Context>
{
/// <inheritdoc/>
public override void Run(Context context)
{
var binDir = context.WebsiteDir.Path.Combine("bin");
var mainAssemblyPath = binDir.CombineWithFilePath("Microsoft.Extensions.FileSystemGlobbing.dll");
var packageVersion = FileVersionInfo.GetVersionInfo(context.MakeAbsolute(mainAssemblyPath).FullPath).FileVersion;

var packageZip = context.WebsiteDir.Path.CombineWithFilePath($"Install/Library/MicrosoftGlobbing_{packageVersion}_Install.zip");
var packageDir = context.Directory("DNN Platform/Components/Microsoft.Extensions.FileSystemGlobbing");

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<XmlNode>()
.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);
}
}
}
3 changes: 2 additions & 1 deletion Build/Tasks/packaging.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"/bin/Newtonsoft*",
"/bin/SchwabenCode*",
"/bin/System*",
"/bin/WebFormsMvp*"
"/bin/WebFormsMvp*",
"/bin/Microsoft.Extensions.FileSystemGlobbing*"
]
}
8 changes: 7 additions & 1 deletion Build/Tasks/thirdparty.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Telerik",
"folder": "DNN Platform/Components/Telerik/",
"destination": "Install/Module",
"excludes": ["**/*.xml"]
"excludes": [ "**/*.xml" ]
},
{
"name": "jQuery",
Expand Down Expand Up @@ -40,5 +40,11 @@
"folder": "DNN Platform/Components/Microsoft.CodeDom.Providers.DotNetCompilerPlatform/",
"destination": "Install/Library",
"extension": "resources"
},
{
"name": "Telerik",
"folder": "DNN Platform/Components/Microsoft.Extensions.FileSystemGlobbing/",
"destination": "Install/Module",
"excludes": [ "**/*.xml" ]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License (MIT)

Copyright (c) .NET Foundation and Contributors

All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="Microsoft.Extensions.FileSystemGlobbing" type="Library" version="05.00.00" isSystem="true">
<friendlyName>Newtonsoft Json Components</friendlyName>
<description>Provides Newtonsoft Json Components for DotNetNuke.</description>
<dependencies/>
<owner>
<name>DNN</name>
<organization>.NET Foundation</organization>
<url>https://dnncommunity.org</url>
<email>info@dnncommunity.org</email>
</owner>
<license>License.txt</license>
<releaseNotes>
This package includes Microsoft.Extensions.FileSystemGlobbing assembly version 5.0.0.
Please go to https://github.com/dotnet/runtime to view release notes on this particular version.</releaseNotes>
<components>
<component type="Assembly">
<assemblies>
<assembly>
<path>bin</path>
<name>Microsoft.Extensions.FileSystemGlobbing.dll</name>
<version>5.0.0</version>
</assembly>
</assemblies>
</component>
</components>
</package>
</packages>
</dotnetnuke>
4 changes: 2 additions & 2 deletions DNN Platform/Library/DotNetNuke.Library.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.FileSystemGlobbing.3.1.1\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Extensions.FileSystemGlobbing.5.0.0\lib\net461\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.Web.Infrastructure">
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Library/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.Extensions.DependencyInjection" version="2.1.1" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.1.1" targetFramework="net472" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="3.1.1" targetFramework="net472" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="5.0.0" targetFramework="net472" />
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
Expand Down
58 changes: 58 additions & 0 deletions DNN_Platform.sln
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,55 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build\Build.csproj
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dnn.PersonaBar.ConfigConsole.Tests", "Dnn.AdminExperience\Tests\Dnn.PersonaBar.ConfigConsole.Tests\Dnn.PersonaBar.ConfigConsole.Tests.csproj", "{12583A7E-7BEF-4F79-9CEA-3736D28C3241}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components", "{A193D0F9-C722-44BD-B209-2AA2F25C9816}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MailKit", "MailKit", "{88B6C3F7-8E53-4338-A7F9-40EEE18374C0}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\MailKit\License.txt = DNN Platform\Components\MailKit\License.txt
DNN Platform\Components\MailKit\MailKit.dnn = DNN Platform\Components\MailKit\MailKit.dnn
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.AspNetMvc", "Microsoft.AspNetMvc", "{EC500979-80C0-4FD2-9B7E-5EB978D6D69C}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Microsoft.AspNetMvc\License.txt = DNN Platform\Components\Microsoft.AspNetMvc\License.txt
DNN Platform\Components\Microsoft.AspNetMvc\Microsoft.AspNetMvc.dnn = DNN Platform\Components\Microsoft.AspNetMvc\Microsoft.AspNetMvc.dnn
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.AspNetWebApi", "Microsoft.AspNetWebApi", "{4C5DD300-BCDF-44A2-A3DF-EC8D3E0788D2}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Microsoft.AspNetWebApi\License.txt = DNN Platform\Components\Microsoft.AspNetWebApi\License.txt
DNN Platform\Components\Microsoft.AspNetWebApi\Microsoft.AspNetWebApi.dnn = DNN Platform\Components\Microsoft.AspNetWebApi\Microsoft.AspNetWebApi.dnn
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.AspNetWebPages", "Microsoft.AspNetWebPages", "{881A75D6-DA09-4ADD-9B5B-ACAFE8962D3B}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Microsoft.AspNetWebPages\License.txt = DNN Platform\Components\Microsoft.AspNetWebPages\License.txt
DNN Platform\Components\Microsoft.AspNetWebPages\Microsoft.AspNetWebPages.dnn = DNN Platform\Components\Microsoft.AspNetWebPages\Microsoft.AspNetWebPages.dnn
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.CodeDom.Providers.DotNetCompilerPlatform", "Microsoft.CodeDom.Providers.DotNetCompilerPlatform", "{F3E526A3-3420-4B0B-9C31-FD813CCD83F7}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dnn = DNN Platform\Components\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dnn
DNN Platform\Components\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\releaseNotes.txt = DNN Platform\Components\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\releaseNotes.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Newtonsoft", "Newtonsoft", "{CBBA26D2-68FF-4FDB-BD9E-17D4C2CE717F}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Newtonsoft\DotNetNuke.Newtonsoft.Json.dnn = DNN Platform\Components\Newtonsoft\DotNetNuke.Newtonsoft.Json.dnn
DNN Platform\Components\Newtonsoft\License.txt = DNN Platform\Components\Newtonsoft\License.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Telerik", "Telerik", "{6395573E-D778-4DBE-BD22-A39273DBF0C9}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Telerik\DotNetNuke.Telerik.Web.dnn = DNN Platform\Components\Telerik\DotNetNuke.Telerik.Web.dnn
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Extensions.FileSystemGlobbing", "Microsoft.Extensions.FileSystemGlobbing", "{890623E0-F6C8-4011-9FAF-00939601EBE8}"
ProjectSection(SolutionItems) = preProject
DNN Platform\Components\Microsoft.Extensions.FileSystemGlobbing\License.txt = DNN Platform\Components\Microsoft.Extensions.FileSystemGlobbing\License.txt
DNN Platform\Components\Microsoft.Extensions.FileSystemGlobbing\Microsoft.Extensions.FileSystemGlobbing.dnn = DNN Platform\Components\Microsoft.Extensions.FileSystemGlobbing\Microsoft.Extensions.FileSystemGlobbing.dnn
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Cloud_Debug|Any CPU = Cloud_Debug|Any CPU
Expand Down Expand Up @@ -2144,6 +2193,15 @@ Global
{7B43D266-D6E1-4496-A9A1-487AFEE0D9C0} = {9A986091-4238-4804-8C86-6A9A005F72C2}
{22E535CC-385B-44BB-998D-A3C0A144F9E1} = {29273BE6-1AA8-4970-98A0-41BFFEEDA67B}
{12583A7E-7BEF-4F79-9CEA-3736D28C3241} = {8EB4193C-A708-4DA0-9F2A-F5B7599F6F8F}
{A193D0F9-C722-44BD-B209-2AA2F25C9816} = {FBD3B3FB-C9A6-43D2-8FE7-6A0A19DF0D0C}
{88B6C3F7-8E53-4338-A7F9-40EEE18374C0} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{EC500979-80C0-4FD2-9B7E-5EB978D6D69C} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{4C5DD300-BCDF-44A2-A3DF-EC8D3E0788D2} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{881A75D6-DA09-4ADD-9B5B-ACAFE8962D3B} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{F3E526A3-3420-4B0B-9C31-FD813CCD83F7} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{CBBA26D2-68FF-4FDB-BD9E-17D4C2CE717F} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{6395573E-D778-4DBE-BD22-A39273DBF0C9} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
{890623E0-F6C8-4011-9FAF-00939601EBE8} = {A193D0F9-C722-44BD-B209-2AA2F25C9816}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46B6A641-57EB-4B19-B199-23E6FC2AB40B}
Expand Down
4 changes: 4 additions & 0 deletions Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.FileSystemGlobbing" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

0 comments on commit aedd078

Please sign in to comment.