Update to Unicode 10.0.
Migrate to new MSBuild project format. Migrate main lib to .NET Standard 1.1. Fix a bug in parsing UCD files.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -53,7 +53,7 @@ namespace System.Unicode.Builder
|
||||
|
||||
internal static IDataSource GetDataSource(string archiveName, string directoryName, string[] requiredFiles, bool? shouldDownload, bool? shouldSaveArchive, bool? shouldExtract)
|
||||
{
|
||||
string baseDirectory = Environment.CurrentDirectory;
|
||||
string baseDirectory = Directory.GetCurrentDirectory();
|
||||
string dataDirectory = Path.Combine(baseDirectory, UcdDirectoryName);
|
||||
string dataArchiveFileName = Path.Combine(baseDirectory, archiveName);
|
||||
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle("UnicodeInformation.Builder")]
|
||||
[assembly: AssemblyDescription("Data file builder for the .NET Unicode Information Library.")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
[assembly: InternalsVisibleTo("UnicodeInformation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100711da5e71bb2208797ed36597e628c6bf6541b6c157ede943539d19de5104763bd2f42d8c0233ea8fbe7e782d4e2d29c3706a8e8dc1cfa78faabec946a167f7b2b1d396d17a85839ad96f2be930c0efaa893c8b9b6a665bf50ca569b56b9eabf3a69e8274723f85e9d4c3eea1e53dcbbb29a74c78c305e447917daaa6593f1c2")]
|
||||
@@ -72,7 +72,7 @@ namespace System.Unicode.Builder
|
||||
{
|
||||
if (byteBuffer[index++] == '\n')
|
||||
{
|
||||
if (index < length && !IsNewLineOrComment(byteBuffer[index]))
|
||||
if ((index < length || RefillBuffer()) && !IsNewLineOrComment(byteBuffer[index]))
|
||||
{
|
||||
hasField = true;
|
||||
goto Completed;
|
||||
|
||||
@@ -128,8 +128,7 @@ namespace System.Unicode.Builder
|
||||
CanonicalCombiningClass = (CanonicalCombiningClass)byte.Parse(reader.ReadField()),
|
||||
};
|
||||
|
||||
BidirectionalClass bidirectionalClass;
|
||||
if (EnumHelper<BidirectionalClass>.TryGetNamedValue(reader.ReadField(), out bidirectionalClass))
|
||||
if (EnumHelper<BidirectionalClass>.TryGetNamedValue(reader.ReadField(), out var bidirectionalClass))
|
||||
{
|
||||
characterData.BidirectionalClass = bidirectionalClass;
|
||||
}
|
||||
@@ -196,10 +195,8 @@ namespace System.Unicode.Builder
|
||||
{
|
||||
while (reader.MoveToNextLine())
|
||||
{
|
||||
ContributoryProperties property;
|
||||
|
||||
var range = UnicodeCodePointRange.Parse(reader.ReadTrimmedField());
|
||||
if (EnumHelper<ContributoryProperties>.TryGetNamedValue(reader.ReadTrimmedField(), out property))
|
||||
if (EnumHelper<ContributoryProperties>.TryGetNamedValue(reader.ReadTrimmedField(), out var property))
|
||||
{
|
||||
builder.SetProperties(property, range);
|
||||
}
|
||||
@@ -213,10 +210,8 @@ namespace System.Unicode.Builder
|
||||
{
|
||||
while (reader.MoveToNextLine())
|
||||
{
|
||||
CoreProperties property;
|
||||
|
||||
var range = UnicodeCodePointRange.Parse(reader.ReadTrimmedField());
|
||||
if (EnumHelper<CoreProperties>.TryGetNamedValue(reader.ReadTrimmedField(), out property))
|
||||
if (EnumHelper<CoreProperties>.TryGetNamedValue(reader.ReadTrimmedField(), out var property))
|
||||
{
|
||||
builder.SetProperties(property, range);
|
||||
}
|
||||
@@ -281,9 +276,8 @@ namespace System.Unicode.Builder
|
||||
|
||||
string name = reader.ReadField();
|
||||
string kindName = reader.ReadField();
|
||||
UnicodeNameAliasKind kind;
|
||||
|
||||
if (!EnumHelper<UnicodeNameAliasKind>.TryGetNamedValue(kindName, out kind))
|
||||
if (!EnumHelper<UnicodeNameAliasKind>.TryGetNamedValue(kindName, out var kind))
|
||||
throw new InvalidDataException("Unrecognized name alias: " + kindName + ".3");
|
||||
|
||||
ucd.NameAliases.Add(new UnicodeNameAlias(name, kind));
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace System.Unicode.Builder
|
||||
|| ucdEntries[firstIndex].CodePointRange.FirstCodePoint < codePointRange.FirstCodePoint
|
||||
|| ucdEntries[lastIndex].CodePointRange.LastCodePoint > codePointRange.LastCodePoint)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
throw new InvalidOperationException("Unable to find code point for setting contributory property.");
|
||||
}
|
||||
|
||||
int i = firstIndex;
|
||||
|
||||
@@ -1,94 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.Net.Sdk">
|
||||
<Import Project="../Common.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8DFDEE6C-4F0D-4DE1-B346-574CB56D2B8B}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>System.Unicode.Builder</RootNamespace>
|
||||
<AssemblyName>UnicodeInformation.Builder</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</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>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</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>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>..\System.Unicode.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyTitle>UnicodeInformation.Builder</AssemblyTitle>
|
||||
<Description>Data file builder for the .NET Unicode Information Library.</Description>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\AssemblyInfo.Common.cs">
|
||||
<Link>Properties\AssemblyInfo.Common.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="BinaryWriterExtensions.cs" />
|
||||
<Compile Include="CharExtensions.cs" />
|
||||
<Compile Include="UnihanProperty.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>UnihanProperty.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HexCodePoint.cs" />
|
||||
<Compile Include="UnihanCharacterDataBuilder.cs" />
|
||||
<Compile Include="UnihanDataFileReader.cs" />
|
||||
<Compile Include="Utf8Buffer.cs" />
|
||||
<Compile Include="CharacterDecompositionMapping.cs" />
|
||||
<Compile Include="FileDataSource.cs" />
|
||||
<Compile Include="HttpDataSource.cs" />
|
||||
<Compile Include="IDataSource.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnicodeCharacterDataBuilder.cs" />
|
||||
<Compile Include="UnicodeInfoBuilder.cs" />
|
||||
<Compile Include="UnicodeDataFileReader.cs" />
|
||||
<Compile Include="UnicodeDataProcessor.cs" />
|
||||
<Compile Include="ZipDataSource.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\System.Unicode.snk">
|
||||
<Link>System.Unicode.snk</Link>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UnicodeInformation\UnicodeInformation.csproj">
|
||||
<Project>{cb722958-a1c4-4121-804b-7d5a671491b1}</Project>
|
||||
<Name>UnicodeInformation</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="UnihanProperty.tt">
|
||||
@@ -96,15 +20,10 @@
|
||||
<LastGenOutput>UnihanProperty.cs</LastGenOutput>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UnicodeInformation\UnicodeInformation.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
Binary file not shown.
Reference in New Issue
Block a user