Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove netstandard1.6 replace with netstandard2.0 #202

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net40;net451;netstandard1.6;net8.0</TargetFrameworks>
<TargetFrameworks>net40;net451;netstandard2.0;net8.0</TargetFrameworks>
<PlatformAlias>netstandard</PlatformAlias>
<OutputPath>$(MSBuildThisFileDirectory)\..\output\$(Configuration)</OutputPath>
<PackageOutputPath>$(MSBuildThisFileDirectory)\..\output</PackageOutputPath>
Expand Down
2 changes: 1 addition & 1 deletion source/icu.net.tests/SetUpFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static bool IsWindows
{
// See Icu.Platform. Unfortunately that's internal, so we can't use it.

#if !NETSTANDARD1_6 && !NET
#if NETFRAMEWORK
// See http://www.mono-project.com/docs/faq/technical/#how-to-detect-the-execution-platform
switch ((int)Environment.OSVersion.Platform)
{
Expand Down
11 changes: 1 addition & 10 deletions source/icu.net/Collation/Collator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ namespace Icu.Collation
/// You use this class to build searching and sorting routines for natural
/// language text.
/// </summary>
public abstract class Collator : IComparer<string>, IDisposable
#if FEATURE_ICLONEABLE
, ICloneable
#endif
public abstract class Collator : IComparer<string>, IDisposable, ICloneable
{
/// <summary>
/// Gets or sets the minimum strength that will be used in comparison
Expand Down Expand Up @@ -194,18 +191,13 @@ static public SortKey CreateSortKey(string originalString, byte[] keyData, int k

var options = CompareOptions.None;

#if NETSTANDARD1_6
var sortKey = new SortKey(CultureInfo.InvariantCulture.Name, originalString, options, keyData);
#else
var sortKey = CultureInfo.InvariantCulture.CompareInfo.GetSortKey(string.Empty, options);
SetInternalOriginalStringField(sortKey, originalString);
SetInternalKeyDataField(sortKey, keyData, keyDataLength);
#endif

return sortKey;
}

#if !NETSTANDARD1_6
private static void SetInternalKeyDataField(SortKey sortKey, byte[] keyData, int keyDataLength)
{
var keyDataCopy = new byte[keyDataLength];
Expand Down Expand Up @@ -275,7 +267,6 @@ private static bool IsRunningOnMono()
{
return Type.GetType("Mono.Runtime") != null;
}
#endif

/// <summary>
/// Simple class to allow passing collation error info back to the caller of CheckRules.
Expand Down
7 changes: 1 addition & 6 deletions source/icu.net/Collation/RuleBasedCollator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
#if NETSTANDARD1_6
using Icu;
#else
using System.Globalization;
using System.Runtime.ConstrainedExecution;
#endif


namespace Icu.Collation
{
Expand All @@ -30,9 +27,7 @@
/// true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false.
/// In this case, it generates a ReleaseHandleFailed Managed Debugging Assistant.
///</returns>
#if !NETSTANDARD1_6 && !NET
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 30 in source/icu.net/Collation/RuleBasedCollator.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)
#endif
protected override bool ReleaseHandle()
{
try
Expand Down
5 changes: 1 addition & 4 deletions source/icu.net/Locale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ namespace Icu
/// <summary>
/// A Locale object represents a specific geographical, political, or cultural region.
/// </summary>
public class Locale
#if FEATURE_ICLONEABLE
: ICloneable
#endif
public class Locale : ICloneable
{
/// <summary>
/// Construct a default locale object, a Locale for the default locale ID
Expand Down
14 changes: 1 addition & 13 deletions source/icu.net/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,7 @@ internal static class Platform
public const string x64 = nameof(x64);
public const string x86 = nameof(x86);

public static string ProcessArchitecture
{
get {

#if NET || NETSTANDARD
// Workaround described here since the API does not exist:
// https://github.com/dotnet/corefx/issues/999#issuecomment-75907756
return IntPtr.Size == 4 ? x86 : x64;
#else
return Environment.Is64BitProcess ? x64 : x86;
#endif
}
}
public static string ProcessArchitecture => Environment.Is64BitProcess ? x64 : x86;

public static OperatingSystemType OperatingSystem
{
Expand Down
6 changes: 1 addition & 5 deletions source/icu.net/SafeEnumeratorHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Runtime.InteropServices;

#if !NETSTANDARD1_6
using System.Runtime.ConstrainedExecution;
#endif


namespace Icu
{
Expand All @@ -23,9 +21,7 @@
/// failure, false. In this case, it generates a ReleaseHandleFailed Managed Debugging
/// Assistant.
///</returns>
#if !NETSTANDARD1_6 && !NET
hahn-kev marked this conversation as resolved.
Show resolved Hide resolved
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (windows-latest)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-12)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'ReliabilityContractAttribute' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'Consistency' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)

Check warning on line 24 in source/icu.net/SafeEnumeratorHandle.cs

View workflow job for this annotation

GitHub Actions / Build and Test (macos-13)

'Cer' is obsolete: 'The Constrained Execution Region (CER) feature is not supported.' (https://aka.ms/dotnet-warnings/SYSLIB0004)
#endif
protected override bool ReleaseHandle()
{
NativeMethods.uenum_close(handle);
Expand Down
140 changes: 0 additions & 140 deletions source/icu.net/SortKey.cs

This file was deleted.

18 changes: 0 additions & 18 deletions source/icu.net/icu.net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,17 @@
<Description>icu.net is a C# Wrapper around ICU4C</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<!-- Full .NET Framework properties -->
<PropertyGroup Condition="'$(TargetFramework)' != 'netstandard1.6'">
<DefineConstants>$(DefineConstants);FEATURE_ICLONEABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.10.3" PrivateAssets="all" />
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
<!--System.ValueTuple v4.5 caused MSB3277 when consuming LibChorus in LibTriboroughBridge-ChorusPlugin -->
<!-- The reason is that .NET Standard comes with System.ValueTuple AssemblyVersion 4.0.2 -->
<!-- which corresponds to package version 4.4.0 -->
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.6'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net40'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.6'">
<Compile Remove="SortKey.cs" />
</ItemGroup>

<!-- ICU must be installed using MacPorts before this will work -->
<ItemGroup>
<Content Include="/opt/local/lib/*.dylib" Condition="$([MSBuild]::IsOSPlatform('OSX'))">
Expand Down
Loading