Skip to content

Updated to support WebApi RC #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ _ReSharper.Ninject.Web.WebApi
/lib/Ninject/*.zip
/lib/Ninject/*/**
/lib/Ninject.Web.Common/*.zip
/lib/Ninject.Web.Common/*/**
/lib/Ninject.Web.Common/*/**
/packages/*
*.ncrunch*
UpgradeLog.htm
UpgradeLog.XML
Backup/*
_UpgradeReport_Files/*
6 changes: 6 additions & 0 deletions .nuget/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Binary file added .nuget/NuGet.exe
Binary file not shown.
71 changes: 71 additions & 0 deletions .nuget/NuGet.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

<!-- Windows specific commands -->
<NuGetToolsPath Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
<PackagesConfig Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
<PackagesDir Condition=" '$(OS)' == 'Windows_NT'">$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>

<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath Condition=" '$(OS)' != 'Windows_NT'">$(SolutionDir).nuget</NuGetToolsPath>
<PackagesConfig Condition=" '$(OS)' != 'Windows_NT' ">packages.config</PackagesConfig>
<PackagesDir Condition=" '$(OS)' != 'Windows_NT'">$(SolutionDir)packages</PackagesDir>

<!-- NuGet command -->
<NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>

<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
<PackageSources>""</PackageSources>

<!-- Enable the restore command to run before builds -->
<RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>

<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)"</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>

<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>

<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>

<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="!Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
</Target>

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />

<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>

<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />

<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>
</Project>
8 changes: 4 additions & 4 deletions Ninject.Web.WebApi.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<property name="product.name" value="Ninject.Web.WebApi" overwrite="false"/>
<property name="product.company" value="Ninject Project Contributors" overwrite="false"/>
<property name="product.duration" value="2012" overwrite="false"/>
<property name="product.description" value="Ninject support for MVC Web API" overwrite="false"/>
<property name="product.platforms" value="net-4.0,net-4.5" overwrite="false"/>
<property name="product.buildserverPlatforms" value="net-4.0" overwrite="false"/>
<property name="product.description" value="Ninject support for ASP.NET Web API" overwrite="false"/>
<property name="product.platforms" value="net-4.5" overwrite="false"/>
<property name="product.buildserverPlatforms" value="net-4.5" overwrite="false"/>
<property name="product.packagePostfix" value="4" overwrite="false"/>
<property name="dependencies" value="Ninject,Ninject.Web.Common" overwrite="false"/>

Expand All @@ -31,7 +31,7 @@
<include name="System.ComponentModel.DataAnnotations.dll"/>
<include name="${path.lib}/WebApi/System.Net.Http.dll"/>
<include name="${path.lib}/WebApi/System.Web.Http.dll"/>
<include name="${path.lib}/WebApi/System.Web.Http.Common.dll"/>
<!--<include name="${path.lib}/WebApi/System.Web.Http.Common.dll"/>-->
<include name="${path.lib}/WebApi/System.Web.Http.WebHost.dll"/>
<include name="${path.lib}/Ninject/${build.platform}/Ninject.dll"/>
<include name="${path.lib}/Ninject.Web.Common/${build.platform}/Ninject.Web.Common.dll"/>
Expand Down
21 changes: 13 additions & 8 deletions Ninject.Web.WebApi.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77BE2A9F-F61F-45D4-A5C5-1DF0DA05EA42}"
ProjectSection(SolutionItems) = preProject
README.markdown = README.markdown
Expand All @@ -10,25 +10,30 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninject.Web.WebApi", "src\N
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApplication", "SampleApplication\SampleApplication.csproj", "{776D2ADD-1AC3-4219-8F95-6E581A7439E4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{9E643D7F-803C-4D44-9364-1BD9E578D349}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.exe = .nuget\NuGet.exe
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AutomatedRelease|Any CPU = AutomatedRelease|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.AutomatedRelease|Any CPU.ActiveCfg = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.AutomatedRelease|Any CPU.Build.0 = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Release|Any CPU.Build.0 = Release|Any CPU
{776D2ADD-1AC3-4219-8F95-6E581A7439E4}.AutomatedRelease|Any CPU.ActiveCfg = Release|Any CPU
{776D2ADD-1AC3-4219-8F95-6E581A7439E4}.AutomatedRelease|Any CPU.Build.0 = Release|Any CPU
{776D2ADD-1AC3-4219-8F95-6E581A7439E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{776D2ADD-1AC3-4219-8F95-6E581A7439E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{776D2ADD-1AC3-4219-8F95-6E581A7439E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{776D2ADD-1AC3-4219-8F95-6E581A7439E4}.Release|Any CPU.Build.0 = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.AutomatedRelease|Any CPU.ActiveCfg = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.AutomatedRelease|Any CPU.Build.0 = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8980B1F-899E-4C2D-A0DC-E76DB52DAA03}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 1 addition & 2 deletions SampleApplication/App_Start/NinjectWebCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// </copyright>
//-------------------------------------------------------------------------------

using Microsoft.Web.Infrastructure.DynamicModuleHelper;
using SampleApplication.App_Start;

[assembly: WebActivator.PreApplicationStartMethod(typeof(NinjectWebCommon), "Start")]
Expand All @@ -30,8 +31,6 @@ namespace SampleApplication.App_Start
using System.Reflection;
using System.Web;

using Microsoft.Web.Infrastructure.DynamicModuleHelper;

using Ninject;
using Ninject.Web.Common;

Expand Down
Loading