Skip to content

Commit 1622ef0

Browse files
committed
0.10.0 beta1 added support for .net core
1 parent 3280b0c commit 1622ef0

19 files changed

+11510
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ ipch
1313
Win32
1414
*.sdf
1515
*.opensdf
16+
17+
.idea

Blazer.Core.sln

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Blazer.Net", "Blazer.Net\Blazer.Net.xproj", "{1697F214-4621-4366-8313-CF729755BBDF}"
5+
EndProject
6+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Blazer.Net.Tests", "Blazer.Net.Tests\Blazer.Net.Tests.xproj", "{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{1697F214-4621-4366-8313-CF729755BBDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{1697F214-4621-4366-8313-CF729755BBDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{1697F214-4621-4366-8313-CF729755BBDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{1697F214-4621-4366-8313-CF729755BBDF}.Release|Any CPU.Build.0 = Release|Any CPU
18+
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Release|Any CPU.Build.0 = Release|Any CPU
22+
EndGlobalSection
23+
EndGlobal

Blazer.Exe/FileNameHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ private static string[] ExpandFilesInList(string[] initialFiles, out bool hasMis
153153
if (asteriskIdx < 0) hasMissingFiles = true;
154154
else
155155
{
156-
var slashIdx = s.LastIndexOfAny(
157-
new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, asteriskIdx - 1, asteriskIdx - 1);
158-
var dirToSearch = string.Empty;
156+
var slashIdx = asteriskIdx > 0 ? s.LastIndexOfAny(
157+
new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, asteriskIdx - 1, asteriskIdx - 1) : -1;
158+
var dirToSearch = ".";
159159
if (slashIdx >= 0) dirToSearch = s.Substring(0, slashIdx);
160160
l.AddRange(Directory.GetFiles(dirToSearch, s.Remove(0, slashIdx + 1), SearchOption.AllDirectories));
161161
}

Blazer.Net.Tests/Blazer.Net.Tests.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35+
<Reference Include="Crc32.NET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dc0b95cf99bf4e99, processorArchitecture=MSIL">
36+
<HintPath>..\packages\Crc32.NET.1.1.0\lib\net20\Crc32.NET.dll</HintPath>
37+
<Private>True</Private>
38+
</Reference>
3539
<Reference Include="Crc32C.NET">
3640
<HintPath>..\packages\Crc32C.NET.1.0.5.0\lib\net20\Crc32C.NET.dll</HintPath>
3741
</Reference>
38-
<Reference Include="nunit.framework">
39-
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
42+
<Reference Include="nunit.framework, Version=3.4.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
43+
<HintPath>..\packages\NUnit.3.4.0\lib\net40\nunit.framework.dll</HintPath>
44+
<Private>True</Private>
4045
</Reference>
4146
<Reference Include="System" />
4247
<Reference Include="System.Core" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}</ProjectGuid>
11+
<RootNamespace>Blazer.Net.Tests</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>

Blazer.Net.Tests/Crc32Tests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
using System.Linq;
33
using System.Text;
44

5-
using Crc32C;
6-
5+
using Force.Crc32;
76
using NUnit.Framework;
87

98
using E = Force.Blazer.Algorithms.Crc32C.Crc32C;

Blazer.Net.Tests/StreamEncoderTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ namespace Blazer.Net.Tests
99
[TestFixture]
1010
public class StreamEncoderTests
1111
{
12+
[OneTimeSetUp]
13+
public void OneTimeSetUp()
14+
{
15+
#if NETCORE
16+
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
17+
#endif
18+
}
19+
1220
[Test]
1321
public void Test_AAAAAAAA()
1422
{
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.IO;
2+
using System.Net;
3+
using System.Net.Sockets;
4+
5+
namespace Blazer.Net.Tests
6+
{
7+
public static class TcpClientExtensions
8+
{
9+
#if NETCORE
10+
public static TcpClient AcceptTcpClient(this TcpListener listener)
11+
{
12+
return listener.AcceptTcpClientAsync().Result;
13+
}
14+
15+
public static void Connect(this TcpClient client, IPEndPoint endpoint)
16+
{
17+
client.ConnectAsync(endpoint.Address, endpoint.Port).Wait();
18+
}
19+
20+
public static void Close(this TcpClient client)
21+
{
22+
client.Dispose();
23+
}
24+
25+
public static void Close(this Stream stream)
26+
{
27+
stream.Dispose();
28+
}
29+
#endif
30+
}
31+
}

Blazer.Net.Tests/packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Crc32.NET" version="1.1.0" targetFramework="net40" />
34
<package id="Crc32C.NET" version="1.0.5.0" targetFramework="net40" />
4-
<package id="NUnit" version="2.6.4" targetFramework="net40" />
5+
<package id="NUnit" version="3.4.0" targetFramework="net40" />
56
</packages>

Blazer.Net.Tests/project.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "1.0.0-*",
3+
"buildOptions": {
4+
"debugType": "portable",
5+
"allowUnsafe": true
6+
},
7+
"dependencies": {
8+
"Blazer.Net": "0.10.0-*",
9+
"Crc32.NET": "1.1.0",
10+
"NUnit": "3.6.0"
11+
},
12+
13+
"testRunner": "nunit",
14+
15+
"frameworks": {
16+
"net461": {
17+
"dependencies": {
18+
}
19+
},
20+
"netcoreapp1.0": {
21+
"imports": "portable-net45+win8",
22+
"buildOptions": {
23+
"define": ["NETCORE"]
24+
},
25+
"dependencies": {
26+
"System.Text.Encoding.CodePages": "4.3.0",
27+
"NETStandard.Library": "1.6.1",
28+
"dotnet-test-nunit": "3.4.0-beta-3",
29+
"Microsoft.NETCore.App": {
30+
"version": "1.1.0-*",
31+
"type": "platform"
32+
}
33+
}
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)