mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
154 lines
5.6 KiB
XML
154 lines
5.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<!-- Initialization -->
|
|
|
|
<PropertyGroup>
|
|
<LibFolder>$(MSBuildProjectDirectory)\lib</LibFolder>
|
|
<SrcFolder>$(MSBuildProjectDirectory)\src</SrcFolder>
|
|
<BuildFolder>$(MSBuildProjectDirectory)\build</BuildFolder>
|
|
<ArtifactsFolder>$(MSBuildProjectDirectory)\artifacts\Azure</ArtifactsFolder>
|
|
|
|
<CompileFolder>$(BuildFolder)\Compile</CompileFolder>
|
|
<ServiceFolder>$(CompileFolder)\Orchard.Azure.CloudService.csx</ServiceFolder>
|
|
<CloudRootFolder>$(ServiceFolder)\roles\Orchard.Azure.Web\approot</CloudRootFolder>
|
|
<WebSitesFolder>$(CompileFolder)\_PublishedWebsites</WebSitesFolder>
|
|
<StageFolder>$(BuildFolder)\Stage</StageFolder>
|
|
|
|
</PropertyGroup>
|
|
|
|
<Import Project="$(LibFolder)\msbuild\MSBuild.Community.Tasks.Targets"/>
|
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets" />
|
|
|
|
<!-- Coordinating Targets -->
|
|
|
|
<Target Name ="Build">
|
|
<CallTarget Targets="Clean"/>
|
|
<CallTarget Targets="Compile"/>
|
|
<CallTarget Targets="Test"/>
|
|
<CallTarget Targets="Package"/>
|
|
</Target>
|
|
|
|
<Target Name="Package">
|
|
<CallTarget Targets="Package-ForCloud"/>
|
|
<CallTarget Targets="Package-Stage"/>
|
|
<CallTarget Targets="Package-Zip"/>
|
|
</Target>
|
|
|
|
|
|
<!-- Building -->
|
|
|
|
<Target Name="Clean">
|
|
<MSBuild Projects="$(SrcFolder)\Orchard.sln" Targets="Clean" />
|
|
<MSBuild Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService.sln" Targets="Clean" />
|
|
<RemoveDir Directories="$(BuildFolder)" />
|
|
</Target>
|
|
|
|
<Target Name ="Compile">
|
|
<MSBuild
|
|
Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService.sln"
|
|
Targets="Build"
|
|
Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64" />
|
|
|
|
<MSBuild
|
|
Projects="$(SrcFolder)\Orchard.Azure.sln"
|
|
Targets="Build"
|
|
Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64" />
|
|
|
|
</Target>
|
|
|
|
|
|
<!-- Testing - Azure only -->
|
|
|
|
<Target Name ="Test">
|
|
<Message Text="Testing with x64 version of Sqlite"/>
|
|
|
|
<CreateItem Include="$(CompileFolder)\*Azure.Tests.*dll">
|
|
<Output TaskParameter="Include" ItemName="TestAssemblies" />
|
|
</CreateItem>
|
|
|
|
<!-- use x64 sqlite for tests depending on build platform -->
|
|
<Copy
|
|
SourceFiles="$(LibFolder)\sqlite\x64\System.Data.SQLite.dll"
|
|
DestinationFiles="$(CompileFolder)\System.Data.SQLite.dll" />
|
|
|
|
<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" />
|
|
|
|
</Target>
|
|
|
|
<Target Name ="Spec">
|
|
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
|
|
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
|
|
</CreateItem>
|
|
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="$(LibFolder)\nunit" />
|
|
</Target>
|
|
|
|
<!-- Packaging -->
|
|
|
|
<Target Name="Package-ForCloud">
|
|
|
|
<ItemGroup>
|
|
<Excluded Include="$(SrcFolder)\**\bin\**\*;$(SrcFolder)\**\obj\**\*;$(SrcFolder)\**\*.cs;$(SrcFolder)\**\*.csproj*;" />
|
|
|
|
<Stage-Themes Include="$(SrcFolder)\Orchard.Web\Themes\**\*" Exclude="@(Excluded)" />
|
|
<Stage-Core Include="$(SrcFolder)\Orchard.Web\Core\**\*" Exclude="@(Excluded)" />
|
|
<Stage-Modules Include="$(SrcFolder)\Orchard.Web\Modules\**\*" Exclude="@(Excluded)" />
|
|
</ItemGroup>
|
|
|
|
<Copy SourceFiles="@(Stage-Themes)" DestinationFolder="$(CloudRootFolder)\Themes\%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(Stage-Core)" DestinationFolder="$(CloudRootFolder)\Core\%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(Stage-Modules)" DestinationFolder="$(CloudRootFolder)\Modules\%(RecursiveDir)" />
|
|
|
|
<Delete Files="$(CloudRootFolder)\App_Data" />
|
|
|
|
<ItemGroup>
|
|
<WebConfigs Include="$(CloudRootFolder)\Modules\*\web.config" />
|
|
</ItemGroup>
|
|
|
|
<Delete Files="@(WebConfigs)" />
|
|
|
|
<!-- extra processing of the staged config files -->
|
|
<!--<XmlUpdate XmlFileName="$(CloudRootFolder)\web.config"
|
|
XPath="/configuration/system.web/compilation/@debug"
|
|
Value="false" />
|
|
|
|
<XmlUpdate XmlFileName="$(CloudRootFolder)\Config\Diagnostics.config"
|
|
XPath="/system.diagnostics/trace/@autoflush"
|
|
Value="false" />
|
|
|
|
<XmlUpdate XmlFileName="$(CloudRootFolder)\Config\Diagnostics.config"
|
|
XPath="/system.diagnostics/sources/source/@switchValue"
|
|
Value="Error" />
|
|
-->
|
|
|
|
<Copy
|
|
SourceFiles="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService\ServiceConfiguration.cscfg"
|
|
DestinationFolder="$(StageFolder)"
|
|
/>
|
|
|
|
<Copy
|
|
SourceFiles="$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService\Properties.txt"
|
|
DestinationFolder="$(ServiceFolder)"
|
|
/>
|
|
|
|
</Target>
|
|
|
|
<Target Name="Package-Stage">
|
|
|
|
<Exec
|
|
Command=""$(ServiceHostingSDKBinDir)cspack" "$(ServiceFolder)\ServiceDefinition.csdef" /role:Orchard.Azure.Web;"$(CloudRootFolder)";Orchard.Azure.Web.dll /rolePropertiesFile:Orchard.Azure.Web;"$(ServiceFolder)\Properties.txt" /out:"$(StageFolder)\Orchard.Azure.Web.cspkg""
|
|
WorkingDirectory="$(CloudRootFolder)"
|
|
/>
|
|
|
|
</Target>
|
|
|
|
<Target Name="Package-Zip">
|
|
<ItemGroup>
|
|
<Zip-Stage Include="$(StageFolder)\ServiceConfiguration.cscfg;$(StageFolder)\Orchard.Azure.Web.cspkg" />
|
|
</ItemGroup>
|
|
|
|
<MakeDir Directories="$(ArtifactsFolder)" />
|
|
<Zip Files="@(Zip-Stage)" WorkingDirectory="$(StageFolder)" ZipFileName="$(ArtifactsFolder)\AzurePackage.zip" />
|
|
</Target>
|
|
</Project>
|