mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00

The AzureBlobStorageProvider components must be registered as a per-lifetime-scope in the "Shell" container, not in the "Host" container. This is why it must be registered in the "Config/Sites.Config" file instead of the "Config/Host.config" files. This also allows us to remove the "AZURE" compilation directive from Orchard.Framework implementation. All in all, this ensures that the files stored in the "Media" folder are stored in the Azure Blob Storage even when running locally in Visual Studio. --HG-- branch : dev extra : transplant_source : %3E%E2%82g%18M%AB%26xi%CA%19%99H%3A%A0%20%F0%B2F
156 lines
6.0 KiB
XML
156 lines
6.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<!-- Initialization -->
|
|
|
|
<PropertyGroup>
|
|
<LibFolder>$(MSBuildProjectDirectory)\lib</LibFolder>
|
|
<SrcFolder>$(MSBuildProjectDirectory)\src</SrcFolder>
|
|
<BuildFolder>$(MSBuildProjectDirectory)\buildazure</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\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 ="CIBuild">
|
|
<CallTarget Targets="Clean"/>
|
|
<CallTarget Targets="Compile"/>
|
|
<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)" ContinueOnError="true" />
|
|
</Target>
|
|
|
|
<Target Name ="Compile">
|
|
<MSBuild
|
|
Projects="$(SrcFolder)\Orchard.Azure\Orchard.Azure.sln"
|
|
Targets="Build"
|
|
Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64"
|
|
/>
|
|
|
|
<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=""$(ServiceHostingSDKBinDir)cspack" "$(SrcFolder)\Orchard.Azure\Orchard.Azure.CloudService\ServiceDefinition.build.csdef" /role:Orchard.Azure.Web;"$(CloudRootFolder)";Orchard.Azure.Web.dll /sites:Orchard.Azure.Web;Web;"$(CloudRootFolder)" /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>
|