Skip to content

Commit 206f8b9

Browse files
committed
Merge branch 'releases/2.0.0'
2 parents 2a7af90 + c52146e commit 206f8b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+214
-941
lines changed

ImmediateReflection.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27428.2043
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.2.32526.322
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ImmediateReflection.CommonInternals", "src\ImmediateReflection.CommonInternals\ImmediateReflection.CommonInternals.shproj", "{CE984360-54F0-406F-B8A9-E75897DAED3B}"
66
EndProject

README.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,10 @@ ImmediateType myImmediateType = myType.GetImmediateType();
297297

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

302302
Supports Source Link
303303

304-
---
305-
306-
## Dependencies
307-
308-
For targets higher than .NET Standard 2.0:
309-
- System.Reflection.Emit.LightWeight
310-
311304
### Notes
312305

313306
- It uses NUnit3 for unit testing (not published).

RELEASE_NOTES.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Release notes
22

3+
## What's new in 2.0.0 September 5 2022
4+
### Updates:
5+
* Update some serialization implementations for ImmediateReflection core types.
6+
* Dynamic methods generated by ImmediateReflection always use the ImmediateReflection module.
7+
8+
### Misc:
9+
* Get rid of targets anterior to .NET Framework 4.0.
10+
* Add target .NET Standard 2.1 to simplify dependency tree when used.
11+
* Assembly is CLS compliant (Common Language Specification).
12+
313
## What's new in 1.6.1 September 4 2022
414
### Fixes:
515
* Fix wrong generated IL code for copy constructor under .NET5+ target.
@@ -29,7 +39,7 @@
2939
### Fixes:
3040
* Properly handle null parameter for Copy and TryCopy (return null).
3141

32-
### Changes:
42+
### Updates:
3343
* Copy and TryCopy consider string and Type as copyable types and return themselves if asked.
3444

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

45-
### Changes:
55+
### Updates:
4656
* Globally optimize the library by reducing the number of redundant null checks.
4757
* Slightly optimize the branching in generated code.
4858

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

59-
### Changes:
69+
### Updates:
6070
* Default constructor delegates available via ImmediateType are now cached and shared across several instance of ImmediateType.
6171
* ImmediateProperty are now cached and shared across several instance of ImmediateType.
6272
* ImmediateField are now cached and shared across several instance of ImmediateType.
@@ -70,13 +80,13 @@
7080
### Fixes:
7181
* Classes with indexed properties does not crash anymore.
7282

73-
### Changes:
83+
### Updates:
7484
* Lazily initialize fields property of ImmediateType.
7585

7686
---
7787

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

95-
### Changes:
105+
### Updates:
96106
* Default flags taken into account when getting an ImmediateType are Public | Instance | Static
97107
* Get rid of cache system references replaced by a simpler internal caching system.
98108
* Extend caching support to target .NET Framework 4.0.

appveyor.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '0.0.{build}'
2-
image: Visual Studio 2019
2+
image: Visual Studio 2022
33

44
# Setup environment
55
nuget:
@@ -27,10 +27,10 @@ skip_commits:
2727
environment:
2828
SONARQUBE_TOKEN:
2929
secure: IDwa0NHtLUrg2jV3JZetUqUCGTgv3/UcZyYtMGvo7Pro1s9OmYTPjGMd6Vmx7Ktx
30-
DocFXVersion: 2.58
31-
NUnitConsoleVersion: 3.10.0
32-
OpenCoverVersion: 4.7.922
33-
CoverallsVersion: 1.0.0
30+
DocFXVersion: 2.59.2
31+
NUnitConsoleVersion: 3.15.2
32+
OpenCoverVersion: 4.7.1221
33+
CoverallsVersion: 4.0.1
3434
COVERALLS_REPO_TOKEN:
3535
secure: +DiJ+F7GIX0MMo/rtIRXO8GSdyYHa1CWKLw4H2Rx3AP27Shr6mZMC6l+muu2H/Dg
3636
GITHUB_ACCESS_TOKEN:
@@ -119,7 +119,7 @@ test_script:
119119
# Directory.Parent.Parent = tests\TestProject.Tests\bin
120120
# Directory.Parent.Parent.Parent = tests\TestProject.Tests
121121
122-
$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);
122+
$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);
123123
124124
$testsPassed = $false;
125125
if ($env:IsFullIntegrationBuild -eq $true)

benchmarks/ImmediateReflection.Benchmark/ImmediateReflection.Benchmark.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
32+
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
3333
<PackageReference Include="fasterflect" Version="3.0.0" />
3434
<PackageReference Include="FastMember.Signed" Version="1.5.0" />
3535
<PackageReference Include="FlashReflection" Version="1.0.2" />

