mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
#17793: Removing Orchard.Web.cspoj from msdeploy
Work Items: 17793 --HG-- branch : 1.x
This commit is contained in:
parent
52d5a2695c
commit
4bd3157fe9
10
Orchard.proj
10
Orchard.proj
@ -140,7 +140,6 @@
|
||||
|
||||
<!-- Packaging (Stage) -->
|
||||
|
||||
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.StageProjectAlteration" />
|
||||
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FilterModuleBinaries" />
|
||||
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.FileUpdateLines" />
|
||||
<UsingTask AssemblyFile="$(MsBuildTasksFolder)\MSBuild.Orchard.Tasks.dll" TaskName="MSBuild.Orchard.Tasks.ValidateExtensionProjectFiles" />
|
||||
@ -155,7 +154,7 @@
|
||||
<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-Web Include="$(WebSitesFolder)\Orchard.Web\**\*;$(SrcFolder)\Orchard.Web\*.csproj;" Exclude="$(SrcFolder)\Orchard.Web\Orchard.Web.csproj"/>
|
||||
<Stage-Web-Config Include="$(SrcFolder)\Orchard.Web\**\*.config" />
|
||||
<Stage-Media Include="$(SrcFolder)\Orchard.Web\Media\OrchardLogo.png" />
|
||||
<Stage-PoFiles Include="$(SrcFolder)\Orchard.Web\**\*.po" />
|
||||
@ -205,13 +204,6 @@
|
||||
<WriteLinesToFile File="$(StageFolder)\App_Data\_marker.txt" Lines="some_text" Overwrite="true"/>
|
||||
|
||||
|
||||
<!-- extra processing of the staged csproj file -->
|
||||
<StageProjectAlteration ProjectFileName="$(StageFolder)\Orchard.Web.csproj" AddContentFiles="
|
||||
@(Stage-Modules->'Modules\%(RecursiveDir)%(Filename)%(Extension)');
|
||||
@(Stage-Core->'Core\%(RecursiveDir)%(Filename)%(Extension)')">
|
||||
<Output TaskParameter="ExtraFiles" ItemName="StageProjectAlteration-ExtraFiles"/>
|
||||
</StageProjectAlteration>
|
||||
|
||||
<!-- extra processing of the staged config files -->
|
||||
|
||||
<XmlUpdate XmlFileName="$(StageFolder)\web.config"
|
||||
|
@ -28,8 +28,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Setup", "Orchard.We
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSBuild.Orchard.Tasks", "Tools\MSBuild.Orchard.Tasks\MSBuild.Orchard.Tasks.csproj", "{5E5E7A21-C7B2-44D8-8593-2F9541AE041D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSBuild.Orchard.Tasks.Tests", "Tools\MSBuild.Orchard.Tasks.Tests\MSBuild.Orchard.Tasks.Tests.csproj", "{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Specs", "Orchard.Specs\Orchard.Specs.csproj", "{7354DF37-934B-46CF-A13C-455D5F5F5413}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard", "Tools\Orchard\Orchard.csproj", "{33B1BC8D-E292-4972-A363-22056B207156}"
|
||||
@ -235,16 +233,6 @@ Global
|
||||
{5E5E7A21-C7B2-44D8-8593-2F9541AE041D}.FxCop|Any CPU.Build.0 = Release|Any CPU
|
||||
{5E5E7A21-C7B2-44D8-8593-2F9541AE041D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5E5E7A21-C7B2-44D8-8593-2F9541AE041D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.Coverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.FxCop|Any CPU.Build.0 = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7354DF37-934B-46CF-A13C-455D5F5F5413}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7354DF37-934B-46CF-A13C-455D5F5F5413}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{7354DF37-934B-46CF-A13C-455D5F5F5413}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -661,7 +649,6 @@ Global
|
||||
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
{2FC1D9C8-446D-4414-B252-5E9FBE61EB63} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
{5E5E7A21-C7B2-44D8-8593-2F9541AE041D} = {383DBA32-4A3E-48D1-AAC3-75377A694452}
|
||||
{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56} = {383DBA32-4A3E-48D1-AAC3-75377A694452}
|
||||
{33B1BC8D-E292-4972-A363-22056B207156} = {383DBA32-4A3E-48D1-AAC3-75377A694452}
|
||||
{0DFA2E10-96C8-4E05-BC10-B710B97ECCDE} = {383DBA32-4A3E-48D1-AAC3-75377A694452}
|
||||
{94E694A2-D140-468D-A277-C5FCE1D13E9B} = {3E10BF6D-ADA5-417D-B36C-EBB0660B475E}
|
||||
|
@ -1,125 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MSBuild.Orchard.Tasks.Tests</RootNamespace>
|
||||
<AssemblyName>MSBuild.Orchard.Tasks.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Build.Framework" />
|
||||
<Reference Include="Microsoft.Build.Utilities.v4.0" />
|
||||
<Reference Include="Moq, Version=4.0.812.4, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\moq\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\nunit\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="StageProjectAlterationTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TestData\TestDataFiles.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MSBuild.Orchard.Tasks\MSBuild.Orchard.Tasks.csproj">
|
||||
<Project>{5E5E7A21-C7B2-44D8-8593-2F9541AE041D}</Project>
|
||||
<Name>MSBuild.Orchard.Tasks</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="TestData\SimpleWebProject.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="TestData\ProjectReferences.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="TestData\ExtraFiles.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@ -1,34 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MSBuild.Orchard.Tasks.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Orchard")]
|
||||
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("db4cb512-5c00-44c9-9173-7ede47af1967")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.20")]
|
||||
[assembly: AssemblyFileVersion("1.0.20")]
|
@ -1,104 +0,0 @@
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Moq;
|
||||
using MSBuild.Orchard.Tasks.Tests.TestData;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MSBuild.Orchard.Tasks.Tests {
|
||||
[TestFixture]
|
||||
public class StageProjectAlterationTests {
|
||||
private TestDataFiles _testDataFiles;
|
||||
private StageProjectAlteration _task;
|
||||
private string _xmlns = "http://schemas.microsoft.com/developer/msbuild/2003";
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
_testDataFiles = new TestDataFiles();
|
||||
_task = new StageProjectAlteration();
|
||||
|
||||
var engine = new Mock<IBuildEngine>();
|
||||
_task.BuildEngine = engine.Object;
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Term() {
|
||||
_testDataFiles.Dispose();
|
||||
_testDataFiles = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ClassShouldBeCallable() {
|
||||
var result = _task.Execute();
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ProjectFileNameMustExist() {
|
||||
_task.ProjectFileName = "no-such-file.csproj";
|
||||
var result = _task.Execute();
|
||||
Assert.That(result, Is.False);
|
||||
|
||||
_task.ProjectFileName = _testDataFiles.Get("SimpleWebProject.xml");
|
||||
result = _task.Execute();
|
||||
Assert.That(result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ProjectReferencesMustChange() {
|
||||
_task.ProjectFileName = _testDataFiles.Get("ProjectReferences.xml");
|
||||
var before = XDocument.Load(_task.ProjectFileName);
|
||||
var result = _task.Execute();
|
||||
var after = XDocument.Load(_task.ProjectFileName);
|
||||
|
||||
Assert.That(result, Is.True);
|
||||
|
||||
var beforeProjectReferences = before
|
||||
.Elements(XName.Get("Project", _xmlns))
|
||||
.Elements(XName.Get("ItemGroup", _xmlns))
|
||||
.Elements(XName.Get("ProjectReference", _xmlns));
|
||||
|
||||
Assert.That(beforeProjectReferences.Count(), Is.Not.EqualTo(0));
|
||||
|
||||
var afterProjectReferences = after
|
||||
.Elements(XName.Get("Project", _xmlns))
|
||||
.Elements(XName.Get("ItemGroup", _xmlns))
|
||||
.Elements(XName.Get("ProjectReference", _xmlns));
|
||||
|
||||
Assert.That(afterProjectReferences.Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ExtraFilesAreDetected() {
|
||||
_task.ProjectFileName = _testDataFiles.Get("ExtraFiles.xml");
|
||||
var result = _task.Execute();
|
||||
Assert.That(result, Is.True);
|
||||
|
||||
Assert.That(_task.ExtraFiles.Count(), Is.EqualTo(4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ContentFilesAreDetected() {
|
||||
_task.ProjectFileName = _testDataFiles.Get("ExtraFiles.xml");
|
||||
_task.AddContentFiles = new[] {
|
||||
new TaskItem("newfile.xml"),
|
||||
new TaskItem("another\\newfile.txt")
|
||||
};
|
||||
var result = _task.Execute();
|
||||
Assert.That(result, Is.True);
|
||||
|
||||
var after = XDocument.Load(_task.ProjectFileName);
|
||||
var afterIncludes = after
|
||||
.Elements(XName.Get("Project", _xmlns))
|
||||
.Elements(XName.Get("ItemGroup", _xmlns))
|
||||
.Elements(XName.Get("Content", _xmlns))
|
||||
.Attributes("Include")
|
||||
.Select(attr => (string)attr)
|
||||
.ToArray();
|
||||
|
||||
Assert.That(afterIncludes, Has.Some.EqualTo("newfile.xml"));
|
||||
Assert.That(afterIncludes, Has.Some.EqualTo("another\\newfile.txt"));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Themes\TheAdminClassic\Styles\images\icons.psd" />
|
||||
<None Include="Themes\TheAdmin\Styles\images\icons.psd" />
|
||||
<Content Include="Themes\TheAdmin\Views\Menu.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Views\User.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Views\Header.ascx" />
|
||||
<Content Include="Themes\Web.config" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,23 +0,0 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=1.4.4.561, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Autofac.Integration.Web, Version=1.4.4.561, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\autofac\Autofac.Integration.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Orchard\Orchard.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,287 +0,0 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{50B779EA-EC00-4699-84C0-03B395C365D2}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.Web</RootNamespace>
|
||||
<AssemblyName>Orchard.Web</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<MvcBuildViews>true</MvcBuildViews>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=1.4.4.561, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Autofac.Integration.Web, Version=1.4.4.561, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\autofac\Autofac.Integration.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate.ByteCode.Castle, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\fluentnhibernate\NHibernate.ByteCode.Castle.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Home\Index.ascx" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Orchard\Orchard.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Blogs\Orchard.Blogs.csproj">
|
||||
<Project>{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}</Project>
|
||||
<Name>Orchard.Blogs</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Comments\Orchard.Comments.csproj">
|
||||
<Project>{14C049FD-B35B-415A-A824-87F26B26E7FD}</Project>
|
||||
<Name>Orchard.Comments</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Experimetnal\Orchard.Experimental.csproj">
|
||||
<Project>{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}</Project>
|
||||
<Name>Orchard.Experimental</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Media\Orchard.Media.csproj">
|
||||
<Project>{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}</Project>
|
||||
<Name>Orchard.Media</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Roles\Orchard.Roles.csproj">
|
||||
<Project>{D10AD48F-407D-4DB5-A328-173EC7CB010F}</Project>
|
||||
<Name>Orchard.Roles</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Setup\Orchard.Setup.csproj">
|
||||
<Project>{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}</Project>
|
||||
<Name>Orchard.Setup</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Tags\Orchard.Tags.csproj">
|
||||
<Project>{5D0F00F0-26C9-4785-AD61-B85710C60EB0}</Project>
|
||||
<Name>Orchard.Tags</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Users\Orchard.Users.csproj">
|
||||
<Project>{79AED36E-ABD0-4747-93D3-8722B042454B}</Project>
|
||||
<Name>Orchard.Users</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\Orchard.Sandbox\Orchard.Sandbox.csproj">
|
||||
<Project>{17C44253-65A2-4597-98C7-16EE576824B6}</Project>
|
||||
<Name>Orchard.Sandbox</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Modules\TinyMce\TinyMce.csproj">
|
||||
<Project>{954CA994-D204-468B-9D69-51F6AD3E1C29}</Project>
|
||||
<Name>TinyMce</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Config\Diagnostics.config" />
|
||||
<Content Include="Themes\Orange\Styles\site.css" />
|
||||
<Content Include="Themes\Orange\Theme.txt" />
|
||||
<Content Include="Themes\Orange\Views\Layout.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Styles\images\icons.png" />
|
||||
<Content Include="Themes\TheAdmin\Styles\images\tableHeaderBackgroundRed.gif" />
|
||||
<Content Include="Themes\TheAdmin\Styles\site.css" />
|
||||
<Content Include="Themes\TheAdmin\Theme.gif" />
|
||||
<Content Include="Themes\TheAdmin\Theme.txt" />
|
||||
<Content Include="Themes\TheAdmin\Views\Layout.ascx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Themes\TheAdminClassic\Styles\images\icons.psd" />
|
||||
<None Include="Themes\TheAdmin\Styles\images\icons.psd" />
|
||||
<Content Include="Themes\Classic\Content\Images\bodyBackground.gif" />
|
||||
<Content Include="Themes\Classic\Content\Images\bodyBackgroundgrey.gif" />
|
||||
<Content Include="Themes\Classic\Content\Images\footerBackground.gif" />
|
||||
<Content Include="Themes\Classic\Content\Images\mainBackground.gif" />
|
||||
<Content Include="Themes\Classic\Content\Images\mainBackground.png" />
|
||||
<Content Include="Themes\Classic\Content\Images\mainBackgroundgrey.gif" />
|
||||
<Content Include="Themes\Classic\Content\Images\mainBackgroundgrey.png" />
|
||||
<Content Include="Themes\Classic\Content\Images\navDivider.gif" />
|
||||
<Content Include="Themes\Classic\Content\Images\sidebarBackground.gif" />
|
||||
<Content Include="Themes\Classic\Styles\blog.css" />
|
||||
<Content Include="Themes\Classic\Styles\site.css" />
|
||||
<Content Include="Themes\Classic\Theme.png" />
|
||||
<Content Include="Themes\Classic\Theme.txt" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
|
||||
<Content Include="Themes\Classic\Views\Footer.ascx" />
|
||||
<Content Include="Themes\Classic\Views\Layout.ascx" />
|
||||
<Content Include="Themes\Classic\Views\Menu.ascx" />
|
||||
<Content Include="Themes\Green\Content\Images\bodyBackground.gif" />
|
||||
<Content Include="Themes\Green\Content\Images\bodyBackground.png" />
|
||||
<Content Include="Themes\Green\Content\Images\commentpointer.gif" />
|
||||
<Content Include="Themes\Green\Content\Images\logo.gif" />
|
||||
<Content Include="Themes\Green\Content\Images\logo.png" />
|
||||
<Content Include="Themes\Green\Content\Images\tabLeftOff.gif" />
|
||||
<Content Include="Themes\Green\Content\Images\tabLeftOn.gif" />
|
||||
<Content Include="Themes\Green\Content\Images\tabRightOff.gif" />
|
||||
<Content Include="Themes\Green\Content\Images\tabRightOn.gif" />
|
||||
<Content Include="Themes\Green\Styles\blog.css" />
|
||||
<Content Include="Themes\Green\Styles\site.css" />
|
||||
<Content Include="Themes\Green\Styles\yui.css" />
|
||||
<Content Include="Themes\Green\Theme.png" />
|
||||
<Content Include="Themes\Green\Theme.txt" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Parts\Comments.Comments.ascx" />
|
||||
<Content Include="Themes\Green\Views\Footer.ascx" />
|
||||
<Content Include="Themes\Green\Views\Layout.ascx" />
|
||||
<Content Include="Themes\Green\Views\ListOfComments.ascx" />
|
||||
<Content Include="Themes\Green\Views\Menu.ascx" />
|
||||
<Content Include="Themes\Green\Views\User.ascx" />
|
||||
<Content Include="Themes\Orange\Theme.png" />
|
||||
<Content Include="Themes\Orange\Views\Orchard.Blogs\BlogPost\Item.ascx" />
|
||||
<Content Include="Themes\Orchard\Content\Images\background_content.jpg" />
|
||||
<Content Include="Themes\Orchard\Content\Images\background_footer.jpg" />
|
||||
<Content Include="Themes\Orchard\Content\Images\background_module.gif" />
|
||||
<Content Include="Themes\Orchard\Content\Images\background_page.jpg" />
|
||||
<Content Include="Themes\Orchard\Content\Images\background_pageTop.gif" />
|
||||
<Content Include="Themes\Orchard\Content\Images\orchardLogo.jpg" />
|
||||
<Content Include="Themes\Orchard\Styles\site.css" />
|
||||
<Content Include="Themes\Orchard\Theme.png" />
|
||||
<Content Include="Themes\Orchard\Theme.txt" />
|
||||
<Content Include="Themes\Orchard\Views\Footer.ascx" />
|
||||
<Content Include="Themes\Orchard\Views\Layout.ascx" />
|
||||
<Content Include="Themes\Orchard\Views\Menu.ascx" />
|
||||
<Content Include="Themes\SafeMode\Content\Images\background_content.jpg" />
|
||||
<Content Include="Themes\SafeMode\Content\Images\background_footer.jpg" />
|
||||
<Content Include="Themes\SafeMode\Content\Images\background_module.gif" />
|
||||
<Content Include="Themes\SafeMode\Content\Images\background_page.jpg" />
|
||||
<Content Include="Themes\SafeMode\Content\Images\background_pageTop.gif" />
|
||||
<Content Include="Themes\SafeMode\Content\Images\orchardLogo.jpg" />
|
||||
<Content Include="Themes\SafeMode\Styles\site.css" />
|
||||
<Content Include="Themes\SafeMode\Theme.png" />
|
||||
<Content Include="Themes\SafeMode\Theme.txt" />
|
||||
<Content Include="Themes\SafeMode\Views\Document.aspx" />
|
||||
<Content Include="Themes\SafeMode\Views\Footer.ascx" />
|
||||
<Content Include="Themes\SafeMode\Views\Layout.ascx" />
|
||||
<Content Include="Themes\SafeMode\Views\Menu.ascx" />
|
||||
<Content Include="Themes\TheAdminClassic\Styles\images\background_header.jpg" />
|
||||
<Content Include="Themes\TheAdminClassic\Styles\images\icons.png" />
|
||||
<Content Include="Themes\TheAdminClassic\Styles\images\orchardLogo.jpg" />
|
||||
<Content Include="Themes\TheAdminClassic\Styles\images\tableHeaderBackground.gif" />
|
||||
<Content Include="Themes\TheAdminClassic\Styles\images\tableHeaderBackgroundRed.gif" />
|
||||
<Content Include="Themes\TheAdminClassic\Styles\site.css" />
|
||||
<Content Include="Themes\TheAdminClassic\Theme.gif" />
|
||||
<Content Include="Themes\TheAdminClassic\Theme.txt" />
|
||||
<Content Include="Themes\TheAdminClassic\Views\Header.ascx" />
|
||||
<Content Include="Themes\TheAdminClassic\Views\Layout.ascx" />
|
||||
<Content Include="Themes\TheAdminClassic\Views\Menu.ascx" />
|
||||
<Content Include="Themes\TheAdminClassic\Views\User.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Styles\images\backgroundHeader.gif" />
|
||||
<Content Include="Themes\TheAdmin\Styles\images\orchardLogo.gif" />
|
||||
<Content Include="Themes\TheAdmin\Views\Menu.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Views\User.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Views\Header.ascx" />
|
||||
<Content Include="Themes\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target> -->
|
||||
<Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler">
|
||||
<PropertyGroup>
|
||||
<AreasManifestDir>$(ProjectDir)\..\Manifests</AreasManifestDir>
|
||||
</PropertyGroup>
|
||||
<!-- If this is an area child project, uncomment the following line:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Child" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
-->
|
||||
<!-- If this is an area parent project, uncomment the following lines:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Parent" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
<CopyAreaManifests ManifestPath="$(AreasManifestDir)" CrossCopy="false" RenameViews="true" />
|
||||
-->
|
||||
</Target>
|
||||
<Target Name="AfterBuildCompiler" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>False</AutoAssignPort>
|
||||
<DevelopmentServerPort>30320</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace MSBuild.Orchard.Tasks.Tests.TestData {
|
||||
public class TestDataFiles : IDisposable {
|
||||
List<Entry> _entries = new List<Entry>();
|
||||
private readonly string _tempPath;
|
||||
|
||||
public TestDataFiles() {
|
||||
_tempPath = Path.GetTempFileName();
|
||||
File.Delete(_tempPath);
|
||||
Directory.CreateDirectory(_tempPath);
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
Directory.Delete(_tempPath, true);
|
||||
}
|
||||
|
||||
public string Get(string name) {
|
||||
if (!_entries.Any(entry => entry.Name == name)) {
|
||||
var type = GetType();
|
||||
var fullPath = Path.Combine(_tempPath, name);
|
||||
using (var inputStream = type.Assembly.GetManifestResourceStream(type, name)) {
|
||||
if (inputStream == null)
|
||||
throw new ApplicationException("Tests data not found");
|
||||
|
||||
using (var outputStream = new FileStream(fullPath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite)) {
|
||||
var buffer = new byte[8192];
|
||||
for (; ; ) {
|
||||
var size = inputStream.Read(buffer, 0, buffer.Length);
|
||||
if (size < 1)
|
||||
break;
|
||||
outputStream.Write(buffer, 0, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
_entries.Add(new Entry { Name = name, FullPath = fullPath });
|
||||
}
|
||||
return _entries.Single(entry => entry.Name == name).FullPath;
|
||||
}
|
||||
|
||||
class Entry {
|
||||
public string Name { get; set; }
|
||||
public string FullPath { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -70,7 +70,6 @@
|
||||
<Compile Include="ValidateExtensionProjectFiles.cs" />
|
||||
<Compile Include="FileUpdateLines.cs" />
|
||||
<Compile Include="FilterModuleBinaries.cs" />
|
||||
<Compile Include="StageProjectAlteration.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -1,219 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
|
||||
namespace MSBuild.Orchard.Tasks {
|
||||
public class StageProjectAlteration : Task {
|
||||
public string ProjectFileName { get; set; }
|
||||
|
||||
public ITaskItem[] AddContentFiles { get; set; }
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] ExtraFiles { get; set; }
|
||||
|
||||
|
||||
|
||||
public override bool Execute() {
|
||||
Log.LogMessage("Altering \"{0}\"", ProjectFileName);
|
||||
|
||||
var context = new Context(this);
|
||||
if (context.LoadProject() &&
|
||||
context.ChangeProjectReferencesToFileReferences() &&
|
||||
context.ChangeLibraryReferencesToFileReferences() &&
|
||||
context.FindExtraFiles() &&
|
||||
context.AddContentFiles() &&
|
||||
context.SaveProject()) {
|
||||
|
||||
Log.LogMessage("Stage project altered successfully");
|
||||
return true;
|
||||
}
|
||||
|
||||
Log.LogWarning("Stage project alteration failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
class Context {
|
||||
private readonly StageProjectAlteration _task;
|
||||
XDocument _document;
|
||||
|
||||
private const string Xmlns = "http://schemas.microsoft.com/developer/msbuild/2003";
|
||||
private static readonly XName Project = XName.Get("Project", Xmlns);
|
||||
private static readonly XName ItemGroup = XName.Get("ItemGroup", Xmlns);
|
||||
private static readonly XName ProjectReference = XName.Get("ProjectReference", Xmlns);
|
||||
private static readonly XName Reference = XName.Get("Reference", Xmlns);
|
||||
private static readonly XName Name = XName.Get("Name", Xmlns);
|
||||
private static readonly XName Include = XName.Get("Include");
|
||||
private static readonly XName HintPath = XName.Get("HintPath", Xmlns);
|
||||
private static readonly XName SpecificVersion = XName.Get("SpecificVersion", Xmlns);
|
||||
private static readonly XName Content = XName.Get("Content", Xmlns);
|
||||
private static readonly XName Compile = XName.Get("Compile", Xmlns);
|
||||
private static readonly XName None = XName.Get("None", Xmlns);
|
||||
|
||||
public Context(StageProjectAlteration task) {
|
||||
_task = task;
|
||||
}
|
||||
|
||||
public bool LoadProject() {
|
||||
try {
|
||||
_document = XDocument.Load(_task.ProjectFileName);
|
||||
return true;
|
||||
}
|
||||
catch (Exception) {
|
||||
_task.Log.LogError("Unable to load project file");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SaveProject() {
|
||||
_document.Save(_task.ProjectFileName);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ChangeProjectReferencesToFileReferences() {
|
||||
var projectReferences = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.Elements(ProjectReference);
|
||||
|
||||
var referenceItemGroup = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.FirstOrDefault(elt => elt.Elements(Reference).Any());
|
||||
|
||||
if (referenceItemGroup == null) {
|
||||
referenceItemGroup = new XElement(ItemGroup);
|
||||
_document.Root.Add(referenceItemGroup);
|
||||
}
|
||||
|
||||
foreach (var projectReferenceName in projectReferences.Elements(Name)) {
|
||||
string oldHintPath = (projectReferenceName.Parent.Element(HintPath) ?? new XElement(HintPath)).Value;
|
||||
string newHintPath = string.Format("bin\\{0}.dll", (string)projectReferenceName);
|
||||
var reference = new XElement(
|
||||
Reference,
|
||||
new XAttribute(Include, (string)projectReferenceName),
|
||||
new XElement(SpecificVersion, "False"),
|
||||
new XElement(HintPath, newHintPath));
|
||||
referenceItemGroup.Add(reference);
|
||||
|
||||
_task.Log.LogMessage("Project reference \"{0}\": HintPath changed from \"{1}\" to \"{2}\"",
|
||||
(string)projectReferenceName, oldHintPath, newHintPath);
|
||||
}
|
||||
|
||||
foreach (var projectReference in projectReferences.ToArray()) {
|
||||
projectReference.Remove();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ChangeLibraryReferencesToFileReferences() {
|
||||
var libraryReferences = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.Elements(Reference);
|
||||
|
||||
var referenceItemGroup = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.FirstOrDefault(elt => elt.Elements(Reference).Any());
|
||||
|
||||
if (referenceItemGroup == null) {
|
||||
referenceItemGroup = new XElement(ItemGroup);
|
||||
_document.Root.Add(referenceItemGroup);
|
||||
}
|
||||
|
||||
List<XElement> elementsToRemove = new List<XElement>();
|
||||
foreach (var hintPathElement in libraryReferences.Elements(HintPath)) {
|
||||
string oldHintPath = hintPathElement.Value;
|
||||
|
||||
if (!oldHintPath.StartsWith("..\\..\\lib\\"))
|
||||
continue;
|
||||
|
||||
elementsToRemove.Add(hintPathElement.Parent);
|
||||
// Need to change the hint path from
|
||||
// ..\\..\\lib\\<libraryfolder>\\<AssemblyName>.dll
|
||||
// to
|
||||
// bin\\<AssemblyName>.dll
|
||||
string assemblyFileName = Path.GetFileName(oldHintPath);
|
||||
string newHintPath = Path.Combine("bin", assemblyFileName);
|
||||
var reference = new XElement(
|
||||
Reference,
|
||||
new XAttribute(Include, hintPathElement.Parent.Attribute(Include).Value),
|
||||
new XElement(SpecificVersion, "False"),
|
||||
new XElement(HintPath, newHintPath));
|
||||
referenceItemGroup.Add(reference);
|
||||
|
||||
_task.Log.LogMessage("Assembly (library) Reference \"{0}\": HintPath changed from \"{1}\" to \"{2}\"",
|
||||
hintPathElement.Parent.Attribute(Include).Value, oldHintPath, newHintPath);
|
||||
}
|
||||
|
||||
foreach (var reference in elementsToRemove) {
|
||||
reference.Remove();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool FindExtraFiles() {
|
||||
var extraFiles = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.Elements().Where(elt => elt.Name == Compile || elt.Name == None)
|
||||
.Attributes(Include)
|
||||
.Select(attr => (string)attr);
|
||||
|
||||
_task.ExtraFiles = extraFiles
|
||||
.Select(file => {
|
||||
_task.Log.LogMessage("Detected extra file \"{0}\"", file);
|
||||
var item = new TaskItem(file);
|
||||
item.SetMetadata("RecursiveDir", Path.GetDirectoryName(file));
|
||||
return item;
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddContentFiles() {
|
||||
var existingContent = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.Elements(Content)
|
||||
.Attributes(Include)
|
||||
.Select(attr => (string)attr);
|
||||
|
||||
var contentItemGroup = _document
|
||||
.Elements(Project)
|
||||
.Elements(ItemGroup)
|
||||
.FirstOrDefault(elt => elt.Elements(Content).Any());
|
||||
|
||||
if (contentItemGroup == null) {
|
||||
contentItemGroup = new XElement(ItemGroup);
|
||||
_document.Root.Add(contentItemGroup);
|
||||
}
|
||||
|
||||
if (_task.AddContentFiles != null) {
|
||||
foreach (var addContent in _task.AddContentFiles) {
|
||||
if (existingContent.Contains(addContent.ItemSpec)) {
|
||||
// don't add more than once
|
||||
continue;
|
||||
}
|
||||
_task.Log.LogMessage("Adding Content file \"{0}\"", addContent.ItemSpec);
|
||||
|
||||
var content = new XElement(
|
||||
Content,
|
||||
new XAttribute(Include, addContent.ItemSpec));
|
||||
contentItemGroup.Add(content);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user