Orchard/Orchard.proj
Benedek Farkas 731b223f82
8686: Fixing build and tests on 1.10.x (#8687)
* Fixing that RecipeManagerTests failed due to HttpContext not being available

* Fixing OwnerEditor tests in CommonPartProviderTests as the owner editor now checks for a different permission since 5b0c82d1ad

* Fixing typo in CommonPartProviderTests.UpdateModelStub class name

* Fixing that test cases for invalid path in FileSystemStorageProviderTests broke in a3e9bef3ca (issue #6802, PR #6919)

I should review PRs more carefully!

* Fixing CurrentCultureWorkContextTests

* Fixing indentation in DefaultDateFormatterTests

* Updating Orchard.Azure.Web's required version of System.Web.Mvc to match the rest of the solution

* Orchard.Specs: Fixing assembly loading errors when starting up the web host by adding binding redirects

* Adding empty compile workflow from dev

* Adding the compile workflow's actual contents

* Changing default shell to pwsh (msbuild was not found in cmd?)

* Adding msbuild to PATH

* Removing unused references to System.Net.Http

* Replacing System.Net.Http references with its NuGet package to pin the correct version number (experimental)

* Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 4.1.0 (latest) to get rid of old System.Http.Net dependency

* Orchard.proj: Spec target actually depends on only the Compile target, not Package-Stage (experimental)

* Compile workflow: Testing the Test and Spec targets

* Fixing Test step

* Fixing compile workflow to also mark Razor compilation warnings as errors

* Restoring Orchard.Specs/Hosting/Orchard.Web/Web.config to match Orchard.Web's web.config closer

so that it loads assemblies from the Dependencies folder.
This fixes the error with Autofac not being able to resolve dependencies for DefaultOrchardShell

* Orchard.Specs/Hosting/Orchard.Web/Global.asax.cs: Workaround for AntiForgeryToken bug in ASP.NET MVC since version 5.2.4

https://github.com/aspnet/AspNetWebStack/issues/162

* Revert "Replacing System.Net.Http references with its NuGet package to pin the correct version number (experimental)"

This reverts commit 087f2849b1.

* Revert "Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 4.1.0 (latest) to get rid of old System.Http.Net dependency"

This reverts commit be2ba866e3.

* Reverting the addition of assembly binding redirects to Orchard.Specs/Hosting/Simple.Web/Web.config

since it doesn't need them like Orchard.Specs/Hosting/Orchard.Web/Web.config does

* Disabling Test and Spec execution for now

* Orchard.Framework: Making the System.Net.Http not-private to prevent an outdated version sticking around

* Orchard.Workflows: Adding assembly binding redirect for System.Net.Http to avoid Razor compilation warning

* Moving the System.Net.Http assembly redirect to Orchard.Web

* Specs: Fixing "I can create browse blog posts on several pages" Blog test's usage of "I should not see" and correcting the parameters too

because unlike "I should see", this is not a regex match, just contains

* Specs: Fixing "I can create browse blog posts on several pages" Blog test's flakyness due to timing

because the blog posts are created quickly after one another and the lack of millisecond-precision can cause
the blog posts to appear out of order of creation

* Specs: Media test simplified since the Orchard.Media feature is deprecated

* Adding step to the Compile workflow to upload the MSBuild binlog results

* Pinning the referenced version of System.Net.Http to 4.2.0.0 to prevent Razor compilation warning

System.Net.Http is known to have such problems across different framework versions ways of referencing it

The original warning is:
ASPNETCOMPILER : error : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: Orchard.Workflows, Version=1.10.3.0, Culture=neutral, PublicKeyToken=null. The dependencies are: System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly. [D:\a\Orchard\Orchard\src\Orchard.Web\Modules\Orchard.Workflows\Orchard.Workflows.csproj

* Re-enabling the Test step

* Re-enabling the Specs step

* Marking System.Net.Http references as private (copy local) to make sure that it's always available, because it requires a specific version

* Revert "Marking System.Net.Http references as private (copy local) to make sure that it's always available, because it requires a specific version"

This reverts commit e4f5632236.

* Orchard.Specs: Adding Settings feature

* Orchard.Specs: Updating DateTime.CreatingAndUsingDateTimeFieldsInAnotherCulture structure without functional change

* Orchard.Specs: Updating Settings.AddingANewSiteCultureAndSelectingItAsTheDefaultWorks to correctly detect that a culture that wasn't added before can be set as default

* Fixing Newtonsoft.Json references

* Specs: Workaround for the DefineDefaultCulture binding and removing the Settings feature which is now redundant with CreatingAndUsingDateTimeFieldsInAnotherCulture

* Updating the compile workflow to run the build + tests on PR, dev and 1.10.x commits

* Adding the compile workflow to the solution
2023-06-28 15:11:46 +02:00

476 lines
22 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Initialization -->
<PropertyGroup>
<LibFolder>$(MSBuildProjectDirectory)\lib</LibFolder>
<SrcFolder>$(MSBuildProjectDirectory)\src</SrcFolder>
<AzureSrcFolder>$(SrcFolder)\Orchard.Azure</AzureSrcFolder>
<BuildFolder>$(MSBuildProjectDirectory)\build</BuildFolder>
<MsBuildTasksFolder>$(MSBuildProjectDirectory)\buildtasks</MsBuildTasksFolder>
<ArtifactsFolder>$(MSBuildProjectDirectory)\artifacts</ArtifactsFolder>
<SqlCeFolder>$(MSBuildProjectDirectory)\lib\sqlce</SqlCeFolder>
<SourceArtifactFolder>$(ArtifactsFolder)\Source</SourceArtifactFolder>
<MsDeployArtifactFolder>$(ArtifactsFolder)\MsDeploy</MsDeployArtifactFolder>
<GalleryArtifactFolder>$(ArtifactsFolder)\Gallery</GalleryArtifactFolder>
<OrchardWebFolder>$(SrcFolder)\Orchard.Web</OrchardWebFolder>
<ModulesSrcFolder>$(OrchardWebFolder)\Modules</ModulesSrcFolder>
<OrchardCoreSrcFolder>$(OrchardWebFolder)\Core</OrchardCoreSrcFolder>
<ThemesSrcFolder>$(OrchardWebFolder)\Themes</ThemesSrcFolder>
<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
<StageFolder>$(BuildFolder)\Stage</StageFolder>
<MsDeployFolder>$(BuildFolder)\MsDeploy</MsDeployFolder>
<PrecompiledFolder>$(BuildFolder)\Precompiled</PrecompiledFolder>
<ProfilingFolder>$(BuildFolder)\Profiling</ProfilingFolder>
<GalleryFolder>$(BuildFolder)\Gallery</GalleryFolder>
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
<OrchardSolution>$(SrcFolder)\Orchard.sln</OrchardSolution>
<OrchardAzureSolution>$(AzureSrcFolder)\Orchard.Azure.sln</OrchardAzureSolution>
<Solution Condition="$(Solution) == ''">$(OrchardSolution)</Solution>
<!-- TeamCity build number -->
<Version>$(BUILD_NUMBER)</Version>
</PropertyGroup>
<!-- Finding the restored NuGet package of NUnit (version number doesn't matter)
to be able to reference the test runner executable (http://stackoverflow.com/a/25617556). -->
<ItemGroup>
<NUnitPackageFiles Include="$(SrcFolder)\packages\NUnit*\tools\nunit-console.exe" />
<NUnitPackageToolsFolder Include="@(NUnitPackageFiles->'%(RootDir)%(Directory)'->Distinct())" />
</ItemGroup>
<Import Project="$(LibFolder)\msbuildtasks\MSBuild.Community.Tasks.Targets"/>
<Import Project="$(LibFolder)\slowcheetah\SlowCheetah.Transforms.targets"/>
<!-- Coordinating Targets -->
<Target Name="Build">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
</Target>
<Target Name="FastBuild">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package"/>
</Target>
<Target Name="FullBuild">
<CallTarget Targets="Clean"/>
<CallTarget Targets="TypeScript"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="Spec"/>
<CallTarget Targets="Gallery"/>
</Target>
<Target Name="FastPackage">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="Gallery"/>
</Target>
<Target Name="Package">
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Package-MsDeploy"/>
<CallTarget Targets="Package-Zip"/>
</Target>
<Target Name="Precompiled">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Package-Precompiled"/>
</Target>
<Target Name="Profiling">
<CallTarget Targets="Clean"/>
<CallTarget Targets="Compile"/>
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Profiling-Stage"/>
<CallTarget Targets="Profiling-Setup"/>
</Target>
<Target Name="Gallery">
<CallTarget Targets="Gallery-Stage"/>
<CallTarget Targets="Gallery-Setup"/>
</Target>
<Target Name="AzureBuild">
<MSBuild Projects="$(OrchardAzureSolution)" Targets="Build">
</MSBuild>
</Target>
<Target Name="AzureCIBuild">
<MSBuild Projects="$(OrchardAzureSolution)" Targets="CIBuild">
</MSBuild>
</Target>
<!-- Building -->
<Target Name="Clean">
<MSBuild Projects="$(Solution)" Targets="Clean" />
<RemoveDir Directories="$(BuildFolder)" ContinueOnError="true"/>
<RemoveDir Directories="$(ArtifactsFolder)" />
</Target>
<Target Name="Compile">
<!-- 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)" />
</Target>
<Target Name="BuildViews">
<!-- To make sure that Roslyn tools are available, even if the Compile task was not called before this. -->
<MSBuild
Projects="$(OrchardWebFolder)\Orchard.Web.csproj"
Targets="CopyRoslynFilesToOutputFolder"
Properties="Configuration=$(Configuration)" />
<!-- The actual compilation with views also compiled. -->
<MSBuild
Projects="$(Solution)"
Targets="Build"
Properties="Configuration=$(Configuration);MvcBuildViews=true" />
</Target>
<Target Name="CompileMsBuildTasks">
<MSBuild
Projects="$(SrcFolder)\Tools\MSBuild.Orchard.Tasks\MSBuild.Orchard.Tasks.csproj"
Targets="Build"
Properties="Configuration=$(Configuration);OutputPath=$(MsBuildTasksFolder)" />
</Target>
<Target Name="TypeScript" DependsOnTargets="CompileMsBuildTasks">
<ItemGroup>
<TypeScriptSources Include="$(SrcFolder)\**\Scripts\**\*.ts"/>
</ItemGroup>
<CompileTypeScriptFiles
InputFiles="@(TypeScriptSources)"
CompilerPath="$(LibFolder)\typescript\tsc.exe"
CompilerOptions="--target ES5">
<Output TaskParameter="OutputFiles" ItemName="Content" />
</CompileTypeScriptFiles>
</Target>
<!-- Testing -->
<Target Name="Test">
<!-- Run unit test assemblies -->
<CreateItem Include="$(CompileFolder)\*.Tests.*dll">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>
<NUnit Assemblies="@(TestAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" ExcludeCategory="longrunning" />
</Target>
<Target Name="Spec" DependsOnTargets="Compile">
<!-- Running SpecFlow tests -->
<CreateItem Include="$(CompileFolder)\*.Specs.*dll">
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
</CreateItem>
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Specs.xml" />
</Target>
<!-- Packaging (Stage) -->
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FilterModuleBinaries" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FileUpdateLines" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.ValidateExtensionProjectFiles" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.XmlDelete" />
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.CompileTypeScriptFiles" />
<Target Name="Package-Stage" DependsOnTargets="Compile">
<CallTarget Targets="CompileMsBuildTasks"/>
<CallTarget Targets="ValidateProjectFiles"/>
<ItemGroup>
<SqlCe-Native-Binaries-x86 Include="$(SqlCeFolder)\x86\**\*"/>
<SqlCe-Native-Binaries-amd64 Include="$(SqlCeFolder)\amd64\**\*"/>
<Stage-Orchard-Web-Bins Include="$(WebSitesFolder)\Orchard.Web\bin\*"/>
<Stage-Bin-Exclude Include="$(WebSitesFolder)\**\bin\**\*" />
<Stage-Web Include="$(WebSitesFolder)\Orchard.Web\**\*;$(SrcFolder)\Orchard.Web\*.csproj;" Exclude="$(SrcFolder)\Orchard.Web\Orchard.Web.csproj;$(SrcFolder)\Orchard.Web\**\*.Release.config;$(SrcFolder)\Orchard.Web\**\*.Debug.config"/>
<Stage-Web-Config Include="$(SrcFolder)\Orchard.Web\**\*.config" Exclude="$(SrcFolder)\Orchard.Web\**\*.Release.config;$(SrcFolder)\Orchard.Web\**\*.Debug.config"/>
<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" />
<Stage-Modules-Directories Include="@(Stage-Modules-Definitions->DirectoryName())" />
<Stage-Modules-Names Include="@(Stage-Modules-Directories->'%(Filename)%(Extension)')" />
<!-- Get list of theme names from the theme definition files within ThemesSrcFolder -->
<Stage-Themes-Definitions Include="$(ThemesSrcFolder)\**\Theme.txt" />
<Stage-Themes-Directories Include="@(Stage-Themes-Definitions->DirectoryName())" />
<Stage-Themes-Names Include="@(Stage-Themes-Directories->'%(Filename)%(Extension)')" />
<Stage-License Include="$(MSBuildProjectDirectory)\*.txt" />
<Stage-Build Include="$(MSBuildProjectDirectory)\*.proj;$(MSBuildProjectDirectory)\*.cmd" />
</ItemGroup>
<ItemGroup>
<!-- Note. We could add recursion (\..\) before the module/theme name thus avoiding the need for custom metadata
and simplifing the copy tasks further below. However this can result in folders being incorrectly copied if
a module or theme contains a subfolder with the same name as another module or theme. -->
<Stage-Modules Include="$(WebSitesFolder)\%(Stage-Modules-Names.Identity)\**\*" Exclude="@(Stage-Bin-Exclude)">
<ModuleName>%(Stage-Modules-Names.Identity)</ModuleName>
</Stage-Modules>
<Stage-Modules-Binaries Include="$(WebSitesFolder)\%(Stage-Modules-Names.Identity)\**\bin\**\*">
<ModuleName>%(Stage-Modules-Names.Identity)</ModuleName>
</Stage-Modules-Binaries>
<Stage-Modules-Sources Include="$(ModulesSrcFolder)\**\*.csproj;$(ModulesSrcFolder)\**\*.cs"/>
<Stage-Themes-Default Include="$(WebSitesFolder)\Themes\%(Stage-Themes-Names.Identity)\**\*">
<ThemeName>%(Stage-Themes-Names.Identity)</ThemeName>
</Stage-Themes-Default>
<Stage-Themes-Custom Include="$(WebSitesFolder)\%(Stage-Themes-Names.Identity)\**\*" Exclude="@(Stage-Bin-Exclude)">
<ThemeName>%(Stage-Themes-Names.Identity)</ThemeName>
</Stage-Themes-Custom>
<!-- Note. Binaries are not copied for themes in the default Themes project. -->
<Stage-Themes-Binaries Include="$(WebSitesFolder)\%(Stage-Themes-Names.Identity)\**\bin\**\*">
<ThemeName>%(Stage-Themes-Names.Identity)</ThemeName>
</Stage-Themes-Binaries>
<Stage-Themes-Sources Include="$(ThemesSrcFolder)\**\*.csproj;$(ThemesSrcFolder)\**\*.cs" Exclude="$(ThemesSrcFolder)\*.*"/>
</ItemGroup>
<!-- 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"). -->
<FilterModuleBinaries
ModulesBinaries="@(Stage-Modules-Binaries)"
OrchardWebBinaries="@(Stage-Orchard-Web-Bins)">
<Output TaskParameter="ExcludedBinaries" ItemName="FilterModuleBinaries-ExcludedBinaries"/>
</FilterModuleBinaries>
<FilterModuleBinaries
ModulesBinaries="@(Stage-Themes-Binaries)"
OrchardWebBinaries="@(Stage-Orchard-Web-Bins)">
<Output TaskParameter="ExcludedBinaries" ItemName="FilterThemeBinaries-ExcludedBinariesFromThemes"/>
</FilterModuleBinaries>
<ItemGroup>
<Stage-Modules-Binaries-Unique Include="@(Stage-Modules-Binaries)" Exclude="@(FilterModuleBinaries-ExcludedBinaries)"/>
<Stage-Themes-Binaries-Unique Include="@(Stage-Themes-Binaries)" Exclude="@(FilterThemeBinaries-ExcludedBinariesFromThemes)"/>
</ItemGroup>
<Copy SourceFiles="@(Stage-Web);@(Stage-Web-Config);@(Stage-License)" DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Media)" DestinationFolder="$(StageFolder)\Media"/>
<Copy SourceFiles="@(Stage-PoFiles)" DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
<Copy SourceFiles="@(SqlCe-Native-Binaries-x86)" DestinationFolder="$(StageFolder)\bin\x86\%(RecursiveDir)"/>
<Copy SourceFiles="@(SqlCe-Native-Binaries-amd64)" DestinationFolder="$(StageFolder)\bin\amd64\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(StageFolder)\Core\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Modules)" DestinationFiles="@(Stage-Modules->'$(StageFolder)\Modules\%(ModuleName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Modules-Binaries-Unique)" DestinationFiles="@(Stage-Modules-Binaries-Unique->'$(StageFolder)\Modules\%(ModuleName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Modules-Sources)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Themes-Default)" DestinationFiles="@(Stage-Themes-Default->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<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"/>
<!-- extra processing of the staged config files -->
<TransformXml
Source="$(StageFolder)\Web.Config"
Transform="$(SrcFolder)\Orchard.Web\Web.$(Configuration).Config"
Destination="$(StageFolder)\Web.Config"
/>
<TransformXml
Source="$(StageFolder)\Config\HostComponents.Config"
Transform="$(SrcFolder)\Orchard.Web\Config\HostComponents.$(Configuration).Config"
Destination="$(StageFolder)\Config\HostComponents.Config"
/>
<TransformXml
Source="$(StageFolder)\Config\log4net.Config"
Transform="$(SrcFolder)\Orchard.Web\Config\log4net.$(Configuration).Config"
Destination="$(StageFolder)\Config\log4net.Config"
/>
<!-- move over extra non-content files the csproj referenced -->
<Copy SourceFiles="@(StageProjectAlteration-ExtraFiles->'$(SrcFolder)\Orchard.Web\%(Identity)')"
DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
</Target>
<!-- Packaging (MsDeploy) -->
<Target Name="Package-MsDeploy">
<ItemGroup>
<MsDeploy-Exclude-Modules Include="
$(StageFolder)\**\Modules\Orchard.CustomForms\**;
$(StageFolder)\**\Modules\Orchard.jQuery\**;
$(StageFolder)\**\Modules\Orchard.Media\**;
$(StageFolder)\**\Modules\Orchard.MediaPicker\**;
$(StageFolder)\**\Modules\Orchard.Rules\**;
$(StageFolder)\**\Modules\Orchard.TaskLease\**;
" />
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;$(StageFolder)\**\obj\**\*;$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.dll.config;@(MsDeploy-Exclude-Modules)" />
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml;$(LibFolder)\msdeploy\*.sql"/>
</ItemGroup>
<Copy SourceFiles="@(MsDeploy-Folder-Input)"
DestinationFolder="$(MsDeployFolder)\Orchard\%(RecursiveDir)"/>
<Copy SourceFiles="@(MsDeploy-Parameters)"
DestinationFolder="$(MsDeployFolder)"/>
<MakeDir Directories="$(MsDeployFolder)\Orchard\bin\HostRestart"/>
</Target>
<!-- Packaging (Precompiled) -->
<Target Name="Package-Precompiled">
<ItemGroup>
<Precompiled-Exclude-Source Include="$(StageFolder)\**\*.cs;$(StageFolder)\**\*.csproj;$(StageFolder)\**\*.csproj.user" />
<Precompiled-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml;$(StageFolder)\Modules\**\Tests\**;$(StageFolder)\Modules\**\Specs\**;$(StageFolder)\**\obj\**\*;@(Precompiled-Exclude-Source)" />
</ItemGroup>
<Copy SourceFiles="@(Precompiled-Folder-Input)"
DestinationFolder="$(PrecompiledFolder)\%(RecursiveDir)"/>
<MakeDir Directories="$(PrecompiledFolder)\bin\HostRestart"/>
</Target>
<Target Name="Package-Zip">
<ItemGroup>
<Zip-Exclude Include="
$(MSBuildProjectDirectory)\src\**\packages\**\*;
$(MSBuildProjectDirectory)\src\**\bin\**\*;
$(MSBuildProjectDirectory)\src\**\obj\**\*;
$(MSBuildProjectDirectory)\**\App_Data\**\*;
$(MSBuildProjectDirectory)\**\node_modules\**\*;
$(MSBuildProjectDirectory)\**\_ReSharper*\**\*;
$(MSBuildProjectDirectory)\**\*.sln.cache;
$(MSBuildProjectDirectory)\**\*.suo;
$(MSBuildProjectDirectory)\**\*.user;
$(MSBuildProjectDirectory)\**\*.patch;
$(MSBuildProjectDirectory)\**\*.hgignore;
$(MSBuildProjectDirectory)\**\*.hg*\**\*;
$(LibFolder)\nunit\addins\**\*;
" Exclude="$(AzureSrcFolder)\Orchard.Azure.CloudService\*Content\**\*" />
<Zip-Stage Include="$(StageFolder)\**\*" />
<Zip-MsDeploy Include="$(MsDeployFolder)\**\*" Exclude=""/>
<Zip-Source Include="
$(MSBuildProjectDirectory)\lib\**\*;
$(MSBuildProjectDirectory)\src\**\*;
$(MSBuildProjectDirectory)\*.txt;
$(MSBuildProjectDirectory)\*.proj;
$(MSBuildProjectDirectory)\*.cmd;
" Exclude="@(Zip-Exclude)" />
</ItemGroup>
<MakeDir Directories="$(MsDeployArtifactFolder);$(SourceArtifactFolder)"/>
<PropertyGroup>
<ZipVersionFileSuffix Condition="$(Version) != ''">.$(Version)</ZipVersionFileSuffix>
<ZipVersionFileSuffix Condition="$(Version) == ''"></ZipVersionFileSuffix>
</PropertyGroup>
<Zip Files="@(Zip-MsDeploy)" WorkingDirectory="$(MsDeployFolder)" ZipFileName="$(MsDeployArtifactFolder)\Orchard.Web$(ZipVersionFileSuffix).zip" />
<Zip Files="@(Zip-Source)" WorkingDirectory="$(MSBuildProjectDirectory)" ZipFileName="$(SourceArtifactFolder)\Orchard.Source$(ZipVersionFileSuffix).zip" />
</Target>
<!-- Profiling -->
<Target Name="Profiling-Stage">
<ItemGroup>
<Profiling-Web Include="$(StageFolder)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(Profiling-Web)" DestinationFolder="$(ProfilingFolder)\%(RecursiveDir)"/>
</Target>
<Target Name="Profiling-Setup">
<ReadLinesFromFile File="$(SrcFolder)\Orchard.Profile\profiling-setup-commands.txt">
<Output TaskParameter="Lines" ItemName="ProfilingSetupCommands"/>
</ReadLinesFromFile>
<Exec Command="&quot;$(ProfilingFolder)\bin\Orchard.exe&quot; %(ProfilingSetupCommands.Identity)" WorkingDirectory="$(ProfilingFolder)"/>
</Target>
<!-- Gallery Packaging -->
<Target Name="Gallery-Stage">
<ItemGroup>
<Gallery-Web Include="$(StageFolder)\**\*" />
</ItemGroup>
<Copy SourceFiles="@(Gallery-Web)" DestinationFolder="$(GalleryFolder)\%(RecursiveDir)"/>
</Target>
<Target Name="Gallery-Setup">
<Exec Command="&quot;$(GalleryFolder)\bin\Orchard.exe&quot; setup /SiteName:Gallery /AdminUsername:admin /AdminPassword:gallery-secret /DatabaseProvider:SqlCe" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command="&quot;$(GalleryFolder)\bin\Orchard.exe&quot; feature enable Orchard.Packaging" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command="&quot;$(GalleryFolder)\bin\Orchard.exe&quot; package create Orchard.Media &quot;$(GalleryArtifactFolder)&quot;" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command="&quot;$(GalleryFolder)\bin\Orchard.exe&quot; package create Orchard.MediaPicker &quot;$(GalleryArtifactFolder)&quot;" WorkingDirectory="$(GalleryFolder)"/>
<Exec Command="&quot;$(GalleryFolder)\bin\Orchard.exe&quot; package create Orchard.Rules &quot;$(GalleryArtifactFolder)&quot;" WorkingDirectory="$(GalleryFolder)"/>
</Target>
<!-- ValidateProjectFiles-->
<Target Name="ValidateProjectFiles">
<CallTarget Targets="CompileMsBuildTasks"/>
<ItemGroup>
<Validate-ProjectFiles
Include="$(ModulesSrcFolder)\**\*.csproj;$(ThemesSrcFolder)\**\*.csproj;$(OrchardCoreSrcFolder)\Orchard.Core.csproj"
Exclude="$(ModulesSrcFolder)\**\*.Specs.csproj"
/>
</ItemGroup>
<ValidateExtensionProjectFiles Files="@(Validate-ProjectFiles)"/>
</Target>
<!-- SetVersion -->
<!-- Update all AssemblyInfo.cs and module.txt files to contain $(Version) -->
<Target Name="SetVersion" Condition="$(Version) != ''">
<CallTarget Targets="CompileMsBuildTasks"/>
<ItemGroup>
<Version-AssemblyInfos Include="$(SrcFolder)\**\AssemblyInfo.cs" />
<Version-Modules Include="$(SrcFolder)\**\Module.txt" />
<Version-Themes Include="$(SrcFolder)\**\Theme.txt" />
</ItemGroup>
<FileUpdateLines Files="@(Version-Modules)"
Regex="^(orchardversion|version)(\s*):(\s*)(.*)"
ReplacementText="${1}${2}:${3}$(Version)"
IgnoreCase="True"/>
<FileUpdateLines Files="@(Version-Themes)"
Regex="^(orchardversion|version)(\s*):(\s*)(.*)"
ReplacementText="${1}${2}:${3}$(Version)"
IgnoreCase="True"/>
<FileUpdateLines Files="@(Version-AssemblyInfos)"
Regex="^\[assembly:(\s)*(AssemblyVersion|AssemblyFileVersion)(\s)*\(&quot;(.*)&quot;\)(\s)*\]"
ReplacementText="[assembly:${1}${2}${3}(&quot;$(Version)&quot;)${5}]"
IgnoreCase="True"/>
</Target>
</Project>