Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Added Glimpse.AspNet.Net35 project for backwards support with .NET 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmd23 committed Mar 29, 2012
1 parent 57ed91d commit 771bd47
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 38 deletions.
13 changes: 13 additions & 0 deletions Glimpse.All.sln
Expand Up @@ -75,6 +75,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JavaScript", "JavaScript",
source\Glimpse.JavaScript\jquery-1.6.3.min.js = source\Glimpse.JavaScript\jquery-1.6.3.min.js
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glimpse.AspNet.Net35", "source\Glimpse.AspNet.Net35\Glimpse.AspNet.Net35.csproj", "{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -175,6 +177,16 @@ Global
{E242E3FC-DEF4-45E2-A129-A5DC3B0B8F9B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E242E3FC-DEF4-45E2-A129-A5DC3B0B8F9B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E242E3FC-DEF4-45E2-A129-A5DC3B0B8F9B}.Release|x86.ActiveCfg = Release|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Debug|Any CPU.Build.0 = Debug|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Debug|x86.ActiveCfg = Debug|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Release|Any CPU.ActiveCfg = Release|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Release|Any CPU.Build.0 = Release|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -186,6 +198,7 @@ Global
{32DCD27D-A84C-4250-B657-408B3620A9AC} = {CCFACE51-18FA-4C5D-9F89-EC58881786A9}
{22E8C0B0-E32F-4598-896F-81F3A6BD9862} = {44EAFB31-C422-4B52-BBCE-18A3E95713DC}
{13FEFF53-9CD2-4BF1-9128-A60F99E5532F} = {44EAFB31-C422-4B52-BBCE-18A3E95713DC}
{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444} = {44EAFB31-C422-4B52-BBCE-18A3E95713DC}
{E242E3FC-DEF4-45E2-A129-A5DC3B0B8F9B} = {13FEFF53-9CD2-4BF1-9128-A60F99E5532F}
EndGlobalSection
EndGlobal
16 changes: 11 additions & 5 deletions default.ps1
Expand Up @@ -29,6 +29,10 @@ task clean {
" Glimpse.AspNet"
Delete-Directory "$source_dir\Glimpse.AspNet\bin"
Delete-Directory "$source_dir\Glimpse.AspNet\obj"

" Glimpse.AspNet.Net35"
Delete-Directory "$source_dir\Glimpse.AspNet.Net35\bin"
Delete-Directory "$source_dir\Glimpse.AspNet.Net35\obj"

" Glimpse.Mvc"
Delete-Directory "$source_dir\Glimpse.Mvc\bin"
Expand Down Expand Up @@ -72,8 +76,10 @@ task merge -depends compile {

" Glimpse.AspNet"
copy $source_dir\Glimpse.AspNet\bin\Release\Glimpse.AspNet.* $source_dir\Glimpse.AspNet\nuspec\lib\net40\

" Glimpse.AspNet.Net35"
#TODO: Create AspNet.Net35
copy $source_dir\Glimpse.AspNet\bin\Release\Glimpse.AspNet.* $source_dir\Glimpse.AspNet\nuspec\lib\net35\

}

task pack2 -depends merge {
Expand All @@ -97,11 +103,11 @@ task pack2 -depends merge {

copy $base_dir\license.txt $build_dir\local\zip

copy $source_dir\Glimpse.Core2\nuspec\lib\net40\Glimpse.Core2.dll $build_dir\local\zip\Core\net40
copy $source_dir\Glimpse.Core2\nuspec\lib\net35\Glimpse.Core2.dll $build_dir\local\zip\Core\net35
copy $source_dir\Glimpse.Core2\nuspec\lib\net40\Glimpse.Core2.* $build_dir\local\zip\Core\net40
copy $source_dir\Glimpse.Core2\nuspec\lib\net35\Glimpse.Core2.* $build_dir\local\zip\Core\net35

copy $source_dir\Glimpse.AspNet\nuspec\lib\net40\Glimpse.AspNet.dll $build_dir\local\zip\AspNet\net40
#copy $source_dir\Glimpse.AspNet\nuspec\lib\net35\Glimpse.AspNet.dll $build_dir\local\zip\AspNet\net35
copy $source_dir\Glimpse.AspNet\nuspec\lib\net40\Glimpse.AspNet.* $build_dir\local\zip\AspNet\net40
copy $source_dir\Glimpse.AspNet\nuspec\lib\net35\Glimpse.AspNet.* $build_dir\local\zip\AspNet\net35
copy $source_dir\Glimpse.AspNet\nuspec\readme.txt $build_dir\local\zip\AspNet

#TODO: Add help .CHM file
Expand Down
17 changes: 17 additions & 0 deletions source/Glimpse.AspNet.Net35/Backport/Net35Backport.cs
@@ -0,0 +1,17 @@
namespace Glimpse.AspNet.Net35.Backport
{
public static class Net35Backport
{
public static bool IsNullOrWhiteSpace(string value)
{
if (value == null) return true;

for (int i = 0; i < value.Length; i++)
{
if (!char.IsWhiteSpace(value[i])) return false;
}

return true;
}
}
}
61 changes: 61 additions & 0 deletions source/Glimpse.AspNet.Net35/Glimpse.AspNet.Net35.csproj
@@ -0,0 +1,61 @@
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{971143D1-B40E-4AF4-AD3D-D4FFAD3FE444}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Glimpse.AspNet.Net35</RootNamespace>
<AssemblyName>Glimpse.AspNet.Net35</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Glimpse.AspNet\**\*.cs" Exclude="..\Glimpse.AspNet\Properties\AssemblyInfo.cs">
<Link />
</Compile>
<Compile Include="Backport\Net35Backport.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Glimpse.Core2.Net35\Glimpse.Core2.Net35.csproj">
<Project>{22E8C0B0-E32F-4598-896F-81F3A6BD9862}</Project>
<Name>Glimpse.Core2.Net35</Name>
</ProjectReference>
</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>
19 changes: 19 additions & 0 deletions source/Glimpse.AspNet.Net35/Properties/AssemblyInfo.cs
@@ -0,0 +1,19 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: ComVisible(false)]
[assembly: Guid("63826849-ecbe-4abd-afa1-16b6ce461795")]


[assembly: AssemblyTitle("Glimpse for ASP.NET 3.5 Assembly")]
[assembly: AssemblyDescription("Main extensibility implementations for running Glimpse with ASP.NET 3.5.")]
[assembly: AssemblyProduct("Glimpse")]
[assembly: AssemblyCopyright("© 2012 Nik Molnar & Anthony van der Hoorn")]
[assembly: AssemblyTrademark("Glimpse™")]


//Version is in major.minor.build format to support http://semver.org/
//Keep these three attributes in sync
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
//[assembly: AssemblyInformationalVersion("1.0.0-rc")] Package version is driven off Glimpse.AspNet/Properties/AssemblyInfo.cs
2 changes: 1 addition & 1 deletion source/Glimpse.AspNet/Glimpse.AspNet.csproj
Expand Up @@ -51,7 +51,7 @@
<Compile Include="Model\RequestModel.cs" />
<Compile Include="Model\RouteInstance.cs" />
<Compile Include="Model\UriTokenInstance.cs" />
<Compile Include="PipelineInspector\Routes.cs" />
<Compile Include="PipelineInspector\RoutesInspector.cs" />
<Compile Include="RequestMetadata.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
Expand Down
3 changes: 3 additions & 0 deletions source/Glimpse.AspNet/NuSpec/lib/net35/.gitignore
@@ -0,0 +1,3 @@

*.dll
*.pdb
Expand Up @@ -2,7 +2,7 @@

namespace Glimpse.AspNet.PipelineInspector
{
public class Routes:IPipelineInspector
public class RoutesInspector:IPipelineInspector
{
public void Setup(IPipelineInspectorContext context)
{
Expand Down
8 changes: 8 additions & 0 deletions source/Glimpse.AspNet/PreBodyTagFilter.cs
@@ -1,6 +1,9 @@
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
#if NET35
using Glimpse.AspNet.Net35.Backport;
#endif

namespace Glimpse.AspNet
{
Expand All @@ -13,7 +16,12 @@ public class PreBodyTagFilter : Stream

public PreBodyTagFilter(string htmlSnippet, Stream outputStream, Encoding contentEncoding)
{
#if NET35
HtmlSnippet = Net35Backport.IsNullOrWhiteSpace(htmlSnippet) ? string.Empty : htmlSnippet + "</body>";
#else
HtmlSnippet = string.IsNullOrWhiteSpace(htmlSnippet) ? string.Empty : htmlSnippet + "</body>";
#endif

OutputStream = outputStream;
ContentEncoding = contentEncoding;
BodyEnd = new Regex("</body>", RegexOptions.Compiled | RegexOptions.Multiline);
Expand Down
43 changes: 13 additions & 30 deletions source/Glimpse.Core2.Net35/Properties/AssemblyInfo.cs
@@ -1,36 +1,19 @@
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("Glimpse.Core2.Net35")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Glimpse.Core2.Net35")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[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("da3e9a24-8809-48d0-807d-bce41a878883")]

// 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")]

[assembly: AssemblyTitle("Glimpse Core Assembly for .NET 3.5")]
[assembly: AssemblyDescription("Core .NET 3.5 interfaces and types for Glimpse.")]//When you right-click the assembly file in Windows Explorer, this attribute appears as the Comments value on the Version tab of the file properties dialog box.
[assembly: AssemblyProduct("Glimpse")]
[assembly: AssemblyCopyright("© 2012 Nik Molnar & Anthony van der Hoorn")]
[assembly: AssemblyTrademark("Glimpse™")]


//Version is in major.minor.build format to support http://semver.org/
//Keep these three attributes in sync
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
//[assembly: AssemblyInformationalVersion("1.0.0-rc")] Package version is driven off Glimpse.Core2/Properties/AssemblyInfo.cs
4 changes: 3 additions & 1 deletion source/Glimpse.Core2/Glimpse.Core2.csproj
Expand Up @@ -168,7 +168,9 @@
<Compile Include="SerializationConverter\GlimpseMetadataConverter.cs" />
</ItemGroup>
<ItemGroup>
<None Include="NuSpec\Glimpse.nuspec" />
<None Include="NuSpec\Glimpse.nuspec">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 771bd47

Please sign in to comment.