Skip to content
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dist
packages/
AppPackages
.vs/
TestResults/
TestResults/
*.nuget.targets
58 changes: 57 additions & 1 deletion Ninject.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3E299B94-5F07-49DE-8226-55EDC56F13E3}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -55,6 +55,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninject.Android.Tests", "sr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninject.iOS-Unified", "src\Ninject\Ninject.iOS-Unified.csproj", "{420ACA2A-7853-4C5D-A3B1-E7AE938A801F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ninject-dotnet", "src\Ninject.dotnet\Ninject-dotnet.csproj", "{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ninject.dotnet.Tests", "src\Ninject.dotnet.Tests\Ninject.dotnet\Ninject.dotnet.Tests.xproj", "{F177D383-F30F-4E09-B5C8-034525582FA8}"
ProjectSection(ProjectDependencies) = postProject
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A} = {00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -424,6 +431,54 @@ Global
{420ACA2A-7853-4C5D-A3B1-E7AE938A801F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{420ACA2A-7853-4C5D-A3B1-E7AE938A801F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{420ACA2A-7853-4C5D-A3B1-E7AE938A801F}.Release|x86.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why adding a Modern PCL project creates so many configurations.

{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|ARM.Build.0 = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|iPhone.Build.0 = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|x86.ActiveCfg = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Debug|x86.Build.0 = Debug|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|Any CPU.Build.0 = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|ARM.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|ARM.Build.0 = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|iPhone.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|iPhone.Build.0 = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|x86.ActiveCfg = Release|Any CPU
{00A3D52F-BA8F-49A3-BDF8-FA457E866F3A}.Release|x86.Build.0 = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|ARM.ActiveCfg = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|ARM.Build.0 = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|iPhone.Build.0 = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|x86.ActiveCfg = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Debug|x86.Build.0 = Debug|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|Any CPU.Build.0 = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|ARM.ActiveCfg = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|ARM.Build.0 = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|iPhone.ActiveCfg = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|iPhone.Build.0 = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|x86.ActiveCfg = Release|Any CPU
{F177D383-F30F-4E09-B5C8-034525582FA8}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -441,5 +496,6 @@ Global
{EE8989C3-2C73-4941-9F7E-5470344E9661} = {F1218241-9ED7-4DFA-9943-868AF26365CC}
{09A7BE45-2A38-4087-87E5-FCC842D0742A} = {F1218241-9ED7-4DFA-9943-868AF26365CC}
{87B049E5-878F-4694-9E83-D5A74C653039} = {F1218241-9ED7-4DFA-9943-868AF26365CC}
{F177D383-F30F-4E09-B5C8-034525582FA8} = {F1218241-9ED7-4DFA-9943-868AF26365CC}
EndGlobalSection
EndGlobal
40 changes: 28 additions & 12 deletions Portable.Ninject.nuspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>

<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Portable.Ninject</id>
Expand All @@ -19,47 +18,64 @@
<summary>IoC container for .NET</summary>
<releaseNotes>Xamarin support for iOS and Android</releaseNotes>
<tags>Ninject ioc di portable pcl xamarin ios android monotouch monoandroid</tags>
<dependencies>
<group targetFramework="dotnet">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend using NuSpec.ReferenceGenerator to add/update the dependencies as they can change over time and the tool will ensure they're up-to-date.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually tried. But for some reason it didn't work. NuSpec.ReferenceGenerator wasn't getting added to the project.json. I didn't have time to look into it yet.

<dependency id="System.Collections" version="4.0.10" />
<dependency id="System.ComponentModel" version="4.0.0" />
<dependency id="System.Diagnostics.Debug" version="4.0.10" />
<dependency id="System.IO" version="4.0.10" />
<dependency id="System.IO.FileSystem" version="4.0.0" />
<dependency id="System.Linq" version="4.0.0" />
<dependency id="System.Linq.Expressions" version="4.0.10" />
<dependency id="System.Reflection" version="4.0.10" />
<dependency id="System.Reflection.Emit.ILGeneration" version="4.0.0" />
<dependency id="System.Reflection.Emit.LightWeight" version="4.0.0" />
<dependency id="System.Reflection.Extensions" version="4.0.0" />
<dependency id="System.Reflection.Primitives" version="4.0.0" />
<dependency id="System.Reflection.TypeExtensions" version="4.0.0" />
<dependency id="System.Runtime" version="4.0.20" />
<dependency id="System.Runtime.Extensions" version="4.0.10" />
<dependency id="System.Threading" version="4.0.10" />
<dependency id="System.Threading.Tasks" version="4.0.10" />
<dependency id="System.Threading.Timer" version="4.0.0" />
</group>
</dependencies>
</metadata>
<files>

<!-- PCL -->
<file src="src\Ninject\bin\PCL\Release\Ninject.dll" target="lib\portable-net451+win81+wpa81+monotouch+monoandroid+Xamarin.iOS\Ninject.dll" />
<file src="src\Ninject\bin\PCL\Release\Ninject.pdb" target="lib\portable-net451+win81+wpa81+monotouch+monoandroid+Xamarin.iOS\Ninject.pdb" />
<file src="src\Ninject\bin\PCL\Release\Ninject.xml" target="lib\portable-net451+win81+wpa81+monotouch+monoandroid+Xamarin.iOS\Ninject.xml" />

<!-- .NET 4.5.1 -->
<file src="src\Ninject\bin\Net4\Release\Ninject.dll" target="lib\net451\Ninject.dll" />
<file src="src\Ninject\bin\Net4\Release\Ninject.pdb" target="lib\net451\Ninject.pdb" />
<file src="src\Ninject\bin\Net4\Release\Ninject.xml" target="lib\net451\Ninject.xml" />

<!-- Win8.1 -->
<file src="src\Ninject\bin\WinRT\Release\Ninject.dll" target="lib\win81\Ninject.dll" />
<file src="src\Ninject\bin\WinRT\Release\Ninject.pdb" target="lib\win81\Ninject.pdb" />
<file src="src\Ninject\bin\WinRT\Release\Ninject.xml" target="lib\win81\Ninject.xml" />
<file src="src\Ninject\bin\WinRT\Release\Ninject.pri" target="lib\win81\Ninject.pri" />

<!-- Wpa81 -->
<file src="src\Ninject\bin\Wpa81\Release\Ninject.dll" target="lib\Wpa81\Ninject.dll" />
<file src="src\Ninject\bin\Wpa81\Release\Ninject.pdb" target="lib\Wpa81\Ninject.pdb" />
<file src="src\Ninject\bin\Wpa81\Release\Ninject.xml" target="lib\Wpa81\Ninject.xml" />
<file src="src\Ninject\bin\Wpa81\Release\Ninject.pri" target="lib\Wpa81\Ninject.pri" />

<!-- iOS Classic -->
<!-- iOS Classic -->
<file src="src\Ninject\bin\iPhone\Release\Ninject.dll" target="lib\monotouch\Ninject.dll" />
<file src="src\Ninject\bin\iPhone\Release\Ninject.pdb" target="lib\monotouch\Ninject.pdb" />
<file src="src\Ninject\bin\iPhone\Release\Ninject.xml" target="lib\monotouch\Ninject.xml" />

<!-- iOS Unified -->
<file src="src\Ninject\bin\iOS-Unified\Release\Ninject.dll" target="lib\Xamarin.iOS\Ninject.dll" />
<file src="src\Ninject\bin\iOS-Unified\Release\Ninject.pdb" target="lib\Xamarin.iOS\Ninject.pdb" />
<file src="src\Ninject\bin\iOS-Unified\Release\Ninject.xml" target="lib\Xamarin.iOS\Ninject.xml" />

<!-- Android -->
<!-- Android -->
<file src="src\Ninject\bin\Android\Release\Ninject.dll" target="lib\monoandroid\Ninject.dll" />
<file src="src\Ninject\bin\Android\Release\Ninject.pdb" target="lib\monoandroid\Ninject.pdb" />
<file src="src\Ninject\bin\Android\Release\Ninject.xml" target="lib\monoandroid\Ninject.xml" />


<!-- dotnet -->
<file src="src\Ninject\bin\dotnet\Release\Ninject.dll" target="lib\dotnet\Ninject.dll" />
<file src="src\Ninject\bin\dotnet\Release\Ninject.pdb" target="lib\dotnet\Ninject.pdb" />
<file src="src\Ninject\bin\dotnet\Release\Ninject.xml" target="lib\dotnet\Ninject.xml" />
<file src="src\**\*.cs" target="src" exclude="src\_ReSharper.*\**\*.*;packages\**\*.*;src\**\Debug\**\*.*;" />
</files>
</package>
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": [
"wrap"
]
}
8 changes: 4 additions & 4 deletions src/Ninject.Test/Integration/DefaultScopeCallbackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void CanOverrideDefaultScopeWithSingletonInBinding()
binding.ScopeCallback.Should().BeSameAs(StandardScopeCallbacks.Singleton);
}

#if !WINRT
#if !WINRT && !DOTNET
[Fact]
public void CanOverrideDefaultScopeWithThreadInBinding()
{
Expand Down Expand Up @@ -144,7 +144,7 @@ public void CanOverrideDefaultScopeWithTransientInBinding()
var binding = kernel.GetBindings(typeof(IService)).FirstOrDefault();
binding.ScopeCallback.Should().BeSameAs(StandardScopeCallbacks.Transient);
}
#if !WINRT
#if !WINRT && !DNXCORE50
[Fact]
public void ScopeShouldBeThread()
{
Expand All @@ -158,7 +158,7 @@ public void ImplicitSelfBindedTypeShouldBeTransient()
TestSelfBindedTypesAreTransient();
}

#if !WINRT
#if !WINRT && !DNXCORE50
[Fact]
public void ExplicitSelfBindedTypeShouldHaveThreadScope()
{
Expand All @@ -172,7 +172,7 @@ protected override void InitializeKernel()
{
var settings = new NinjectSettings
{
#if !WINRT
#if !WINRT && !DNXCORE50
DefaultScopeCallback = StandardScopeCallbacks.Thread
#endif
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !NO_ASSEMBLY_SCANNING && !NO_MOQ
#if !NO_ASSEMBLY_SCANNING && !NO_MOQ && !DOTNET
namespace Ninject.Tests.Integration.ModuleLoadingTests
{
using System.Linq;
Expand All @@ -13,6 +13,7 @@ public class WhenLoadIsCalledWithAssemblies : ModuleLoadingContext
public void ModulesContainedInAssembliesAreLoaded()
{
var expectedModules = new[] { typeof(TestModule), typeof(TestModule2), typeof(OtherFakes.TestModule) };

var assembly = Assembly.GetExecutingAssembly();

this.Kernel.Load(assembly);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !NO_ASSEMBLY_SCANNING && !NO_MOQ
#if !NO_ASSEMBLY_SCANNING && !NO_MOQ && !DOTNET
namespace Ninject.Tests.Integration.ModuleLoadingTests
{
using System;
Expand Down
2 changes: 1 addition & 1 deletion src/Ninject.Test/Integration/ThreadScopeTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !WINRT
#if !WINRT && !DNXCORE50
namespace Ninject.Tests.Integration.ThreadScopeTests
{
using System;
Expand Down
2 changes: 2 additions & 0 deletions src/Ninject.Test/Unit/AssemblyNameRetrieverTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if !NO_MOQ
#if !NO_ASSEMBLY_SCANNING
#if !DOTNET
namespace Ninject.Tests.Unit
{
using System;
Expand Down Expand Up @@ -68,5 +69,6 @@ public void WillBeIgnored()
}
}
}
#endif //!DOTNET
#endif //!NO_ASSEMBLY_SCANNING
#endif
2 changes: 2 additions & 0 deletions src/Ninject.Test/Unit/CompiledModuleLoaderPluginTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if !NO_MOQ
#if !NO_ASSEMBLY_SCANNING
#if !DOTNET
namespace Ninject.Tests.Unit.CompiledModuleLoaderPluginTests
{
using System;
Expand Down Expand Up @@ -51,5 +52,6 @@ public void DoesNotLoadAssembliesWithoutModules()
}
}
}
#endif //!DOTNET
#endif //!NO_ASSEMBLY_SCANNING
#endif
2 changes: 2 additions & 0 deletions src/Ninject.Test/Unit/ModuleLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public ModuleLoaderContext()
}
}

#if !DOTNET
public class WhenLoadModulesIsCalled : ModuleLoaderContext
{
[Fact]
Expand All @@ -50,6 +51,7 @@ public void PassesMatchingFilesToAppropriatePlugin()
barPluginMock.Verify(x => x.LoadModules(It.Is<IEnumerable<string>>(e => e.SequenceEqual(barFiles))));
}
}
#endif //!DOTNET
}
#endif //!NO_ASSEMBLY_SCANNING
#endif
24 changes: 24 additions & 0 deletions src/Ninject.dotnet.Tests/Ninject.dotnet/Ninject.dotnet.Tests.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>f177d383-f30f-4e09-b5c8-034525582fa8</ProjectGuid>
<RootNamespace>Ninject.dotnet</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Ninject.dotnet\Ninject-dotnet.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
29 changes: 29 additions & 0 deletions src/Ninject.dotnet.Tests/Ninject.dotnet/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "1.0.0-*",
"description": "Ninject dotnet Tests",
"compile": [
"../../Ninject.Test/**/*.cs"
],

"dependencies": {
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-beta6-build191"
},

"commands": {
"test": "xunit.runner.dnx"
},

"frameworks": {
"dnxcore50": {
"compilationOptions": {
"define": [ "DOTNET", "NO_MOQ" ]
},
"dependencies": {
"FluentAssertions": "4.0.1",
"moq.netcore": "4.4.0-beta8",
"Ninject": "99.99.99-dev"
}
}
}
}
Loading