Skip to content

Commit

Permalink
Merge branch 'releases/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
KeRNeLith committed Sep 4, 2022
2 parents 2a7af90 + c52146e commit 206f8b9
Show file tree
Hide file tree
Showing 43 changed files with 214 additions and 941 deletions.
4 changes: 2 additions & 2 deletions ImmediateReflection.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2043
# Visual Studio Version 17
VisualStudioVersion = 17.2.32526.322
MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ImmediateReflection.CommonInternals", "src\ImmediateReflection.CommonInternals\ImmediateReflection.CommonInternals.shproj", "{CE984360-54F0-406F-B8A9-E75897DAED3B}"
EndProject
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,10 @@ ImmediateType myImmediateType = myType.GetImmediateType();

- [![.NET Standard](https://img.shields.io/badge/.NET%20Standard-%3E%3D%202.0-blue.svg)](#)
- [![.NET Core](https://img.shields.io/badge/.NET%20Core-%3E%3D%202.0-blue.svg)](#)
- [![.NET Framework](https://img.shields.io/badge/.NET%20Framework-%3E%3D%202.0-blue.svg)](#)
- [![.NET Framework](https://img.shields.io/badge/.NET%20Framework-%3E%3D%204.0-blue.svg)](#)

Supports Source Link

---

## Dependencies

For targets higher than .NET Standard 2.0:
- System.Reflection.Emit.LightWeight

### Notes

- It uses NUnit3 for unit testing (not published).
Expand Down
22 changes: 16 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release notes

## What's new in 2.0.0 September 5 2022
### Updates:
* Update some serialization implementations for ImmediateReflection core types.
* Dynamic methods generated by ImmediateReflection always use the ImmediateReflection module.

### Misc:
* Get rid of targets anterior to .NET Framework 4.0.
* Add target .NET Standard 2.1 to simplify dependency tree when used.
* Assembly is CLS compliant (Common Language Specification).

## What's new in 1.6.1 September 4 2022
### Fixes:
* Fix wrong generated IL code for copy constructor under .NET5+ target.
Expand Down Expand Up @@ -29,7 +39,7 @@
### Fixes:
* Properly handle null parameter for Copy and TryCopy (return null).

### Changes:
### Updates:
* Copy and TryCopy consider string and Type as copyable types and return themselves if asked.

## What's new in 1.4.0 September 1 2019
Expand All @@ -42,7 +52,7 @@
* Add type extensions to check if a type has a copy constructor and to directly call it.
* Add object extensions to check if an instance can be copied by a copy constructor and to directly call it.

### Changes:
### Updates:
* Globally optimize the library by reducing the number of redundant null checks.
* Slightly optimize the branching in generated code.

Expand All @@ -56,7 +66,7 @@
### Fixes:
* ImmediateType properly handle arrays which were crashing before.

### Changes:
### Updates:
* Default constructor delegates available via ImmediateType are now cached and shared across several instance of ImmediateType.
* ImmediateProperty are now cached and shared across several instance of ImmediateType.
* ImmediateField are now cached and shared across several instance of ImmediateType.
Expand All @@ -70,13 +80,13 @@
### Fixes:
* Classes with indexed properties does not crash anymore.

### Changes:
### Updates:
* Lazily initialize fields property of ImmediateType.

---

## What's new in 1.1.0 June 24 2019
### Changes:
### Updates:
* Improve performances of memory caching within the library.
* Extend support of built-in cache to every target.
* Make some methods only available as extensions accessible as normal methods on targets not supporting extensions.
Expand All @@ -92,7 +102,7 @@
* Properly supports static readonly and constant fields.
* Properly handle reflection on enumeration types.

### Changes:
### Updates:
* Default flags taken into account when getting an ImmediateType are Public | Instance | Static
* Get rid of cache system references replaced by a simpler internal caching system.
* Extend caching support to target .NET Framework 4.0.
Expand Down
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '0.0.{build}'
image: Visual Studio 2019
image: Visual Studio 2022

# Setup environment
nuget:
Expand Down Expand Up @@ -27,10 +27,10 @@ skip_commits:
environment:
SONARQUBE_TOKEN:
secure: IDwa0NHtLUrg2jV3JZetUqUCGTgv3/UcZyYtMGvo7Pro1s9OmYTPjGMd6Vmx7Ktx
DocFXVersion: 2.58
NUnitConsoleVersion: 3.10.0
OpenCoverVersion: 4.7.922
CoverallsVersion: 1.0.0
DocFXVersion: 2.59.2
NUnitConsoleVersion: 3.15.2
OpenCoverVersion: 4.7.1221
CoverallsVersion: 4.0.1
COVERALLS_REPO_TOKEN:
secure: +DiJ+F7GIX0MMo/rtIRXO8GSdyYHa1CWKLw4H2Rx3AP27Shr6mZMC6l+muu2H/Dg
GITHUB_ACCESS_TOKEN:
Expand Down Expand Up @@ -119,7 +119,7 @@ test_script:
# Directory.Parent.Parent = tests\TestProject.Tests\bin
# Directory.Parent.Parent.Parent = tests\TestProject.Tests
$testAssemblies = (ls tests\*.Tests\bin\$env:Configuration\*\*Tests.dll | Where-Object { $_ -Match "net*" -and $_ -NotMatch "netcoreapp*" -and [System.IO.Path]::GetFileNameWithoutExtension($_.FullName) -Match $_.Directory.Parent.Parent.Parent.Name } | % FullName | sort-object -Unique);
$testAssemblies = (ls tests\*.Tests\bin\$env:Configuration\net461\*Tests.dll | Where-Object { $_ -Match "net*" -and $_ -NotMatch "netcoreapp*" -and [System.IO.Path]::GetFileNameWithoutExtension($_.FullName) -Match $_.Directory.Parent.Parent.Parent.Name } | % FullName | sort-object -Unique);
$testsPassed = $false;
if ($env:IsFullIntegrationBuild -eq $true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="fasterflect" Version="3.0.0" />
<PackageReference Include="FastMember.Signed" Version="1.5.0" />
<PackageReference Include="FlashReflection" Version="1.0.2" />
Expand Down
7 changes: 1 addition & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ You can find library sources on [GitHub](https://github.com/KeRNeLith/ImmediateR

- .NET Standard 2.0+
- .NET Core 2.0+
- .NET Framework 2.0+
- .NET Framework 4.0+

Supports Source Link

## Dependencies

For targets higher than .NET Standard 2.0:
- System.Reflection.Emit.LightWeight

## Installation

ImmediateReflection is available on [NuGet](https://www.nuget.org/packages/ImmediateReflection)
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@

<!-- Source Link -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
16 changes: 2 additions & 14 deletions src/ImmediateReflection/Cache/AttributesCache.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#if SUPPORTS_SYSTEM_CORE
using System.Linq;
#else
using static ImmediateReflection.Utils.EnumerableUtils;
#endif
using System.Reflection;
#if SUPPORTS_AGGRESSIVE_INLINING
using System.Runtime.CompilerServices;
Expand All @@ -17,7 +13,7 @@ namespace ImmediateReflection
/// <summary>
/// Cache storage for attributes.
/// </summary>
internal class AttributesCache
internal sealed class AttributesCache
{
[NotNull, ItemNotNull]
private readonly Attribute[] _attributesWithInherited;
Expand Down Expand Up @@ -155,11 +151,7 @@ public IEnumerable<TAttribute> GetAttributes<TAttribute>(bool inherit)

IEnumerable<TAttribute> FindAttributes(Attribute[] attributes)
{
#if SUPPORTS_SYSTEM_CORE
return attributes.OfType<TAttribute>();
#else
return OfType<TAttribute>(attributes);
#endif
}

#endregion
Expand Down Expand Up @@ -189,11 +181,7 @@ public IEnumerable<Attribute> GetAttributes([NotNull] Type attributeType, bool i

IEnumerable<Attribute> FindAttributes(Attribute[] attributes)
{
#if SUPPORTS_SYSTEM_CORE
return attributes.Where(attributeType.IsInstanceOfType);
#else
return Where(attributes, attributeType.IsInstanceOfType);
#endif
}

#endregion
Expand Down
6 changes: 2 additions & 4 deletions src/ImmediateReflection/Cache/CachesHandler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if SUPPORTS_CACHING
using System;
using System;
using System.Diagnostics;
using System.Reflection;
using JetBrains.Annotations;
Expand Down Expand Up @@ -180,5 +179,4 @@ public ImmediateProperty GetProperty([NotNull] PropertyInfo property)

#endregion
}
}
#endif
}
8 changes: 3 additions & 5 deletions src/ImmediateReflection/Cache/ConstructorData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if SUPPORTS_CACHING
using System.Diagnostics;
using System.Diagnostics;
using JetBrains.Annotations;

namespace ImmediateReflection
Expand All @@ -8,7 +7,7 @@ namespace ImmediateReflection
/// Data stored in a constructor cache.
/// </summary>
/// <typeparam name="TConstructorDelegate">Constructor delegate type.</typeparam>
internal class ConstructorData<TConstructorDelegate>
internal sealed class ConstructorData<TConstructorDelegate>
{
/// <summary>
/// Indicates if there is a constructor.
Expand All @@ -29,5 +28,4 @@ public ConstructorData([NotNull] TConstructorDelegate constructor, bool hasConst
Constructor = constructor;
}
}
}
#endif
}
12 changes: 3 additions & 9 deletions src/ImmediateReflection/Cache/MemoryCache.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#if SUPPORTS_CACHING
#if SUPPORTS_SYSTEM_CORE
using System;
#else
using ImmediateReflection.Utils;
#endif
using System;
using System.Collections;
using System.Diagnostics;
using JetBrains.Annotations;
Expand All @@ -15,7 +10,7 @@ namespace ImmediateReflection
/// </summary>
/// <typeparam name="TKey">Cache key type.</typeparam>
/// <typeparam name="TValue">Cache value type.</typeparam>
internal class MemoryCache<TKey, TValue>
internal sealed class MemoryCache<TKey, TValue>
where TValue : class
{
[NotNull]
Expand Down Expand Up @@ -53,5 +48,4 @@ public TValue GetOrCreate([NotNull] TKey key, [NotNull, InstantHandle] Func<TVal
}
}
}
}
#endif
}
14 changes: 0 additions & 14 deletions src/ImmediateReflection/Compatibility/Delegates.cs

This file was deleted.

Loading

0 comments on commit 206f8b9

Please sign in to comment.