-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Lombiq/issue/NEST-339
NEST-339: Feature to make build number visible after deployment
- Loading branch information
Showing
20 changed files
with
358 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ wwwroot/ | |
node_modules/ | ||
*.user | ||
.pnpm-debug.log | ||
.editorconfig | ||
|
||
# Mac | ||
.DS_Store | ||
|
39 changes: 39 additions & 0 deletions
39
Lombiq.Hosting.BuildVersionDisplay.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Atata; | ||
using Lombiq.Tests.UI.Extensions; | ||
using Lombiq.Tests.UI.Services; | ||
using OpenQA.Selenium; | ||
using Shouldly; | ||
using System.Threading.Tasks; | ||
|
||
namespace Lombiq.Hosting.BuildVersionDisplay.Tests.UI.Extensions; | ||
|
||
public static class TestCaseUITestContextExtensions | ||
{ | ||
/// <summary> | ||
/// Tests the Lombiq Hosting - Build Version Display for Orchard Core feature. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para> | ||
/// <paramref name="checkBuildLink"/> defaults to false since the build link won't be displayed when the tests are | ||
/// run from a published UI test project (it displays properly when run from source). This is because the UI test | ||
/// project doesn't (shouldn't) reference the module project/package directly and thus won't use its targets file | ||
/// either, breaking the BuildVersionDisplay_BuildUrl property. This is not an error, the link is still displayed | ||
/// when the web app is run directly. | ||
/// </para> | ||
/// </remarks> | ||
public static async Task TestBuildVersionDisplayAsync(this UITestContext context, bool checkBuildLink = false) | ||
{ | ||
await context.SignInDirectlyAndGoToDashboardAsync(); | ||
|
||
var container = context.Get(By.Id("lombiq-hosting-build-version-display-build-version")); | ||
var listItems = container.GetAll(By.TagName("li")); | ||
|
||
var orchardVersion = typeof(OrchardCore.IOrchardHelper).Assembly.GetName().Version.ToString(); | ||
listItems.ShouldContain(element => element.Text == "Orchard Core version: " + orchardVersion); | ||
listItems.ShouldContain(element => element.Text.Contains("App build version")); | ||
if (checkBuildLink) | ||
{ | ||
listItems.ShouldContain(element => element.Text.Contains("Build link")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright © 2023, [Lombiq Technologies Ltd.](https://lombiq.com) | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
40 changes: 40 additions & 0 deletions
40
...q.Hosting.BuildVersionDisplay.Tests.UI/Lombiq.Hosting.BuildVersionDisplay.Tests.UI.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Title>Lombiq Hosting - Build Version Display for Orchard Core - UI Test Extensions</Title> | ||
<Authors>Lombiq Technologies</Authors> | ||
<Copyright>Copyright © 2023, Lombiq Technologies Ltd.</Copyright> | ||
<Description>Lombiq Hosting - Build Version Display for Orchard Core - UI Test Extensions: Extension methods that test various features in Lombiq Hosting - Build Version Display for Orchard Core.</Description> | ||
<PackageIcon>NuGetIcon.png</PackageIcon> | ||
<PackageTags>OrchardCore;Lombiq;AspNetCore;CodeGeneration;ShapeTracing;Widgets</PackageTags> | ||
<RepositoryUrl>https://github.com/Lombiq/Hosting-Build-Version-Display</RepositoryUrl> | ||
<PackageProjectUrl> | ||
https://github.com/Lombiq/Hosting-Build-Version-Display/tree/dev/Lombiq.Hosting.BuildVersionDisplay.Tests.UI</PackageProjectUrl> | ||
<PackageLicenseFile>License.md</PackageLicenseFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="License.md" Pack="true" PackagePath="" /> | ||
<None Include="Readme.md" /> | ||
<None Include="NuGetIcon.png" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="node_modules\**" /> | ||
<None Remove="Tests\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(NuGetBuild)' != 'true'"> | ||
<ProjectReference Include="..\..\..\..\test\Lombiq.UITestingToolbox\Lombiq.Tests.UI\Lombiq.Tests.UI.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(NuGetBuild)' == 'true'"> | ||
<PackageReference Include="Lombiq.Tests.UI" Version="5.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Lombiq Hosting - Build Version Display for Orchard Core - UI Test Extensions | ||
|
||
## About | ||
|
||
Extension methods that test various features in Lombiq Hosting - Build Version Display for Orchard Core, with the help of [Lombiq UI Testing Toolbox for Orchard Core](https://github.com/Lombiq/UI-Testing-Toolbox). | ||
|
||
Call these from a UI test project to verify the module's basic features; as seen in [Open-Source Orchard Core Extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.32126.317 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Hosting.BuildVersionDisplay", "Lombiq.Hosting.BuildVersionDisplay\Lombiq.Hosting.BuildVersionDisplay.csproj", "{5843E46D-03E5-4B44-9731-72AC32A0FCAC}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Hosting.BuildVersionDisplay.Tests.UI", "Lombiq.Hosting.BuildVersionDisplay.Tests.UI\Lombiq.Hosting.BuildVersionDisplay.Tests.UI.csproj", "{C2687772-E673-45F3-BA74-50A3DB739124}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{5843E46D-03E5-4B44-9731-72AC32A0FCAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{5843E46D-03E5-4B44-9731-72AC32A0FCAC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{5843E46D-03E5-4B44-9731-72AC32A0FCAC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{5843E46D-03E5-4B44-9731-72AC32A0FCAC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{C2687772-E673-45F3-BA74-50A3DB739124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C2687772-E673-45F3-BA74-50A3DB739124}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C2687772-E673-45F3-BA74-50A3DB739124}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C2687772-E673-45F3-BA74-50A3DB739124}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {90B82673-1604-4EEE-B74E-11AE2B4AD8D3} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Lombiq.Hosting.BuildVersionDisplay; | ||
|
||
[AttributeUsage(AttributeTargets.Assembly)] | ||
public sealed class BuildUrlAttribute : Attribute | ||
{ | ||
public string? Url { get; } | ||
|
||
public BuildUrlAttribute(string? url) => Url = url; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions
42
Lombiq.Hosting.BuildVersionDisplay/Filters/BuildVersionDisplayInjectingFilter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Microsoft.AspNetCore.Mvc.Filters; | ||
using Microsoft.Extensions.Options; | ||
using OrchardCore.Admin; | ||
using OrchardCore.DisplayManagement; | ||
using OrchardCore.DisplayManagement.Layout; | ||
|
||
namespace Lombiq.Hosting.BuildVersionDisplay.Filters; | ||
|
||
internal class BuildVersionDisplayInjectingFilter : IAsyncResultFilter | ||
{ | ||
private readonly ILayoutAccessor _layoutAccessor; | ||
private readonly IShapeFactory _shapeFactory; | ||
private readonly IOptions<AdminOptions> _adminOptions; | ||
|
||
public BuildVersionDisplayInjectingFilter( | ||
ILayoutAccessor layoutAccessor, | ||
IShapeFactory shapeFactory, | ||
IOptions<AdminOptions> adminOptions) | ||
{ | ||
_layoutAccessor = layoutAccessor; | ||
_shapeFactory = shapeFactory; | ||
_adminOptions = adminOptions; | ||
} | ||
|
||
public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) | ||
{ | ||
if (context.IsNotFullViewRendering() || | ||
!context.IsAdmin() || | ||
!context.HttpContext.Request.Path.ToString().TrimEnd('/').EqualsOrdinalIgnoreCase("/" + _adminOptions.Value.AdminUrlPrefix)) | ||
{ | ||
await next(); | ||
|
||
return; | ||
} | ||
|
||
var layout = await _layoutAccessor.GetLayoutAsync(); | ||
var zone = layout.Zones["Content"]; | ||
await zone.AddAsync(await _shapeFactory.CreateAsync("BuildVersion"), ":after"); | ||
|
||
await next(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright © 2023, [Lombiq Technologies Ltd.](https://lombiq.com) | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
61 changes: 61 additions & 0 deletions
61
Lombiq.Hosting.BuildVersionDisplay/Lombiq.Hosting.BuildVersionDisplay.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Title>Lombiq Hosting - Build Version Display for Orchard Core</Title> | ||
<Authors>Lombiq Technologies</Authors> | ||
<Copyright>Copyright © 2023, Lombiq Technologies Ltd.</Copyright> | ||
<Description>Lombiq Hosting - Build Version Display for Orchard Core: Orchard Core module to display the build version (i.e. .NET assembly version or other) on the admin of the Default tenant. See the project website for detailed documentation.</Description> | ||
<PackageIcon>NuGetIcon.png</PackageIcon> | ||
<PackageTags>OrchardCore;Lombiq;AspNetCore;Hosting;</PackageTags> | ||
<RepositoryUrl>https://github.com/Lombiq/Hosting-Build-Version-Display</RepositoryUrl> | ||
<PackageProjectUrl>https://github.com/Lombiq/Hosting-Build-Version-Display</PackageProjectUrl> | ||
<PackageLicenseFile>License.md</PackageLicenseFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="License.md" Pack="true" PackagePath="" /> | ||
<None Include="NuGetIcon.png" Pack="true" PackagePath="" /> | ||
<!-- If this is not explicitly specified then OrchardCore.Module.Targets will take over the build folder and it | ||
won't be included. --> | ||
<None Include="build\Lombiq.Hosting.BuildVersionDisplay.targets" Pack="true" PackagePath="build\Lombiq.Hosting.BuildVersionDisplay.targets" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="OrchardCore.Module.Targets" Version="1.5.0" /> | ||
<PackageReference Include="OrchardCore.DisplayManagement" Version="1.5.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\Readme.md" Link="Readme.md" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="node_modules\**" /> | ||
<None Remove="Tests\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(NuGetBuild)' != 'true'"> | ||
<ProjectReference Include="..\..\..\Libraries\Lombiq.HelpfulLibraries\Lombiq.HelpfulLibraries.OrchardCore\Lombiq.HelpfulLibraries.OrchardCore.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(NuGetBuild)' == 'true'"> | ||
<PackageReference Include="Lombiq.HelpfulLibraries.OrchardCore" Version="5.0.0" /> | ||
</ItemGroup> | ||
|
||
<!-- The targets file will be automatically imported when using the project from NuGet but needs an explicit import | ||
when used from source. --> | ||
<Import Project="build/Lombiq.Hosting.BuildVersionDisplay.targets" Condition="'$(NuGetBuild)' != 'true'" /> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using OrchardCore.Modules.Manifest; | ||
|
||
[assembly: Module( | ||
Name = "Lombiq Hosting - Build Version Display", | ||
Author = "Lombiq Technologies", | ||
Website = "https://github.com/Lombiq/Hosting-Build-Version-Display", | ||
Version = "0.0.1", | ||
Description = "Displays the build version (i.e. .NET assembly version or other) on the admin.", | ||
Category = "Hosting", | ||
DefaultTenantOnly = true | ||
)] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Lombiq.Hosting.BuildVersionDisplay.Filters; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using OrchardCore.Modules; | ||
|
||
namespace Lombiq.Hosting.BuildVersionDisplay; | ||
|
||
public class Startup : StartupBase | ||
{ | ||
public override void ConfigureServices(IServiceCollection services) => | ||
services.Configure<MvcOptions>((options) => options.Filters.Add(typeof(BuildVersionDisplayInjectingFilter))); | ||
} |
40 changes: 40 additions & 0 deletions
40
Lombiq.Hosting.BuildVersionDisplay/Views/BuildVersion.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@using System.Reflection; | ||
@using Lombiq.Hosting.BuildVersionDisplay; | ||
|
||
@{ | ||
var webAppAssembly = Assembly.GetEntryAssembly(); | ||
|
||
// These can't be null as long as the code actually compiles. | ||
#pragma warning disable CS8602 // Dereference of a possibly null reference. | ||
var orchardVersion = typeof(OrchardCore.IOrchardHelper).Assembly.GetName().Version.ToString(); | ||
var buildVersion = webAppAssembly.GetName().Version.ToString(); | ||
#pragma warning restore CS8602 // Dereference of a possibly null reference. | ||
// When using the module from from NuGet the web app's binaries will contain the attribute, when using it from | ||
// source, the module's. | ||
var webAppAttribute = webAppAssembly.GetCustomAttribute<BuildUrlAttribute>(); | ||
var buildUrl = webAppAttribute?.Url; | ||
if (string.IsNullOrEmpty(buildUrl)) | ||
{ | ||
var moduleAttribute = Assembly.GetExecutingAssembly().GetCustomAttribute<BuildUrlAttribute>(); | ||
buildUrl = moduleAttribute?.Url; | ||
} | ||
} | ||
|
||
<div id="lombiq-hosting-build-version-display-build-version"> | ||
@T["Build versions:"] | ||
<ul> | ||
<li> | ||
@T["Orchard Core version: {0}", orchardVersion] | ||
</li> | ||
<li> | ||
@T["App build version: {0}", buildVersion] | ||
</li> | ||
@if (!string.IsNullOrEmpty(buildUrl)) | ||
{ | ||
<li> | ||
@T["<a href=\"{0}\" target=\"_blank\">Build link</a>", buildUrl] | ||
</li> | ||
} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@inherits OrchardCore.DisplayManagement.Razor.RazorPage<TModel> | ||
|
||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
@addTagHelper *, OrchardCore.Contents.TagHelpers | ||
@addTagHelper *, OrchardCore.DisplayManagement | ||
@addTagHelper *, OrchardCore.ResourceManagement |
17 changes: 17 additions & 0 deletions
17
Lombiq.Hosting.BuildVersionDisplay/build/Lombiq.Hosting.BuildVersionDisplay.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- This should rather be a props file, but those are overwritten by Orchard's Package.Build.props for modules. --> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<!-- Setting a test value just when working in the OSOCE solution. --> | ||
<PropertyGroup Condition="'$(BuildUrl)' == '' AND '$(SolutionName)' == 'Lombiq.OSOCE'" > | ||
<BuildVersionDisplay_BuildUrl> | ||
https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/actions/runs/123 | ||
</BuildVersionDisplay_BuildUrl> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AssemblyAttribute Include="Lombiq.Hosting.BuildVersionDisplay.BuildUrlAttribute"> | ||
<_Parameter1>$(BuildVersionDisplay_BuildUrl)</_Parameter1> | ||
</AssemblyAttribute> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters