Skip to content

Commit

Permalink
Merge branch '1.10.x' into 'dev' through the 'issue/8773' integration…
Browse files Browse the repository at this point in the history
… branch
  • Loading branch information
BenedekFarkas committed Apr 17, 2024
2 parents 8b9b5fb + 70e1366 commit 3f1bf7f
Show file tree
Hide file tree
Showing 314 changed files with 44,579 additions and 52,654 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,61 @@ on:
- 1.10.x

jobs:
compile:
name: Compile
compile-dotnet:
name: Compile .NET solution
defaults:
run:
shell: pwsh
runs-on: windows-latest

steps:
- name: Clone repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v4.1.1

- name: Restore NuGet packages
run: nuget restore src/Orchard.sln

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
uses: microsoft/setup-msbuild@v2

- name: Compile
run: msbuild Orchard.proj /m /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError

- name: Test
run: msbuild Orchard.proj /m /t:Test
run: msbuild Orchard.proj /m /v:minimal /t:Test

compile-node:
name: Compile client-side assets
defaults:
run:
shell: pwsh
runs-on: windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v4.1.1

- name: Setup NodeJS
uses: actions/setup-node@v4.0.2
with:
node-version: '7'

- name: Setup NPM packages
working-directory: ./src
run: |
npm install --loglevel warn
# Install gulp globally to be able to run the rebuild task, using the same version as in the project.
$gulpVersion = (Get-Content Package.json -Raw | ConvertFrom-Json).devDependencies.gulp
Start-Process npm -NoNewWindow -Wait -ArgumentList "install gulp@$gulpVersion -g --loglevel warn"
- name: Rebuild client-side assets
working-directory: ./src
run: |
gulp rebuild
git add . # To make line ending changes "disappear".
$gitStatus = (git status --porcelain)
if ($gitStatus)
{
throw ("Client-side assets are not up-to-date. Please run 'gulp rebuild' and commit the changes.`n" +
[System.String]::Join([System.Environment]::NewLine, $gitStatus))
}
6 changes: 3 additions & 3 deletions .github/workflows/specflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0

- name: Compile
run: msbuild Orchard.proj /m /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError

- name: Test
run: msbuild Orchard.proj /m /t:Test
run: msbuild Orchard.proj /m /v:minimal /t:Test

