2010-02-07 12:10:12 +08:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2010-07-19 03:21:36 +08:00
|
|
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
2010-02-07 12:10:12 +08:00
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<!-- Initialization -->
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<LibFolder>$(MSBuildProjectDirectory)\lib</LibFolder>
|
|
|
|
<SrcFolder>$(MSBuildProjectDirectory)\src</SrcFolder>
|
|
|
|
<BuildFolder>$(MSBuildProjectDirectory)\build</BuildFolder>
|
2010-07-17 03:56:10 +08:00
|
|
|
<SqlCeFolder>$(MSBuildProjectDirectory)\lib\sqlce</SqlCeFolder>
|
2010-07-17 04:03:40 +08:00
|
|
|
<SourceArtifactFolder>$(MSBuildProjectDirectory)\artifacts\Source</SourceArtifactFolder>
|
|
|
|
<MsDeployArtifactFolder>$(MSBuildProjectDirectory)\artifacts\MsDeploy</MsDeployArtifactFolder>
|
2010-07-17 05:22:38 +08:00
|
|
|
<ModulesSrcFolder>$(MSBuildProjectDirectory)\src\Orchard.Web\Modules</ModulesSrcFolder>
|
2010-07-13 11:16:34 +08:00
|
|
|
|
|
|
|
<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
|
|
|
|
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
|
|
|
|
<StageFolder>$(BuildFolder)\Stage</StageFolder>
|
2010-07-17 03:56:10 +08:00
|
|
|
<MsDeployFolder>$(BuildFolder)\MsDeploy</MsDeployFolder>
|
2010-07-13 11:16:34 +08:00
|
|
|
<ProfilingFolder>$(BuildFolder)\Profiling</ProfilingFolder>
|
|
|
|
|
|
|
|
<BuildPlatform Condition="$(ProgramW6432) != ''">x64</BuildPlatform>
|
|
|
|
<BuildPlatform Condition="$(BuildPlatform) == ''">x86</BuildPlatform>
|
|
|
|
</PropertyGroup>
|
2010-02-07 12:10:12 +08:00
|
|
|
|
2010-02-07 12:35:45 +08:00
|
|
|
<Import Project="$(LibFolder)\msbuild\MSBuild.Community.Tasks.Targets"/>
|
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<!-- Coordinating Targets -->
|
2010-02-07 12:10:12 +08:00
|
|
|
|
|
|
|
<Target Name ="Build">
|
|
|
|
<CallTarget Targets="Clean"/>
|
|
|
|
<CallTarget Targets="Compile"/>
|
2010-02-07 13:20:38 +08:00
|
|
|
<CallTarget Targets="Test"/>
|
2010-02-07 12:35:45 +08:00
|
|
|
<CallTarget Targets="Package"/>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="Package">
|
|
|
|
<CallTarget Targets="Package-Stage"/>
|
2010-07-17 03:56:10 +08:00
|
|
|
<CallTarget Targets="Package-MsDeploy"/>
|
2010-02-07 12:35:45 +08:00
|
|
|
<CallTarget Targets="Package-Zip"/>
|
2010-02-07 12:10:12 +08:00
|
|
|
</Target>
|
|
|
|
|
2010-05-07 03:53:27 +08:00
|
|
|
<Target Name="Profiling">
|
|
|
|
<CallTarget Targets="Clean"/>
|
|
|
|
<CallTarget Targets="Compile"/>
|
|
|
|
<CallTarget Targets="Package-Stage"/>
|
|
|
|
<CallTarget Targets="Profiling-Stage"/>
|
|
|
|
<CallTarget Targets="Profiling-Setup"/>
|
|
|
|
</Target>
|
|
|
|
|
2010-02-07 12:10:12 +08:00
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<!-- Building -->
|
2010-02-07 12:35:45 +08:00
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<Target Name="Clean">
|
|
|
|
<MSBuild Projects="$(SrcFolder)\Orchard.sln" Targets="Clean" />
|
|
|
|
<RemoveDir Directories="$(BuildFolder)" />
|
|
|
|
</Target>
|
2010-02-07 12:10:12 +08:00
|
|
|
|
|
|
|
<Target Name ="Compile">
|
|
|
|
<MSBuild
|
|
|
|
Projects="$(SrcFolder)\Orchard.sln"
|
|
|
|
Targets="Build"
|
2010-07-13 11:16:34 +08:00
|
|
|
Properties="Configuration=Release;OutputPath=$(CompileFolder)" />
|
2010-02-07 12:10:12 +08:00
|
|
|
</Target>
|
|
|
|
|
2010-02-07 12:35:45 +08:00
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<!-- Testing -->
|
2010-02-07 13:20:38 +08:00
|
|
|
|
|
|
|
<Target Name ="Test">
|
2010-07-13 12:45:53 +08:00
|
|
|
<!-- TeamCity support -->
|
|
|
|
<ItemGroup>
|
|
|
|
<NUnitAddinFiles Include="$(teamcity_dotnet_nunitaddin)-2.5.2.*" />
|
|
|
|
</ItemGroup>
|
2010-07-14 13:04:02 +08:00
|
|
|
<Copy SourceFiles="@(NUnitAddinFiles)" DestinationFolder="$(LibFolder)\nunit\addins" />
|
2010-07-13 12:45:53 +08:00
|
|
|
|
2010-07-14 13:04:02 +08:00
|
|
|
<!-- Run unit test assemblies -->
|
2010-07-13 11:16:34 +08:00
|
|
|
<CreateItem Include="$(CompileFolder)\*.Tests.*dll">
|
|
|
|
<Output TaskParameter="Include" ItemName="TestAssemblies" />
|
|
|
|
</CreateItem>
|
2010-04-06 04:30:02 +08:00
|
|
|
|
2010-07-14 13:04:02 +08:00
|
|
|
<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" />
|
2010-02-07 13:20:38 +08:00
|
|
|
</Target>
|
|
|
|
|
2010-04-06 04:30:02 +08:00
|
|
|
<Target Name ="Spec">
|
2010-07-13 11:16:34 +08:00
|
|
|
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
|
|
|
|
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
|
|
|
|
</CreateItem>
|
|
|
|
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="$(LibFolder)\nunit" />
|
2010-04-06 04:30:02 +08:00
|
|
|
</Target>
|
2010-02-07 13:20:38 +08:00
|
|
|
|
2010-07-17 03:56:10 +08:00
|
|
|
<!-- Packaging (Stage) -->
|
2010-02-08 17:09:38 +08:00
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<UsingTask AssemblyFile="$(CompileFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.StageProjectAlteration" />
|
2010-07-17 09:17:34 +08:00
|
|
|
<UsingTask AssemblyFile="$(CompileFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FilterModuleBinaries" />
|
2010-02-08 17:09:38 +08:00
|
|
|
|
2010-02-07 12:35:45 +08:00
|
|
|
<Target Name="Package-Stage">
|
2010-02-07 12:10:12 +08:00
|
|
|
<ItemGroup>
|
2010-07-19 03:21:36 +08:00
|
|
|
<SqlCe-Native-Binaries-x86 Include="$(SqlCeFolder)\x86\*"/>
|
|
|
|
<SqlCe-Native-Binaries-amd64 Include="$(SqlCeFolder)\amd64\*"/>
|
2010-07-17 05:22:38 +08:00
|
|
|
<Stage-Orchard-Web-Bins Include="$(WebSitesFolder)\Orchard.Web\bin\*"/>
|
2010-02-07 12:10:12 +08:00
|
|
|
<Stage-Bin-Exclude Include="$(WebSitesFolder)\**\bin\**\*" />
|
2010-02-08 17:09:38 +08:00
|
|
|
<Stage-Web Include="$(WebSitesFolder)\Orchard.Web\**\*;$(SrcFolder)\Orchard.Web\*.csproj" />
|
2010-07-17 09:17:34 +08:00
|
|
|
<Stage-Core Include="$(WebSitesFolder)\Orchard.Core\**\*" Exclude="$(WebSitesFolder)\Orchard.Core\**\bin\**\*" />
|
2010-07-19 03:21:36 +08:00
|
|
|
|
2010-07-17 09:17:34 +08:00
|
|
|
<Stage-Module-Exclude Include="@(Stage-Web);@(Stage-Core);$(WebSitesFolder)\PackageIndexReferenceImplementation\**\*"/>
|
2010-07-19 03:21:36 +08:00
|
|
|
|
2010-07-17 09:17:34 +08:00
|
|
|
<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"/>
|
2010-02-07 13:20:38 +08:00
|
|
|
<Stage-License Include="$(MSBuildProjectDirectory)\*.txt" />
|
2010-02-07 12:10:12 +08:00
|
|
|
</ItemGroup>
|
|
|
|
|
2010-07-17 09:17:34 +08:00
|
|
|
<!-- 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>
|
|
|
|
|
2010-07-19 03:21:36 +08:00
|
|
|
<Copy SourceFiles="@(Stage-Web);@(Stage-License)" DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
|
|
|
|
<Copy SourceFiles="@(SqlCe-Native-Binaries-x86)" DestinationFolder="$(StageFolder)\bin\x86"/>
|
|
|
|
<Copy SourceFiles="@(SqlCe-Native-Binaries-amd64)" DestinationFolder="$(StageFolder)\bin\amd64"/>
|
|
|
|
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(StageFolder)\Core\%(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)"/>
|
2010-02-08 17:09:38 +08:00
|
|
|
|
|
|
|
<!-- extra processing of the staged csproj file -->
|
2010-07-17 03:56:10 +08:00
|
|
|
<StageProjectAlteration ProjectFileName="$(StageFolder)\Orchard.Web.csproj" AddContentFiles="
|
2010-02-08 17:09:38 +08:00
|
|
|
@(Stage-Modules->'Modules\%(RecursiveDir)%(Filename)%(Extension)');
|
|
|
|
@(Stage-Core->'Core\%(RecursiveDir)%(Filename)%(Extension)')">
|
|
|
|
<Output TaskParameter="ExtraFiles" ItemName="StageProjectAlteration-ExtraFiles"/>
|
|
|
|
</StageProjectAlteration>
|
|
|
|
|
2010-05-19 05:05:11 +08:00
|
|
|
<!-- extra processing of the staged config files -->
|
|
|
|
|
2010-07-17 03:56:10 +08:00
|
|
|
<XmlUpdate XmlFileName="$(StageFolder)\web.config"
|
2010-05-19 05:05:11 +08:00
|
|
|
XPath="/configuration/system.web/compilation/@debug"
|
|
|
|
Value="false" />
|
|
|
|
|
2010-07-17 03:56:10 +08:00
|
|
|
<XmlUpdate XmlFileName="$(StageFolder)\Config\Diagnostics.config"
|
2010-05-19 05:05:11 +08:00
|
|
|
XPath="/system.diagnostics/trace/@autoflush"
|
|
|
|
Value="false" />
|
|
|
|
|
2010-07-17 03:56:10 +08:00
|
|
|
<XmlUpdate XmlFileName="$(StageFolder)\Config\Diagnostics.config"
|
2010-05-19 05:05:11 +08:00
|
|
|
XPath="/system.diagnostics/sources/source/@switchValue"
|
|
|
|
Value="Error" />
|
|
|
|
|
2010-02-08 17:09:38 +08:00
|
|
|
<!-- move over extra non-content files the csproj referenced -->
|
2010-07-13 11:16:34 +08:00
|
|
|
<Copy SourceFiles="@(StageProjectAlteration-ExtraFiles->'$(SrcFolder)\Orchard.Web\%(Identity)')"
|
2010-07-17 03:56:10 +08:00
|
|
|
DestinationFolder="$(StageFolder)\%(RecursiveDir)"/>
|
2010-02-08 17:09:38 +08:00
|
|
|
|
2010-02-07 12:10:12 +08:00
|
|
|
</Target>
|
|
|
|
|
2010-07-17 03:56:10 +08:00
|
|
|
<!-- Packaging (MsDeploy) -->
|
|
|
|
<Target Name="Package-MsDeploy">
|
|
|
|
<ItemGroup>
|
2010-07-19 03:21:36 +08:00
|
|
|
<!--<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.pdb;$(StageFolder)\**\bin\**\*.xml" />-->
|
|
|
|
<MsDeploy-Folder-Input Include="$(StageFolder)\**\*" Exclude="$(StageFolder)\**\bin\**\*.xml" />
|
2010-07-17 03:56:10 +08:00
|
|
|
<MsDeploy-Parameters Include="$(LibFolder)\msdeploy\*.xml"/>
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Copy SourceFiles="@(MsDeploy-Folder-Input)"
|
|
|
|
DestinationFolder="$(MsDeployFolder)\Orchard\%(RecursiveDir)"/>
|
|
|
|
<Copy SourceFiles="@(MsDeploy-Parameters)"
|
|
|
|
DestinationFolder="$(MsDeployFolder)"/>
|
|
|
|
</Target>
|
|
|
|
|
2010-02-07 12:35:45 +08:00
|
|
|
<Target Name="Package-Zip">
|
|
|
|
<ItemGroup>
|
2010-02-07 13:20:38 +08:00
|
|
|
<Zip-Exclude Include="
|
|
|
|
$(MSBuildProjectDirectory)\src\**\bin\**\*;
|
|
|
|
$(MSBuildProjectDirectory)\src\**\obj\**\*;
|
|
|
|
$(MSBuildProjectDirectory)\**\App_Data\**\*;
|
|
|
|
$(MSBuildProjectDirectory)\**\_ReSharper*\**\*;
|
|
|
|
$(MSBuildProjectDirectory)\**\*.sln.cache;
|
|
|
|
$(MSBuildProjectDirectory)\**\*.suo;
|
|
|
|
$(MSBuildProjectDirectory)\**\*.user;
|
|
|
|
$(MSBuildProjectDirectory)\**\*.patch;
|
|
|
|
$(MSBuildProjectDirectory)\**\*.hg;
|
|
|
|
" />
|
2010-07-13 11:16:34 +08:00
|
|
|
|
2010-02-07 12:35:45 +08:00
|
|
|
<Zip-Stage Include="$(StageFolder)\**\*" />
|
2010-07-13 11:16:34 +08:00
|
|
|
|
2010-07-17 03:56:10 +08:00
|
|
|
<Zip-MsDeploy Include="$(MsDeployFolder)\**\*" />
|
|
|
|
|
2010-02-07 13:20:38 +08:00
|
|
|
<Zip-Source Include="
|
|
|
|
$(MSBuildProjectDirectory)\lib\**\*;
|
|
|
|
$(MSBuildProjectDirectory)\src\**\*;
|
|
|
|
$(MSBuildProjectDirectory)\*.txt;
|
|
|
|
" Exclude="@(Zip-Exclude)" />
|
2010-07-13 11:16:34 +08:00
|
|
|
|
2010-02-07 12:35:45 +08:00
|
|
|
</ItemGroup>
|
|
|
|
|
2010-07-17 04:03:40 +08:00
|
|
|
<MakeDir Directories="$(MsDeployArtifactFolder);$(SourceArtifactFolder)"/>
|
2010-05-15 03:24:08 +08:00
|
|
|
|
2010-07-17 04:03:40 +08:00
|
|
|
<Zip Files="@(Zip-MsDeploy)" WorkingDirectory="$(MsDeployFolder)" ZipFileName="$(MsDeployArtifactFolder)\Orchard.Web.zip" />
|
|
|
|
<Zip Files="@(Zip-Source)" WorkingDirectory="$(MSBuildProjectDirectory)" ZipFileName="$(SourceArtifactFolder)\Orchard.Source.zip" />
|
2010-02-07 12:35:45 +08:00
|
|
|
</Target>
|
|
|
|
|
2010-07-13 11:16:34 +08:00
|
|
|
<!-- Profiling -->
|
2010-05-07 03:53:27 +08:00
|
|
|
|
|
|
|
<Target Name="Profiling-Stage">
|
|
|
|
<ItemGroup>
|
2010-07-17 03:56:10 +08:00
|
|
|
<Profiling-Web Include="$(StageFolder)\**\*" />
|
2010-05-07 03:53:27 +08:00
|
|
|
</ItemGroup>
|
2010-07-13 11:16:34 +08:00
|
|
|
|
2010-05-07 03:53:27 +08:00
|
|
|
<Copy SourceFiles="@(Profiling-Web)" DestinationFolder="$(ProfilingFolder)\%(RecursiveDir)"/>
|
2010-07-13 11:16:34 +08:00
|
|
|
|
2010-05-07 03:53:27 +08:00
|
|
|
</Target>
|
2010-07-13 11:16:34 +08:00
|
|
|
|
2010-05-07 03:53:27 +08:00
|
|
|
<Target Name="Profiling-Setup">
|
|
|
|
<Exec Command="$(ProfilingFolder)\bin\Orchard.exe @$(SrcFolder)\Orchard.Profile\profiling-setup-commands.txt" WorkingDirectory="$(ProfilingFolder)"/>
|
|
|
|
</Target>
|
|
|
|
|
2010-02-07 12:10:12 +08:00
|
|
|
</Project>
|
2010-05-07 03:53:27 +08:00
|
|
|
|