4 Commits

Author SHA1 Message Date
Austin Winstanley 930a7bbe9a aaaaaand now that travis ci is working, a fix for appveyor 2017-10-19 17:19:13 -05:00
Austin Winstanley 7ea68134ad another attempted fix for Travis CI build 2017-10-19 17:14:33 -05:00
Austin Winstanley 3fa56388a6 attempting fix for Travis CI build 2017-10-19 17:05:25 -05:00
Austin Winstanley 242ce14ef4 added support for DotNet 4.5, 4.6, NetStandard1.3, 1.4, 1.5,1.6 and added new sample console project for DotNet4.6 2017-10-19 16:38:05 -05:00
13 changed files with 330 additions and 15 deletions
+5 -1
View File
@@ -6,4 +6,8 @@ dist: trusty
sudo: required
script:
- dotnet restore
- dotnet build
- dotnet build -f netstandard1.3 ./src/Hangfire.Raven/Hangfire.Raven.csproj
- dotnet build -f netstandard1.4 ./src/Hangfire.Raven/Hangfire.Raven.csproj
- dotnet build -f netstandard1.5 ./src/Hangfire.Raven/Hangfire.Raven.csproj
- dotnet build -f netstandard1.6 ./src/Hangfire.Raven/Hangfire.Raven.csproj
- dotnet build -f netstandard2.0 ./src/Hangfire.Raven/Hangfire.Raven.csproj
+4 -1
View File
@@ -1,12 +1,15 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26923.0
VisualStudioVersion = 15.0.27004.2005
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{8CF2D2F6-BEFE-47FE-B141-0017FC6F97D8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
README.md = README.md
EndProjectSection
EndProject
+1 -1
View File
@@ -1,4 +1,4 @@
version: 1.0.{build}
version: 3.2.0.{build}
# branches to build
branches:
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>3.1.1</Version>
<AssemblyVersion>3.1.1.0</AssemblyVersion>
<FileVersion>3.1.1.0</FileVersion>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Version>3.2.0</Version>
<AssemblyVersion>3.2.0.0</AssemblyVersion>
<FileVersion>3.2.0.0</FileVersion>
<Description>RavenDB job storage for Hangfire - AspNetCore Example</Description>
<Authors>CadyIO &lt;contact@cady.io&gt;</Authors>
<Company>Cady IO</Company>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,10 @@
namespace Hangfire.Raven.Samples.Console.DotNet46
{
public class GenericServices<TType>
{
public void Method<TMethod>(TType arg1, TMethod arg2)
{
System.Console.WriteLine("Arg1: {0}, Arg2: {1}", arg1, arg2);
}
}
}
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{547D4C07-FC38-4920-9891-D04A5027C0A4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Hangfire.Raven.Samples.Console.DotNet46</RootNamespace>
<AssemblyName>Hangfire.Raven.Samples.Console.DotNet46</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Hangfire.Core, Version=1.6.17.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Hangfire.Core.1.6.17\lib\net45\Hangfire.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="Raven.Abstractions, Version=3.5.4.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<HintPath>..\..\packages\RavenDB.Client.3.5.4\lib\net45\Raven.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.Lightweight, Version=3.5.4.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<HintPath>..\..\packages\RavenDB.Client.3.5.4\lib\net45\Raven.Client.Lightweight.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GenericServices.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Hangfire.Raven\Hangfire.Raven.csproj">
<Project>{ba18f6bf-5613-4b9d-a57a-c05c51148ec5}</Project>
<Name>Hangfire.Raven</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,56 @@
using System;
using Hangfire.Raven.Storage;
namespace Hangfire.Raven.Samples.Console.DotNet46
{
class Program
{
public static int x = 0;
public static void Main()
{
try
{
// you can use Raven Storage and specify the connection string name
GlobalConfiguration.Configuration
.UseColouredConsoleLogProvider()
.UseRavenStorage("RavenDebug");
// you can use Raven Storage and specify the connection string and database name
//GlobalConfiguration.Configuration
// .UseColouredConsoleLogProvider()
// .UseRavenStorage("http://localhost:9090", "HangfireConsole");
// you can use Raven Embedded Storage which runs in memory!
//GlobalConfiguration.Configuration
// .UseColouredConsoleLogProvider()
// .UseEmbeddedRavenStorage();
//you have to create an instance of background job server at least once for background jobs to run
var client = new BackgroundJobServer();
// Run once
BackgroundJob.Enqueue(() => System.Console.WriteLine("Background Job: Hello, world!"));
BackgroundJob.Enqueue(() => Test());
// Run every minute
RecurringJob.AddOrUpdate(() => Test(), Cron.Minutely);
System.Console.WriteLine("Press Enter to exit...");
System.Console.ReadLine();
}
catch (Exception ex)
{
throw ex;
}
}
[AutomaticRetry(Attempts = 2, LogEvents = true, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
public static void Test()
{
System.Console.WriteLine($"{x++} Cron Job: Hello, world!");
//throw new ArgumentException("fail");
}
}
}
@@ -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("Hangfire.Raven.Samples.Console.DotNet46")]
[assembly: AssemblyDescription("RavenDB job storage for Hangfire - .Net 46 Console Example")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cady IO")]
[assembly: AssemblyProduct("Hangfire.Raven.Samples.Console.DotNet46")]
[assembly: AssemblyCopyright("Copyright © Cady LLC")]
[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("547d4c07-fc38-4920-9891-d04a5027c0a4")]
// 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("3.2.0.0")]
[assembly: AssemblyFileVersion("3.2.0.0")]
@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
namespace Hangfire.Raven.Samples.Console.DotNet46
{
public class Services
{
private static readonly Random _random = new Random();
public void EmptyDefault()
{
}
[Queue("critical")]
public void EmptyCritical()
{
}
[AutomaticRetry(Attempts = 0)]
public void Error()
{
System.Console.WriteLine("Beginning error task...");
throw new InvalidOperationException(null, new FileLoadException());
}
[Queue("critical")]
public void Random(int number)
{
int time;
lock (_random)
{
time = _random.Next(10);
}
if (time < 5)
{
throw new Exception();
}
Thread.Sleep(TimeSpan.FromSeconds(5 + time));
System.Console.WriteLine("Finished task: " + number);
}
public void Cancelable(int iterationCount, IJobCancellationToken token)
{
try
{
for (var i = 1; i <= iterationCount; i++)
{
Thread.Sleep(1000);
System.Console.WriteLine("Performing step {0} of {1}...", i, iterationCount);
token.ThrowIfCancellationRequested();
}
}
catch (OperationCanceledException)
{
System.Console.WriteLine("Cancellation requested, exiting...");
throw;
}
}
public void Args(string name, int authorId, DateTime createdAt)
{
System.Console.WriteLine("{0}, {1}, {2}", name, authorId, createdAt);
}
public void Custom(int id, string[] values, CustomObject objects, DayOfWeek dayOfWeek)
{
}
public void FullArgs(
bool b,
int i,
char c,
DayOfWeek e,
string s,
TimeSpan t,
DateTime d,
CustomObject o,
string[] sa,
int[] ia,
long[] ea,
object[] na,
List<string> sl)
{
}
public class CustomObject
{
public int Id { get; set; }
public CustomObject[] Children { get; set; }
}
public void Write(char character)
{
System.Console.Write(character);
}
public void WriteBlankLine()
{
System.Console.WriteLine();
}
}
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Hangfire.Core" version="1.6.17" targetFramework="net46" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
<package id="Owin" version="1.0" targetFramework="net46" />
<package id="RavenDB.Client" version="3.5.4" targetFramework="net46" />
</packages>
@@ -5,10 +5,10 @@
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>3.1.1</Version>
<AssemblyVersion>3.1.1.0</AssemblyVersion>
<FileVersion>3.1.1.0</FileVersion>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Version>3.2.0</Version>
<AssemblyVersion>3.2.0.0</AssemblyVersion>
<FileVersion>3.2.0.0</FileVersion>
<Description>RavenDB job storage for Hangfire - Console Example</Description>
<Authors>CadyIO &lt;contact@cady.io&gt;</Authors>
<Company>Cady IO</Company>
+4 -4
View File
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>3.1.1</Version>
<AssemblyVersion>3.1.1.0</AssemblyVersion>
<FileVersion>3.1.1.0</FileVersion>
<TargetFrameworks>netstandard2.0;netstandard1.6;netstandard1.5;netstandard1.4;netstandard1.3;net46;net45</TargetFrameworks>
<Version>3.2.0</Version>
<AssemblyVersion>3.2.0.0</AssemblyVersion>
<FileVersion>3.2.0.0</FileVersion>
<Description>RavenDB job storage for Hangfire</Description>
<Authors>CadyIO &lt;contact@cady.io&gt;</Authors>
<Company>Cady IO</Company>