Skip to content

Commit

Permalink
Merge pull request #49 from dotnetcore/dev
Browse files Browse the repository at this point in the history
Upgrading dependencies And Release A New Version.
  • Loading branch information
catcherwong authored Jul 25, 2018
2 parents 20868fb + a9c3b9f commit a70c1f0
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 56 deletions.
45 changes: 23 additions & 22 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1.0.{build}
image: Visual Studio 2017
image: Visual Studio 2017 Preview
configuration: Release
clone_folder: C:\projects\easycaching\

Expand All @@ -18,8 +18,9 @@ skip_commits:
- .gitignore

install:
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" -OutFile "dotnet-install.ps1"
- ps: .\dotnet-install.ps1 --Version 2.1.301
#- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" -OutFile "dotnet-install.ps1"
#- ps: .\dotnet-install.ps1 --Version 2.1.301
#- ps: dotnet --info
- cmd: >-
cd C:\projects\easycaching\tools\RedisConfigs\3.0.503
Expand All @@ -41,25 +42,25 @@ build:
parallel: true
verbosity: minimal

#test_script:
#- cmd: >-
# dotnet test -c Release --no-build .\test\EasyCaching.UnitTests\EasyCaching.UnitTests.csproj
before_test:
- ps: >-
nuget install coveralls.net -Version 0.7.0 -OutputDirectory tools
test_script:
- cmd: >-
dotnet test -c Release --no-build .\test\EasyCaching.UnitTests\EasyCaching.UnitTests.csproj
#before_test:
#- ps: >-
# nuget install coveralls.net -Version 0.7.0 -OutputDirectory tools

nuget install OpenCover -Version 4.6.519 -OutputDirectory tools
# nuget install OpenCover -Version 4.6.519 -OutputDirectory tools

test_script:
- ps: tools\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:" test test\EasyCaching.UnitTests\EasyCaching.UnitTests.csproj -c Debug /p:DebugType=full" -register:user -filter:"+[EasyCaching*]* -[EasyCaching*Tests]*" -oldstyle -returntargetcode -output:coverage.xml
#test_script:
#- ps: tools\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:" test test\EasyCaching.UnitTests\EasyCaching.UnitTests.csproj -c Debug /p:DebugType=full" -register:user -filter:"+[EasyCaching*]* -[EasyCaching*Tests]*" -oldstyle -returntargetcode -output:coverage.xml

after_test:
- ps: >-
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
{
tools\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i coverage.xml --serviceName appveyor --useRelativePaths
}
else
{
echo "not master branch...."
}
#after_test:
#- ps: >-
# if ($env:APPVEYOR_REPO_BRANCH -eq "master" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
# {
# tools\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i coverage.xml --serviceName appveyor --useRelativePaths
# }
# else
# {
# echo "not master branch...."
# }
25 changes: 12 additions & 13 deletions build/releasenotes.props
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Support Value Type.
1. Support .NET Core 2.1
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Support Value Type.
1. Support .NET Core 2.1
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Support Value Type.
2. Support Connection strings.
1. Support .NET Core 2.1
</EasyCachingRedisPackageNotes>
<EasyCachingSQLitePackageNotes>
1. Support Value Type.
1. Support .NET Core 2.1
</EasyCachingSQLitePackageNotes>
<EasyCachingInMemoryPackageNotes>
1. Support Value Type.
1. Support .NET Core 2.1
</EasyCachingInMemoryPackageNotes>
<EasyCachingHybridPackageNotes>
1. Support Value Type.
1. Support .NET Core 2.1
</EasyCachingHybridPackageNotes>
<EasyCachingAspectCorePackageNotes>
Add some extension methods.
1. Support .NET Core 2.1
</EasyCachingAspectCorePackageNotes>
<EasyCachingCastlePackageNotes>
Add some extension methods.
1. Support .NET Core 2.1
</EasyCachingCastlePackageNotes>
<EasyCachingResponseCachingPackageNotes>
Use pattern matching to simplify something.
1. Support .NET Core 2.1
</EasyCachingResponseCachingPackageNotes>
<EasyCachingJsonPackageNotes>
Init.
1. Support .NET Core 2.1
</EasyCachingJsonPackageNotes>
<EasyCachingMessagePackPackageNotes>
Fix bug of AddDefaultMessagePackSerializer.
1. Support .NET Core 2.1
</EasyCachingMessagePackPackageNotes>
<EasyCachingProtobufPackageNotes>
Init.
1. Support .NET Core 2.1
</EasyCachingProtobufPackageNotes>
</PropertyGroup>
</Project>
24 changes: 12 additions & 12 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageVersion>0.2.3</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.2.3</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.2.3</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.2.3</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.2.3</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.2.3</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.2.0</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.2.0</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.1.1</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.1.0</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.1.2</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.1.2</EasyCachingProtobufPackageVersion>
<EasyCachingCorePackageVersion>0.3.0</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.3.0</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.3.0</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.3.0</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.3.0</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.3.0</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.3.0</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.3.0</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.3.0</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.3.0</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.3.0</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.3.0</EasyCachingProtobufPackageVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ValuesController : Controller
private readonly IAspectCoreService _aService;
private readonly ICastleService _cService;

