--HG--
branch : dev
This commit is contained in:
Suha Can 2010-07-09 11:48:36 -07:00
commit 4d2da358ba
4 changed files with 48 additions and 8 deletions

View File

@ -140,14 +140,6 @@ namespace Orchard.DevTools.Commands {
CreateFilesFromTemplates(moduleName, projectGuid);
// The string searches in solution/project files can be made aware of comment lines.
if (IncludeInSolution) {
// Add project reference to Orchard.Web.csproj
string webProjectReference = string.Format(
"</ProjectReference>\r\n <ProjectReference Include=\"Modules\\{0}\\{0}.csproj\">\r\n <Project>{{{1}}}</Project>\r\n <Name>{0}</Name>\r\n ",
moduleName, projectGuid);
string webProjectText = File.ReadAllText(rootWebProjectPath);
webProjectText = webProjectText.Insert(webProjectText.LastIndexOf("</ProjectReference>\r\n"), webProjectReference);
File.WriteAllText(rootWebProjectPath, webProjectText);
// Add project to Orchard.sln
string solutionPath = Directory.GetParent(rootWebProjectPath).Parent.FullName + "\\Orchard.sln";
if (File.Exists(solutionPath)) {
@ -177,6 +169,12 @@ namespace Orchard.DevTools.Commands {
Directory.CreateDirectory(modulePath);
Directory.CreateDirectory(propertiesPath);
Directory.CreateDirectory(modulePath + "Controllers");
Directory.CreateDirectory(modulePath + "Views");
File.WriteAllText(modulePath + "\\Views\\Web.config", File.ReadAllText(templatesPath + "ViewsWebConfig.txt"));
Directory.CreateDirectory(modulePath + "Models");
Directory.CreateDirectory(modulePath + "Scripts");
string templateText = File.ReadAllText(templatesPath + "ModuleAssemblyInfo.txt");
templateText = templateText.Replace("$$ModuleName$$", moduleName);
templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString());

View File

@ -97,6 +97,7 @@
<Content Include="ScaffoldingTemplates\ModuleCsProj.txt" />
<Content Include="ScaffoldingTemplates\ModuleManifest.txt" />
<Content Include="ScaffoldingTemplates\ModuleWebConfig.txt" />
<Content Include="ScaffoldingTemplates\ViewsWebConfig.txt" />
<Content Include="Views\Commands\Execute.ascx" />
<Content Include="Views\DataMigration\Index.aspx" />
<Content Include="Views\DefinitionTemplates\DevToolsSettings.ascx" />

View File

@ -70,6 +70,13 @@
<ItemGroup>
<Content Include="Module.txt" />
<Content Include="Web.config" />
<Content Include="Views\Web.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
<Folder Include="Models\" />
<Folder Include="Scripts\" />
<Folder Include="Content\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">

View File

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*" verb="*"
type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
</handlers>
</system.webServer>
</configuration>