Skip to content

Commit

Permalink
updated packages to support netcore1.0 and RabbitMQ.Client 4.0.0-ci
Browse files Browse the repository at this point in the history
need to add pre-release nuget feed for rabbit https://ci.appveyor.com/nuget/rabbitmq-dotnet-client-ci

Also had to change the call to PublishBasic in RabbitAdvancedBus and remove the imediate flag. No Idea why, but it would not compile with it.
  • Loading branch information
radicalgeek authored and micdenny committed Aug 13, 2016
1 parent a5ec600 commit 6c3bda5
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 74 deletions.
1 change: 1 addition & 0 deletions Source/.vs/restore.dg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#:C:\Users\mark\Source\Repos\EasyNetQ\Source\EasyNetQ DNX\EasyNetQ DNX.xproj
4 changes: 1 addition & 3 deletions Source/EasyNetQ DNX/EasyNetQ DNX.xproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
<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>ed270a39-d32c-438a-bf4f-aa0e66c7879c</ProjectGuid>
<RootNamespace>EasyNetQ_DNX</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
72 changes: 37 additions & 35 deletions Source/EasyNetQ DNX/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"version": "1.0.0-*",
"description": "EasyNetQ DNX Class Library",
"authors": [ "SapientGuardian" ],
Expand All @@ -7,43 +7,45 @@
"licenseUrl": "",
"compile": [ "../EasyNetQ/*.cs", "../EasyNetQ/**/*.cs" ],
"frameworks": {
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Runtime.Handles": "4.0.1-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Threading.Tasks": "4.0.11-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.Extensions": "4.0.1-beta-23516",
"System.Runtime.InteropServices": "4.0.21-beta-23516",
"System.Linq.Expressions": "4.0.11-beta-23516",
"System.Runtime.Extensions": "4.0.11-beta-23516",
"System.Resources.ResourceManager": "4.0.1-beta-23516",
"System.Globalization": "4.0.11-beta-23516",
"System.Diagnostics.Debug": "4.0.11-beta-23516",
"System.Dynamic.Runtime": "4.0.11-beta-23516",
"System.Reflection.Emit": "4.0.1-beta-23516",
"System.Reflection.Emit.ILGeneration": "4.0.1-beta-23516",
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.ObjectModel": "4.0.11-beta-23516",
"System.Text.Encoding.Extensions": "4.0.11-beta-23516",
"System.IO.FileSystem.Primitives": "4.0.1-beta-23516",
"System.IO.FileSystem": "4.0.1-beta-23516",
"System.IO": "4.0.11-beta-23516",
"System.Diagnostics.Tools": "4.0.1-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
"System.IO.Compression": "4.1.0-beta-23516",
"System.Threading.Timer": "4.0.1-beta-23516",
"System.Net.NameResolution": "4.0.0-beta-23516"
"netcoreapp1.0": {
"imports": "dnxcore50",
"buildOptions": {
"define": [ "NET_CORE" ]
}
}
},
"dependencies": {
"Newtonsoft.Json": "8.0.1",
"RabbitMQ.Client.CoreClrUnofficial": "3.5.6.1"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
},
"Newtonsoft.Json": "9.0.1",
"RabbitMQ.Client": "4.0.0-ci-201607010902",
"System.Diagnostics.Debug": "4.0.11",
"System.Diagnostics.Tools": "4.0.1",
"System.Dynamic.Runtime": "4.0.11",
"System.Globalization": "4.0.11",
"System.IO": "4.1.0",
"System.IO.Compression": "4.1.0",
"System.IO.FileSystem": "4.0.1",
"System.IO.FileSystem.Primitives": "4.0.1",
"System.Linq.Expressions": "4.1.0",
"System.ObjectModel": "4.0.12",
"System.Reflection": "4.1.0",
"System.Reflection.Emit": "4.0.1",
"System.Reflection.Emit.ILGeneration": "4.0.1",
"System.Reflection.Emit.Lightweight": "4.0.1",
"System.Reflection.Extensions": "4.0.1",
"System.Reflection.Primitives": "4.0.1",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Resources.ResourceManager": "4.0.1",
"System.Runtime.Extensions": "4.1.0",
"System.Runtime.Handles": "4.0.1",
"System.Runtime.InteropServices": "4.1.0",
"System.Text.Encoding": "4.0.11",
"System.Text.Encoding.Extensions": "4.0.11",
"System.Threading.Tasks": "4.0.11",
"System.Threading.Timer": "4.0.1",
"Microsoft.Extensions.Logging.TraceSource": "1.0.0"
}
}
6 changes: 3 additions & 3 deletions Source/EasyNetQ/AutoSubscribe/AutoSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected virtual void InvokeMethods(IEnumerable<KeyValuePair<Type, AutoSubscrib
.GetMethod(dispatchName, BindingFlags.Instance | BindingFlags.Public)
.MakeGenericMethod(subscriptionInfo.MessageType, subscriptionInfo.ConcreteType);

#if DOTNET5_4
#if NET_CORE
var dispatchDelegate = dispatchMethod.CreateDelegate(
subscriberTypeFromMessageTypeDelegate(subscriptionInfo.MessageType),
AutoSubscriberMessageDispatcher);
Expand Down Expand Up @@ -239,7 +239,7 @@ private SubscriptionConfigurationAttribute GetSubscriptionConfigurationAttribute

protected virtual bool IsValidMarkerType(Type markerType)
{
#if DOTNET5_4
#if NET_CORE
return markerType.GetTypeInfo().IsInterface && markerType.GetMethods().Any(m => m.Name == ConsumeMethodName);
#else
return markerType.IsInterface && markerType.GetMethods().Any(m => m.Name == ConsumeMethodName);
Expand Down Expand Up @@ -280,7 +280,7 @@ private MethodInfo GetExplicitlyDeclaredInterfaceMethod(Type messageType)

protected virtual IEnumerable<KeyValuePair<Type, AutoSubscriberConsumerInfo[]>> GetSubscriptionInfos(IEnumerable<Type> types,Type interfaceType)
{
#if DOTNET5_4
#if NET_CORE
foreach (var concreteType in types.Where(t => t.GetTypeInfo().IsClass && !t.GetTypeInfo().IsAbstract))
{
var subscriptionInfos = concreteType.GetInterfaces()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.AutoSubscribe
{
#if !DOTNET5_4
#if !NET_CORE
#endif
[AttributeUsage(AttributeTargets.Method)]
public class AutoSubscriberConsumerAttribute : Attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.AutoSubscribe
{
#if !DOTNET5_4
#if !NET_CORE
#endif
public class AutoSubscriberConsumerInfo
{
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/AutoSubscribe/ForTopicAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.AutoSubscribe
{
#if !DOTNET5_4
#if !NET_CORE
#endif
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class ForTopicAttribute : Attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.AutoSubscribe
{
#if !DOTNET5_4
#if !NET_CORE
#endif
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public class SubscriptionConfigurationAttribute : Attribute
Expand Down
4 changes: 2 additions & 2 deletions Source/EasyNetQ/ConnectionConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ConnectionConfiguration()
private void SetDefaultClientProperties(IDictionary<string, object> clientProperties)
{
string applicationNameAndPath = null;
#if DOTNET5_4
#if NET_CORE
var version = this.GetType().GetTypeInfo().Assembly.GetName().Version.ToString();
#else
var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
Expand All @@ -94,7 +94,7 @@ private void SetDefaultClientProperties(IDictionary<string, object> clientProper
catch (PathTooLongException) { }
}

#if DOTNET5_4
#if NET_CORE
var hostname = System.Net.Dns.GetHostName();
#else
var hostname = Environment.MachineName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static Action<TContaining, TProperty> CreateSetter<TContaining, TProperty
Preconditions.CheckNotNull(property, "getter", "Member is not a property.");
Preconditions.CheckTrue(property.CanWrite, "getter", "Member is not a writeable property.");

#if DOTNET5_4
#if NET_CORE
return (Action<TContaining, TProperty>)property.GetSetMethod().CreateDelegate(typeof(Action<TContaining, TProperty>));

#else
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/Consumer/ExclusiveConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ IEventBus eventBus
this.configuration = configuration;
this.internalConsumerFactory = internalConsumerFactory;
this.eventBus = eventBus;
#if DOTNET5_4
#if NET_CORE
timer = new Timer(s =>
{
StartConsumer();
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/Consumer/HandlerCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public Func<IMessage, MessageReceivedInfo, Task> GetHandler(Type messageType)

// no exact handler match found, so let's see if we can find a handler that
// handles a supertype of the consumed message.
#if DOTNET5_4
#if NET_CORE
var handlerType = handlers.Keys.FirstOrDefault(type => type.GetTypeInfo().IsAssignableFrom(messageType.GetTypeInfo()));
#else
var handlerType = handlers.Keys.FirstOrDefault(type => type.IsAssignableFrom(messageType));
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/DeliveryModeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ
{
#if !DOTNET5_4
#if !NET_CORE
#endif
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
public class DeliveryModeAttribute : Attribute
Expand Down
12 changes: 6 additions & 6 deletions Source/EasyNetQ/EasyNetQException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ
{
#if !DOTNET5_4
#if !NET_CORE
#endif
public class EasyNetQException : Exception
{
Expand All @@ -11,31 +11,31 @@ public EasyNetQException(string message) : base(message) {}
public EasyNetQException(string format, params string[] args) : base(string.Format(format, args)) {}
public EasyNetQException(string message, Exception inner) : base(message, inner) {}

#if !DOTNET5_4
#if !NET_CORE
#endif
}

#if !DOTNET5_4
#if !NET_CORE
#endif
public class EasyNetQInvalidMessageTypeException : EasyNetQException
{
public EasyNetQInvalidMessageTypeException() {}
public EasyNetQInvalidMessageTypeException(string message) : base(message) {}
public EasyNetQInvalidMessageTypeException(string format, params string[] args) : base(format, args) {}
public EasyNetQInvalidMessageTypeException(string message, Exception inner) : base(message, inner) {}
#if !DOTNET5_4
#if !NET_CORE
#endif
}

#if !DOTNET5_4
#if !NET_CORE
#endif
public class EasyNetQResponderException : EasyNetQException
{
public EasyNetQResponderException() { }
public EasyNetQResponderException(string message) : base(message) { }
public EasyNetQResponderException(string format, params string[] args) : base(format, args) { }
public EasyNetQResponderException(string message, Exception inner) : base(message, inner) { }
#if !DOTNET5_4
#if !NET_CORE
#endif
}
}
4 changes: 2 additions & 2 deletions Source/EasyNetQ/MessageVersioning/MessageVersionStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static Stack<Type> ExtractMessageVersions( Type type )

private static Type GetSupersededType( Type type )
{
#if DOTNET5_4
#if NET_CORE
return type
.GetInterfaces()
.Where( t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == typeof( ISupersede<> ) )
Expand All @@ -73,7 +73,7 @@ private static Type GetSupersededType( Type type )

private static void EnsureVersioningValid( Type messageType, Type supersededType )
{
#if DOTNET5_4
#if NET_CORE
if ( !messageType.GetTypeInfo().IsSubclassOf( supersededType ) )
throw new EasyNetQException( "Message cannot supersede a type it is not a subclass of. {0} is not a subclass of {1}", messageType.Name, supersededType.Name );
#else
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/PersistentConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public bool IsConnected
void StartTryToConnect()
{
Timer timer;
#if DOTNET5_4
#if NET_CORE
timer = new Timer(TryToConnect, null, connectionFactory.Configuration.ConnectIntervalAttempt, Timeout.InfiniteTimeSpan);
#else
timer = new Timer(TryToConnect);
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/Preconditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public static void CheckShortString(string value, string name)
public static void CheckTypeMatches(Type expectedType, object value, string name, string message)
{
bool assignable;
#if DOTNET5_4
#if NET_CORE
assignable = expectedType.GetTypeInfo().IsAssignableFrom(value.GetType().GetTypeInfo());
#else
assignable = expectedType.IsAssignableFrom(value.GetType());
Expand Down
4 changes: 2 additions & 2 deletions Source/EasyNetQ/Producer/PublishInterruptedException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.Producer
{
#if !DOTNET5_4
#if !NET_CORE
#endif
public class PublishInterruptedException : Exception
{
Expand All @@ -26,7 +26,7 @@ public PublishInterruptedException(string message, Exception inner)
: base(message, inner)
{
}
#if !DOTNET5_4
#if !NET_CORE
#endif
}
}
4 changes: 2 additions & 2 deletions Source/EasyNetQ/Producer/PublishNackedException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.Producer
{
#if !DOTNET5_4
#if !NET_CORE
#endif
public class PublishNackedException : Exception
{
Expand All @@ -24,7 +24,7 @@ public PublishNackedException(string message) : base(message)
public PublishNackedException(string message, Exception inner) : base(message, inner)
{
}
#if !DOTNET5_4
#if !NET_CORE
#endif
}
}
2 changes: 1 addition & 1 deletion Source/EasyNetQ/Producer/Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public virtual Task<TResponse> Request<TRequest, TResponse>(TRequest request)
var requestType = typeof(TRequest);

Timer timer;
#if DOTNET5_4
#if NET_CORE
timer = new Timer(state =>
{
((Timer)state).Dispose();
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/QueueAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ
{
#if !DOTNET5_4
#if !NET_CORE
#endif
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple=false)]
public class QueueAttribute : Attribute
Expand Down
4 changes: 2 additions & 2 deletions Source/EasyNetQ/RabbitHutch.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
#if !DOTNET5_4
#if !NET_CORE
using System.Configuration;
#endif
using EasyNetQ.ConnectionString;
Expand All @@ -26,7 +26,7 @@ public static void SetContainerFactory(Func<IContainer> createContainer)
createContainerInternal = createContainer;
}

#if !DOTNET5_4
#if !NET_CORE
/// <summary>
/// Creates a new instance of <see cref="RabbitBus"/>.
/// The RabbitMQ broker is defined in the connection string named 'rabbit'.
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/ReflectionHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ReflectionHelpers

private static Dictionary<Type, Attribute[]> GetOrAddTypeAttributeDictionary(Type type)
{
#if DOTNET5_4
#if NET_CORE
return typesAttributes.GetOrAdd(type, t => t.GetTypeInfo().GetCustomAttributes(true)
.Cast<Attribute>()
.GroupBy(attr => attr.GetType())
Expand Down
2 changes: 1 addition & 1 deletion Source/EasyNetQ/SystemMessages/ScheduleMe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace EasyNetQ.SystemMessages
{
#if !DOTNET5_4
#if !NET_CORE
#endif
public class ScheduleMe
{
Expand Down
Loading

0 comments on commit 6c3bda5

Please sign in to comment.