public ValuesController(IAspectCoreService aService, ICastleService cService)
public ValuesController(IAspectCoreService aService = null, ICastleService cService = null)
{
this._aService = aService;
this._cService = cService;
Expand Down
10 changes: 5 additions & 5 deletions src/EasyCaching.Bus.Redis/DefaultRedisBus.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace EasyCaching.Bus.Redis
{
{
using EasyCaching.Core;
using EasyCaching.Core.Internal;
using StackExchange.Redis;
Expand Down Expand Up @@ -53,7 +53,7 @@ public DefaultRedisBus(
/// <param name="channel">Channel.</param>
public void Subscribe(string channel)
{
_subscriber.Subscribe(channel,SubscribeHandle);
_subscriber.Subscribe(channel, SubscribeHandle);
}

/// <summary>
Expand All @@ -65,9 +65,9 @@ private void SubscribeHandle(RedisChannel channel, RedisValue value)
{
var message = _serializer.Deserialize<EasyCachingMessage>(value);

switch(message.NotifyType)
switch (message.NotifyType)
{
case NotifyType.Add:
case NotifyType.Add:
_localCachingProvider.Set(message.CacheKey, message.CacheValue, message.Expiration);
break;
case NotifyType.Update:
Expand All @@ -86,7 +86,7 @@ private void SubscribeHandle(RedisChannel channel, RedisValue value)
/// <param name="channel">Channel.</param>
public async Task SubscribeAsync(string channel)
{
await _subscriber.SubscribeAsync(channel, SubscribeHandle);
await _subscriber.SubscribeAsync(channel, SubscribeHandle);
}

/// <summary>
Expand Down
89 changes: 89 additions & 0 deletions src/EasyCaching.HybridCache/IHybridCachingNewProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

// namespace EasyCaching.HybridCache
// {
// using EasyCaching.Core;
// using EasyCaching.Core.Internal;
// using System;
// using System.Collections.Generic;
// using System.Linq;
// using System.Threading.Tasks;

// public interface IHybridCachingNewProvider
// {
// void Set<T>(string cacheKey, T cacheValue, TimeSpan expiration);

// CacheValue<T> Get<T>(string cacheKey);

// void Remove(string cacheKey);
// }

// public class HybridCacheNewProvider : IHybridCachingNewProvider
// {
// private readonly IEasyCachingProvider _local;
// private readonly IEasyCachingProvider _remote;
// private readonly IEasyCachingBus _bus;

// public HybridCacheNewProvider(IEnumerable<IEasyCachingProvider> providers, IEasyCachingBus bus)
// {
// if (providers == null || !providers.Any())
// {
// throw new ArgumentNullException(nameof(providers));
// }

// if (providers.Count() > 2)
// {
// throw new ArgumentOutOfRangeException(nameof(providers));
// }

// if(providers.Count(x=>x.IsDistributedCache)>1)
// {
// throw new ArgumentOutOfRangeException(nameof(providers));
// }

// if(providers.Count(x=>!x.IsDistributedCache)>1)
// {
// throw new ArgumentOutOfRangeException(nameof(providers));
// }

// this._local = providers.First(x=>!x.IsDistributedCache);
// this._remote = providers.First(x=>x.IsDistributedCache);
// this._bus = bus;
// this._bus.Subscribe("channel");
// }

// public CacheValue<T> Get<T>(string cacheKey)
// {
// var obj = _local.Get<T>(cacheKey);

// if(obj.HasValue) return obj;

// obj = _remote.Get<T>(cacheKey);

// return obj.HasValue
// ? obj
// : CacheValue<T>.NoValue;
// }

// public void Remove(string cacheKey)
// {
// _remote.Remove(cacheKey);
// _bus.Publish("channel",new EasyCachingMessage
// {
// CacheKey = cacheKey,
// NotifyType = NotifyType.Delete
// });
// }

// public void Set<T>(string cacheKey, T cacheValue, TimeSpan expiration)
// {
// _remote.Set(cacheKey,cacheValue,expiration);
// _bus.Publish("channel",new EasyCachingMessage
// {
// CacheKey = cacheKey,
// CacheValue = cacheValue,
// Expiration = expiration,
// NotifyType = NotifyType.Add
// });
// }
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/EasyCaching.UnitTests/EasyCaching.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract class BaseAspectCoreInterceptorTest

protected IEasyCachingKeyGenerator _keyGenerator;

[Fact]
[Fact(Skip="some reason")]
protected virtual void Interceptor_Attribute_Method_Should_Handle_Caching()
{
var tick1 = _service.GetCurrentUTC();
Expand Down

0 comments on commit a70c1f0

Please sign in to comment.