docs/index.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@ You can find library sources on [GitHub](https://github.com/KeRNeLith/ImmediateR
2727

2828
- .NET Standard 2.0+
2929
- .NET Core 2.0+
30-
- .NET Framework 2.0+
30+
- .NET Framework 4.0+
3131

3232
Supports Source Link
3333

34-
## Dependencies
35-
36-
For targets higher than .NET Standard 2.0:
37-
- System.Reflection.Emit.LightWeight
38-
3934
## Installation
4035

4136
ImmediateReflection is available on [NuGet](https://www.nuget.org/packages/ImmediateReflection)

src/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424

2525
<!-- Source Link -->
2626
<ItemGroup>
27-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
27+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
2828
</ItemGroup>
2929
</Project>

src/ImmediateReflection/Cache/AttributesCache.cs

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
4-
#if SUPPORTS_SYSTEM_CORE
54
using System.Linq;
6-
#else
7-
using static ImmediateReflection.Utils.EnumerableUtils;
8-
#endif
95
using System.Reflection;
106
#if SUPPORTS_AGGRESSIVE_INLINING
117
using System.Runtime.CompilerServices;
@@ -17,7 +13,7 @@ namespace ImmediateReflection
1713
/// <summary>
1814
/// Cache storage for attributes.
1915
/// </summary>
20-
internal class AttributesCache
16+
internal sealed class AttributesCache
2117
{
2218
[NotNull, ItemNotNull]
2319
private readonly Attribute[] _attributesWithInherited;
@@ -155,11 +151,7 @@ public IEnumerable<TAttribute> GetAttributes<TAttribute>(bool inherit)
155151

156152
IEnumerable<TAttribute> FindAttributes(Attribute[] attributes)
157153
{
158-
#if SUPPORTS_SYSTEM_CORE
159154
return attributes.OfType<TAttribute>();
160-
#else
161-
return OfType<TAttribute>(attributes);
162-
#endif
163155
}
164156

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

190182
IEnumerable<Attribute> FindAttributes(Attribute[] attributes)
191183
{
192-
#if SUPPORTS_SYSTEM_CORE
193184
return attributes.Where(attributeType.IsInstanceOfType);
194-
#else
195-
return Where(attributes, attributeType.IsInstanceOfType);
196-
#endif
197185
}
198186

199187
#endregion

src/ImmediateReflection/Cache/CachesHandler.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if SUPPORTS_CACHING
2-
using System;
1+
using System;
32
using System.Diagnostics;
43
using System.Reflection;
54
using JetBrains.Annotations;
@@ -180,5 +179,4 @@ public ImmediateProperty GetProperty([NotNull] PropertyInfo property)
180179

181180
#endregion
182181
}
183-
}
184-
#endif
182+
}

src/ImmediateReflection/Cache/ConstructorData.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if SUPPORTS_CACHING
2-
using System.Diagnostics;
1+
using System.Diagnostics;
32
using JetBrains.Annotations;
43

54
namespace ImmediateReflection
@@ -8,7 +7,7 @@ namespace ImmediateReflection
87
/// Data stored in a constructor cache.
98
/// </summary>
109
/// <typeparam name="TConstructorDelegate">Constructor delegate type.</typeparam>
11-
internal class ConstructorData<TConstructorDelegate>
10+
internal sealed class ConstructorData<TConstructorDelegate>
1211
{
1312
/// <summary>
1413
/// Indicates if there is a constructor.
@@ -29,5 +28,4 @@ public ConstructorData([NotNull] TConstructorDelegate constructor, bool hasConst
2928
Constructor = constructor;
3029
}
3130
}
32-
}
33-
#endif
31+
}

src/ImmediateReflection/Cache/MemoryCache.cs

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
#if SUPPORTS_CACHING
2-
#if SUPPORTS_SYSTEM_CORE
3-
using System;
4-
#else
5-
using ImmediateReflection.Utils;
6-
#endif
1+
using System;
72
using System.Collections;
83
using System.Diagnostics;
94
using JetBrains.Annotations;
@@ -15,7 +10,7 @@ namespace ImmediateReflection
1510
/// </summary>
1611
/// <typeparam name="TKey">Cache key type.</typeparam>
1712
/// <typeparam name="TValue">Cache value type.</typeparam>
18-
internal class MemoryCache<TKey, TValue>
13+
internal sealed class MemoryCache<TKey, TValue>
1914
where TValue : class
2015
{
2116
[NotNull]
@@ -53,5 +48,4 @@ public TValue GetOrCreate([NotNull] TKey key, [NotNull, InstantHandle] Func<TVal
5348
}
5449
}
5550
}
56-
}
57-
#endif
51+
}

src/ImmediateReflection/Compatibility/Delegates.cs

-14
This file was deleted.

0 commit comments

Comments
 (0)