mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Update MsDeploy package to include module binaries
--HG-- branch : dev
This commit is contained in:
parent
ec7237ebb1
commit
510621f1bc
40
Orchard.proj
40
Orchard.proj
@ -90,29 +90,45 @@
|
|||||||
<!-- Packaging (Stage) -->
|
<!-- Packaging (Stage) -->
|
||||||
|
|
||||||
<UsingTask AssemblyFile="$(CompileFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.StageProjectAlteration" />
|
<UsingTask AssemblyFile="$(CompileFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.StageProjectAlteration" />
|
||||||
|
<UsingTask AssemblyFile="$(CompileFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FilterModuleBinaries" />
|
||||||
|
|
||||||
<Target Name="Package-Stage">
|
<Target Name="Package-Stage">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Stage-Orchard-Web-Bins Include="$(WebSitesFolder)\Orchard.Web\bin\*"/>
|
|
||||||
<Stage-Bin-Exclude Include="$(WebSitesFolder)\**\bin\**\*" />
|
|
||||||
<Stage-Module-Exclude Include="$(WebSitesFolder)\PackageIndexReferenceImplementation\**\*"/>
|
|
||||||
<Stage-Modules-Sources Include="$(ModulesSrcFolder)\**\*.csproj;$(ModulesSrcFolder)\**\*.cs;"/>
|
|
||||||
|
|
||||||
<Stage-Web Include="$(WebSitesFolder)\Orchard.Web\**\*;$(SrcFolder)\Orchard.Web\*.csproj" />
|
|
||||||
<Stage-Core Include="$(WebSitesFolder)\Orchard.Core\**\*" Exclude="@(Stage-Bin-Exclude)" />
|
|
||||||
<Stage-Modules Include="$(WebSitesFolder)\**\*;@(Stage-Modules-Sources)" Exclude="@(Stage-Web);@(Stage-Core);@(Stage-Bin-Exclude);@(Stage-Module-Exclude)" />
|
|
||||||
<Stage-License Include="$(MSBuildProjectDirectory)\*.txt" />
|
|
||||||
<Stage-SqlCe-Native-Binaries-x86 Include="$(SqlCeFolder)\x86\*"/>
|
<Stage-SqlCe-Native-Binaries-x86 Include="$(SqlCeFolder)\x86\*"/>
|
||||||
<Stage-SqlCe-Native-Binaries-amd64 Include="$(SqlCeFolder)\amd64\*"/>
|
<Stage-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" />
|
||||||
|
<Stage-Core Include="$(WebSitesFolder)\Orchard.Core\**\*" Exclude="$(WebSitesFolder)\Orchard.Core\**\bin\**\*" />
|
||||||
|
|
||||||
|
<Stage-Module-Exclude Include="@(Stage-Web);@(Stage-Core);$(WebSitesFolder)\PackageIndexReferenceImplementation\**\*"/>
|
||||||
|
|
||||||
|
<Stage-Modules Include="$(WebSitesFolder)\**\*" Exclude="@(Stage-Bin-Exclude);@(Stage-Module-Exclude)" />
|
||||||
|
<Stage-Modules-Binaries Include="$(WebSitesFolder)\**\bin\**\*" Exclude="@(Stage-Module-Exclude)"/>
|
||||||
|
<Stage-Modules-Sources Include="$(ModulesSrcFolder)\**\*.csproj;$(ModulesSrcFolder)\**\*.cs"/>
|
||||||
|
<Stage-License Include="$(MSBuildProjectDirectory)\*.txt" />
|
||||||
|
</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. -->
|
||||||
|
<FilterModuleBinaries
|
||||||
|
ModulesBinaries="@(Stage-Modules-Binaries)"
|
||||||
|
OrchardWebBinaries="@(Stage-Orchard-Web-Bins)">
|
||||||
|
<Output TaskParameter="ExcludedBinaries" ItemName="FilterModuleBinaries-ExcludedBinaries"/>
|
||||||
|
</FilterModuleBinaries>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Stage-Modules-Binaries-Unique Include="@(Stage-Modules-Binaries)" Exclude="@(FilterModuleBinaries-ExcludedBinaries)"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<Copy SourceFiles="@(Stage-Web);@(Stage-License)" DestinationFolder="$(StageFolder)\%(RecursiveDir)" />
|
<Copy SourceFiles="@(Stage-Web);@(Stage-License)" DestinationFolder="$(StageFolder)\%(RecursiveDir)" />
|
||||||
<Copy SourceFiles="@(Stage-SqlCe-Native-Binaries-x86)" DestinationFolder="$(StageFolder)\bin\x86" />
|
<Copy SourceFiles="@(Stage-SqlCe-Native-Binaries-x86)" DestinationFolder="$(StageFolder)\bin\x86" />
|
||||||
<Copy SourceFiles="@(Stage-SqlCe-Native-Binaries-amd64)" DestinationFolder="$(StageFolder)\bin\amd64" />
|
<Copy SourceFiles="@(Stage-SqlCe-Native-Binaries-amd64)" DestinationFolder="$(StageFolder)\bin\amd64" />
|
||||||
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(StageFolder)\Core\%(RecursiveDir)" />
|
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(StageFolder)\Core\%(RecursiveDir)" />
|
||||||
<Copy SourceFiles="@(Stage-Modules)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)" />
|
<Copy SourceFiles="@(Stage-Modules)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)" />
|
||||||
|
<Copy SourceFiles="@(Stage-Modules-Sources)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)" />
|
||||||
|
<Copy SourceFiles="@(Stage-Modules-Binaries-Unique)" DestinationFolder="$(StageFolder)\Modules\%(RecursiveDir)" />
|
||||||
|
|
||||||
<!-- extra processing of the staged csproj file -->
|
<!-- extra processing of the staged csproj file -->
|
||||||
<StageProjectAlteration ProjectFileName="$(StageFolder)\Orchard.Web.csproj" AddContentFiles="
|
<StageProjectAlteration ProjectFileName="$(StageFolder)\Orchard.Web.csproj" AddContentFiles="
|
||||||
@ -144,7 +160,7 @@
|
|||||||
<!-- Packaging (MsDeploy) -->
|
<!-- Packaging (MsDeploy) -->
|
||||||
<Target Name="Package-MsDeploy">
|
<Target Name="Package-MsDeploy">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\*.pdb" />
|
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.xml" />
|
||||||
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml"/>
|
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
30
src/Tools/MSBuild.Orchard.Tasks/FilterModuleBinaries.cs
Normal file
30
src/Tools/MSBuild.Orchard.Tasks/FilterModuleBinaries.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Microsoft.Build.Framework;
|
||||||
|
using Microsoft.Build.Utilities;
|
||||||
|
|
||||||
|
namespace MSBuild.Orchard.Tasks {
|
||||||
|
public class FilterModuleBinaries : Task {
|
||||||
|
public ITaskItem[] ModulesBinaries { get; set; }
|
||||||
|
public ITaskItem[] OrchardWebBinaries { get; set; }
|
||||||
|
|
||||||
|
[Output]
|
||||||
|
public ITaskItem[] ExcludedBinaries { get; set; }
|
||||||
|
|
||||||
|
public override bool Execute() {
|
||||||
|
|
||||||
|
var orchardWebAssemblies = new HashSet<string>(
|
||||||
|
OrchardWebBinaries.Select(item => Path.GetFileName(item.ItemSpec)),
|
||||||
|
StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
|
ExcludedBinaries = ModulesBinaries
|
||||||
|
.Where(item => orchardWebAssemblies.Contains(Path.GetFileName(item.ItemSpec)))
|
||||||
|
.Select(item => new TaskItem(item))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -66,6 +66,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="FilterModuleBinaries.cs" />
|
||||||
<Compile Include="StageProjectAlteration.cs" />
|
<Compile Include="StageProjectAlteration.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user