- name: Spec
run: msbuild Orchard.proj /m /t:Spec
run: msbuild Orchard.proj /m /v:minimal /t:Spec
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
**/.vs/**
src/Rebracer.xml

# User-specific files
*.suo
Expand Down Expand Up @@ -190,5 +192,3 @@ src/Orchard.Azure/Orchard.Azure.CloudService/Staging/

#enable all /lib artifacts
!lib/**/*.*
**/.vs/*
src/Rebracer.xml
22 changes: 2 additions & 20 deletions ClickToBuild.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,18 @@
REM Necessary for the InstallDir variable to work inside the MsBuild-finding loop below.
SETLOCAL ENABLEDELAYEDEXPANSION

for /f "usebackq tokens=1* delims=: " %%i in (`lib\vswhere\vswhere -latest -version "[15.0,17.0)" -requires Microsoft.Component.MSBuild`) do (
for /f "usebackq tokens=1* delims=: " %%i in (`lib\vswhere\vswhere -latest -version "[16.0,18.0)" -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" (
set InstallDir=%%j
echo !InstallDir!
if exist "!InstallDir!\MSBuild\15.0\Bin\MSBuild.exe" (
echo "Using MSBuild from Visual Studio 2017"
set msbuild="!InstallDir!\MSBuild\15.0\Bin\MSBuild.exe"
goto build
)
if exist "!InstallDir!\MSBuild\Current\Bin\MSBuild.exe" (
echo "Using MSBuild from Visual Studio 2019"
echo "Using MSBuild from !InstallDir!"
set msbuild="!InstallDir!\MSBuild\Current\Bin\MSBuild.exe"
goto build
)
)
)

FOR %%b in (
"%VS140COMNTOOLS%\vsvars32.bat"
"%VS120COMNTOOLS%\vsvars32.bat"
"%VS110COMNTOOLS%\vsvars32.bat"
) do (
if exist %%b (
echo "Using MSBuild from %%b"
call %%b
set msbuild="msbuild"
goto build
)
)

echo "Unable to detect suitable environment. Build may not succeed."

:build
Expand Down
24 changes: 9 additions & 15 deletions Orchard.proj
Original file line number Diff line number Diff line change
Expand Up @@ -113,29 +113,25 @@
</Target>

<Target Name="Compile">
<CallTarget Targets="DevCompile"/>
<!-- Compile to "OutputFolder" -->
<MSBuild
Projects="$(Solution)"
Targets="Build"
Properties="Configuration=$(Configuration);OutputPath=$(CompileFolder);MvcBuildViews=false" />
<!-- Compile to "regular" output folder for devs using VS locally -->
<MSBuild
Projects="$(Solution)"
Targets="Build"
Properties="Configuration=$(Configuration);MvcBuildViews=$(MvcBuildViews)" />
Properties="Configuration=$(Configuration);OutputPath=$(CompileFolder)" />
</Target>

<Target Name="BuildViews">
<!-- To make sure that Roslyn tools are available, even if the Compile task was not called before this. -->
<Target Name="DevCompile">
<!-- To make sure that Roslyn tools are available, since it's included with Orchard.Web, which is not referenced by
other projects, so it will be built towards the end. -->
<MSBuild
Projects="$(OrchardWebFolder)\Orchard.Web.csproj"
Targets="CopyRoslynFilesToOutputFolder"
Properties="Configuration=$(Configuration)" />
<!-- The actual compilation with views also compiled. -->
Targets="CopyRoslynCompilerFilesToOutputDirectory" />
<!-- Compile to "regular" output folder for devs using VS locally -->
<MSBuild
Projects="$(Solution)"
Targets="Build"
Properties="Configuration=$(Configuration);MvcBuildViews=true" />
Properties="Configuration=$(Configuration);MvcBuildViews=$(MvcBuildViews)" />
</Target>

<Target Name="CompileMsBuildTasks">
Expand Down Expand Up @@ -195,7 +191,6 @@
<Stage-Media Include="$(SrcFolder)\Orchard.Web\Media\OrchardLogo.png" />
<Stage-PoFiles Include="$(SrcFolder)\Orchard.Web\**\*.po" />
<Stage-Core Include="$(WebSitesFolder)\Orchard.Core\**\*" Exclude="$(WebSitesFolder)\Orchard.Core\**\bin\**\*" />
<Stage-Roslyn Include="$(SrcFolder)\Orchard.Web\bin\roslyn\*" />

<!-- Get list of module names from the module definition files within ModulesSrcFolder -->
<Stage-Modules-Definitions Include="$(ModulesSrcFolder)\**\Module.txt" />
Expand Down Expand Up @@ -237,7 +232,7 @@

<!-- Copying module binaries is somewhat tricky: From a module "bin" directory, we
only want to include the files that are _not_ already present in
the "Orchard.Web\Bin" folder (except for "Orchard.Web\bin\roslyn"). -->
the "Orchard.Web\Bin" folder. -->
<FilterModuleBinaries
ModulesBinaries="@(Stage-Modules-Binaries)"
OrchardWebBinaries="@(Stage-Orchard-Web-Bins)">
Expand Down Expand Up @@ -267,7 +262,6 @@
<Copy SourceFiles="@(Stage-Themes-Custom)" DestinationFiles="@(Stage-Themes-Custom->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Binaries-Unique)" DestinationFiles="@(Stage-Themes-Binaries-Unique->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Sources)" DestinationFolder="$(StageFolder)\Themes\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Roslyn)" DestinationFolder="$(StageFolder)\bin\roslyn"/>

<MakeDir Directories="$(StageFolder)\App_Data"/>
<WriteLinesToFile File="$(StageFolder)\App_Data\_marker.txt" Lines="some_text" Overwrite="true"/>
Expand Down
Binary file modified lib/nuget/nuget.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
// Source maps are useless if neither concatenating nor transpiling.
if ((!doConcat || assetGroup.inputPaths.length < 2) && !assetGroup.inputPaths.some(function (inputPath) { return path.extname(inputPath).toLowerCase() === ".ts"; }))
generateSourceMaps = false;
var typeScriptOptions = { allowJs: true, noImplicitAny: true, noEmitOnError: true };
var typeScriptOptions = { allowJs: true, noImplicitAny: true, noEmitOnError: true, module: 'amd' };
if (assetGroup.typeScriptOptions)
typeScriptOptions = Object.assign(typeScriptOptions, assetGroup.typeScriptOptions); // Merge override options from asset group if any.
if (doConcat)
Expand Down
3 changes: 1 addition & 2 deletions src/Orchard.Azure.Tests/Orchard.Azure.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RootNamespace>Orchard.Azure.Tests</RootNamespace>
<AssemblyName>Orchard.Azure.Tests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -41,7 +42,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
Expand All @@ -52,7 +52,6 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Orchard.Core.Tests/Orchard.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RootNamespace>Orchard.Core.Tests</RootNamespace>
<AssemblyName>Orchard.Core.Tests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -41,7 +42,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
Expand All @@ -53,7 +53,6 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
Expand Down
3 changes: 1 addition & 2 deletions src/Orchard.Profile/Orchard.Profile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RootNamespace>Orchard.Profile</RootNamespace>
<AssemblyName>Orchard.Profile</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -41,7 +42,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
Expand All @@ -53,7 +53,6 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<add key="webpages:Enabled" value="false" />
<add key="aspnet:RoslynCompilerLocation" value="..\bin\roslyn" />
</appSettings>
<!-- Registering Roslyn as a compiler for Razor IntelliSense. -->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:latest" />
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" compilerOptions="/langversion:7.3 /nowarn:1659;1699;1701;612;618" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</compilers>
</system.codedom>
<system.web>
Expand Down
3 changes: 1 addition & 2 deletions src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<add key="webpages:Enabled" value="false" />
<add key="aspnet:RoslynCompilerLocation" value="..\bin\roslyn" />
</appSettings>
<!-- Registering Roslyn as a compiler for Razor IntelliSense. -->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:latest" />
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" compilerOptions="/langversion:7.3 /nowarn:1659;1699;1701;612;618" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</compilers>
</system.codedom>
<system.web>
Expand Down
2 changes: 1 addition & 1 deletion src/Orchard.Specs/Hosting/Orchard.Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<!-- Registering Roslyn as a compiler for Dynamic Compilation. -->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:latest" />
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" compilerOptions="/langversion:7.3 /nowarn:1659;1699;1701;612;618" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</compilers>
</system.codedom>
<system.web>
Expand Down
3 changes: 1 addition & 2 deletions src/Orchard.Specs/Orchard.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RootNamespace>Orchard.Specs</RootNamespace>
<AssemblyName>Orchard.Specs</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -41,7 +42,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
Expand All @@ -53,7 +53,6 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
Expand Down
10 changes: 2 additions & 8 deletions src/Orchard.Tests.Modules/Email/EmailChannelTests.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System.Collections.Generic;
using Autofac;
using Moq;
using NUnit.Framework;
using Orchard.ContentManagement.Records;
using Orchard.DisplayManagement;
using Orchard.Email.Services;
using Orchard.Messaging.Events;
using Orchard.Messaging.Services;
using Orchard.Tests.Messaging;
using Orchard.Tests.Modules.Stubs;
using Orchard.Tests.Utility;

namespace Orchard.Tests.Modules.Email {
[TestFixture]
Expand All @@ -30,10 +24,10 @@ public class EmailChannelTests {
var container = builder.Build();
_messageService = container.Resolve<IMessageService>();
}

[Test]
public void CanSendEmailUsingAddresses() {
_messageService.Send("Email", new Dictionary<string, object>() { {"", null} });
_messageService.Send("Email", new Dictionary<string, object>() { { "", null } });
Assert.That(_smtpChannel.Processed, Is.Not.Null);
}

Expand Down
6 changes: 1 addition & 5 deletions src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RootNamespace>Orchard.Tests.Modules</RootNamespace>
<AssemblyName>Orchard.Tests.Modules</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -41,7 +42,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
Expand All @@ -53,7 +53,6 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
Expand All @@ -77,9 +76,6 @@
<Reference Include="FluentPath, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Orchard.FluentPath.1.0.0.1\lib\FluentPath.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\packages\Iesi.Collections.4.0.4\lib\net461\Iesi.Collections.dll</HintPath>
</Reference>
Expand Down

0 comments on commit 3f1bf7f

Please sign in to comment.