Skip to content

Commit

Permalink
0.10.0 beta1 added support for .net core
Browse files Browse the repository at this point in the history
  • Loading branch information
force-net committed Jul 31, 2017
1 parent 3280b0c commit 1622ef0
Show file tree
Hide file tree
Showing 19 changed files with 11,510 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ ipch
Win32
*.sdf
*.opensdf

.idea
23 changes: 23 additions & 0 deletions Blazer.Core.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Blazer.Net", "Blazer.Net\Blazer.Net.xproj", "{1697F214-4621-4366-8313-CF729755BBDF}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Blazer.Net.Tests", "Blazer.Net.Tests\Blazer.Net.Tests.xproj", "{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1697F214-4621-4366-8313-CF729755BBDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1697F214-4621-4366-8313-CF729755BBDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1697F214-4621-4366-8313-CF729755BBDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1697F214-4621-4366-8313-CF729755BBDF}.Release|Any CPU.Build.0 = Release|Any CPU
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions Blazer.Exe/FileNameHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ private static string[] ExpandFilesInList(string[] initialFiles, out bool hasMis
if (asteriskIdx < 0) hasMissingFiles = true;
else
{
var slashIdx = s.LastIndexOfAny(
new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, asteriskIdx - 1, asteriskIdx - 1);
var dirToSearch = string.Empty;
var slashIdx = asteriskIdx > 0 ? s.LastIndexOfAny(
new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, asteriskIdx - 1, asteriskIdx - 1) : -1;
var dirToSearch = ".";
if (slashIdx >= 0) dirToSearch = s.Substring(0, slashIdx);
l.AddRange(Directory.GetFiles(dirToSearch, s.Remove(0, slashIdx + 1), SearchOption.AllDirectories));
}
Expand Down
9 changes: 7 additions & 2 deletions Blazer.Net.Tests/Blazer.Net.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Crc32.NET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dc0b95cf99bf4e99, processorArchitecture=MSIL">
<HintPath>..\packages\Crc32.NET.1.1.0\lib\net20\Crc32.NET.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Crc32C.NET">
<HintPath>..\packages\Crc32C.NET.1.0.5.0\lib\net20\Crc32C.NET.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.4.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.4.0\lib\net40\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
21 changes: 21 additions & 0 deletions Blazer.Net.Tests/Blazer.Net.Tests.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>{C4BF2879-8EF2-49E5-B168-4C45BA895EEE}</ProjectGuid>
<RootNamespace>Blazer.Net.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
3 changes: 1 addition & 2 deletions Blazer.Net.Tests/Crc32Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
using System.Linq;
using System.Text;

using Crc32C;

using Force.Crc32;
using NUnit.Framework;

using E = Force.Blazer.Algorithms.Crc32C.Crc32C;
Expand Down
8 changes: 8 additions & 0 deletions Blazer.Net.Tests/StreamEncoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ namespace Blazer.Net.Tests
[TestFixture]
public class StreamEncoderTests
{
[OneTimeSetUp]
public void OneTimeSetUp()
{
#if NETCORE
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
#endif
}

[Test]
public void Test_AAAAAAAA()
{
Expand Down
31 changes: 31 additions & 0 deletions Blazer.Net.Tests/TcpClientExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using System.Net;
using System.Net.Sockets;

namespace Blazer.Net.Tests
{
public static class TcpClientExtensions
{
#if NETCORE
public static TcpClient AcceptTcpClient(this TcpListener listener)
{
return listener.AcceptTcpClientAsync().Result;
}

public static void Connect(this TcpClient client, IPEndPoint endpoint)
{
client.ConnectAsync(endpoint.Address, endpoint.Port).Wait();
}

public static void Close(this TcpClient client)
{
client.Dispose();
}

public static void Close(this Stream stream)
{
stream.Dispose();
}
#endif
}
}
3 changes: 2 additions & 1 deletion Blazer.Net.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Crc32.NET" version="1.1.0" targetFramework="net40" />
<package id="Crc32C.NET" version="1.0.5.0" targetFramework="net40" />
<package id="NUnit" version="2.6.4" targetFramework="net40" />
<package id="NUnit" version="3.4.0" targetFramework="net40" />
</packages>
36 changes: 36 additions & 0 deletions Blazer.Net.Tests/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"allowUnsafe": true
},
"dependencies": {
"Blazer.Net": "0.10.0-*",
"Crc32.NET": "1.1.0",
"NUnit": "3.6.0"
},

"testRunner": "nunit",

"frameworks": {
"net461": {
"dependencies": {
}
},
"netcoreapp1.0": {
"imports": "portable-net45+win8",
"buildOptions": {
"define": ["NETCORE"]
},
"dependencies": {
"System.Text.Encoding.CodePages": "4.3.0",
"NETStandard.Library": "1.6.1",
"dotnet-test-nunit": "3.4.0-beta-3",
"Microsoft.NETCore.App": {
"version": "1.1.0-*",
"type": "platform"
}
}
}
}
}
Loading

0 comments on commit 1622ef0

Please sign in to comment.