Skip to content

Commit

Permalink
Split out System.Web dependency to separate project
Browse files Browse the repository at this point in the history
  • Loading branch information
mausch committed Jun 28, 2015
1 parent 0346078 commit 29286ae
Show file tree
Hide file tree
Showing 35 changed files with 732 additions and 298 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ _ReSharper.*
packages/*
.nuget/nuget.exe
*.nupkg
*.sln.ide
*.sln.ide
QuartzNetWebConsole.Web/*.dll
5 changes: 4 additions & 1 deletion QuartzNetWebConsole.Tests/QuartzNetWebConsole.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>QuartzNetWebConsole.Tests</RootNamespace>
<AssemblyName>QuartzNetWebConsole.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -19,6 +19,7 @@
<OldToolsVersion>3.5</OldToolsVersion>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -28,6 +29,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -36,6 +38,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
Expand Down
8 changes: 4 additions & 4 deletions QuartzNetWebConsole.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Common.Logging" version="3.0.0" targetFramework="net35" />
<package id="Common.Logging.Core" version="3.0.0" targetFramework="net35" />
<package id="MiniMVC" version="1.0" targetFramework="net35" />
<package id="Common.Logging" version="3.0.0" targetFramework="net35" requireReinstallation="True" />
<package id="Common.Logging.Core" version="3.0.0" targetFramework="net35" requireReinstallation="True" />
<package id="MiniMVC" version="1.0" targetFramework="net35" requireReinstallation="True" />
<package id="NUnit" version="2.6.3" targetFramework="net35" />
<package id="Quartz" version="2.3.2" targetFramework="net35" />
<package id="Quartz" version="2.3.2" targetFramework="net35" requireReinstallation="True" />
</packages>
34 changes: 34 additions & 0 deletions QuartzNetWebConsole.Web/ControllerFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Linq;
using System.Web;
using MiniMVC;
using Response = QuartzNetWebConsole.Utils.Response;
using Route = System.Collections.Generic.KeyValuePair<string, System.Action<System.Web.HttpContextBase>>;

namespace QuartzNetWebConsole {
public class ControllerFactory : HttpHandlerFactory {
public override IHttpHandler GetHandler(HttpContextBase context) {
var lastUrlSegment = context.Request.Url.Segments.Last().Split('.')[0];
return Routing.Routes.Where(k => k.Key.Equals(lastUrlSegment, StringComparison.InvariantCultureIgnoreCase))
.Select(x => x.Value)
.Select(ToWebAction)
.Select(h => new HttpHandlerWithReadOnlySession(h))
.FirstOrDefault();
}

private static Action<HttpContextBase> ToWebAction(Func<Uri, Response> handler) {
return ctx => {
var response = handler(ctx.Request.Url);
EvaluateResponse(response, ctx.Response);
};
}

private static void EvaluateResponse(Response response, HttpResponseBase httpResponse) {
response.MatchAction(
content: x => httpResponse.Raw(x.Content, x.ContentType),
xdoc: x => httpResponse.XDocument(x.Content, x.ContentType),
redirect: x => httpResponse.Redirect(x.Location));
}

}
}
36 changes: 36 additions & 0 deletions QuartzNetWebConsole.Web/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("QuartzNetWebConsole.Web")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("QuartzNetWebConsole.Web")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[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("7e168d10-200b-496f-ace6-26ba6a449851")]

// 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.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
91 changes: 91 additions & 0 deletions QuartzNetWebConsole.Web/QuartzNetWebConsole.Web.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1F666487-F60B-4C8D-B632-58B24C37FEC1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>QuartzNetWebConsole.Web</RootNamespace>
<AssemblyName>QuartzNetWebConsole.Web</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging">
<HintPath>..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Common.Logging.Core">
<HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath>
</Reference>
<Reference Include="MiniMVC">
<HintPath>..\packages\MiniMVC.1.0\lib\net35\MiniMVC.dll</HintPath>
</Reference>
<Reference Include="Quartz">
<HintPath>..\packages\Quartz.2.3.2\lib\net40\Quartz.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ControllerFactory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="job_scheduling_data_2_0.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\QuartzNetWebConsole\QuartzNetWebConsole.csproj">
<Project>{72a7a322-38dd-47dd-8948-6ed6e2f9dc5d}</Project>
<Name>QuartzNetWebConsole</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>$(SolutionDir)packages\ilmerge.2.14.1208\tools\ILMerge.exe /ndebug /out:$(ProjectDir)QuartzNetWebConsole.dll $(TargetDir)QuartzNetWebConsole.Web.dll $(TargetDir)QuartzNetWebConsole.dll $(TargetDir)QuartzNetWebConsole.Views.dll $(TargetDir)MiniMvc.dll</PostBuildEvent>
</PropertyGroup>
<!-- 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>
Loading

0 comments on commit 29286ae

Please sign in to comment.