Orchard/AzurePackage.proj
Renaud Paquay 4dd978f304 Update the way we copy c++ run time for SqlCe
--HG--
branch : 1.x
2011-01-12 00:47:26 -08:00

151 lines
5.9 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>
<MsBuildTasksFolder>$(MSBuildProjectDirectory)\buildtasks</MsBuildTasksFolder>
<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\1.0\Visual Studio 10.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-SqlCe" />
<CallTarget Targets="Package-Stage"/>
<CallTarget Targets="Package-Zip"/>
</Target>
<!-- Building -->
<Target Name="Clean">
<MSBuild Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.sln" Targets="Clean" />
<RemoveDir Directories="$(BuildFolder)" />
</Target>
<Target Name ="Compile">
<MSBuild
Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.sln"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64;DefineConstants=AZURE"
/>
<MSBuild
Projects="$(SrcFolder)\Orchard.Azure.Tests\Orchard.Azure.Tests.sln"
Targets="Build"
Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64" />
</Target>
<!-- Testing - Azure only -->
<Target Name ="Test">
<CreateItem Include="$(CompileFolder)\*Azure.Tests.*dll">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>
<NUnit Assemblies="@(TestAssemblies)" ToolPath="$(LibFolder)\nunit" WorkingDirectory="$(CompileFolder)" />
</Target>
<!-- Packaging -->
<Target Name="Package-ForCloud">
<ItemGroup>
<Excluded Include="$(SrcFolder)\**\bin\**\*;$(SrcFolder)\**\obj\**\*;" />
<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;$(CloudRootFolder)\Core\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\log4net.config"
XPath="/log4net/appender/immediateFlush/@value"
Value="false" />
<XmlUpdate XmlFileName="$(CloudRootFolder)\Config\log4net.config"
XPath="/log4net/logger/priority/@value"
Value="ERROR" />
<XmlUpdate XmlFileName="$(CloudRootFolder)\Config\log4net.config"
XPath="/log4net/root/priority/@value"
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-SqlCe">
<ItemGroup>
<SqlCeBinariesx86 Include="$(LibFolder)\sqlce\x86\**\*" />
<SqlCeBinariesx64 Include="$(LibFolder)\sqlce\amd64\**\*" />
</ItemGroup>
<Copy SourceFiles="@(SqlCeBinariesx86)" DestinationFolder="$(CloudRootFolder)\bin\x86\%(RecursiveDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(SqlCeBinariesx64)" DestinationFolder="$(CloudRootFolder)\bin\amd64\%(RecursiveDir)" SkipUnchangedFiles="true" />
</Target>
<Target Name="Package-Stage">
<Exec
Command="&quot;$(ServiceHostingSDKBinDir)cspack&quot; &quot;$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService\ServiceDefinition.build.csdef&quot; /role:Orchard.Azure.Web;&quot;$(CloudRootFolder)&quot;;Orchard.Azure.Web.dll /sites:Orchard.Azure.Web;Web;&quot;$(CloudRootFolder)&quot; /rolePropertiesFile:Orchard.Azure.Web;&quot;$(ServiceFolder)\Properties.txt&quot; /out:&quot;$(StageFolder)\Orchard.Azure.Web.cspkg&quot;"
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>