Skip to content

Commit

Permalink
Use .net standard, set up versioning and nuget variables
Browse files Browse the repository at this point in the history
  • Loading branch information
barrett777 committed Jan 5, 2020
1 parent e48792d commit a7c360b
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 440 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Heroes.ReplayParser\Heroes.ReplayParser.netstandard.csproj" />
<ProjectReference Include="..\Heroes.ReplayParser\Heroes.ReplayParser.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApplication1.netcore", "ConsoleApplication1.netcore.csproj", "{861DB181-6C12-48CB-AA2A-19B374ECA319}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApplication", "ConsoleApplication.csproj", "{861DB181-6C12-48CB-AA2A-19B374ECA319}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Heroes.ReplayParser.netstandard", "..\..\Heroes.ReplayParser\Heroes.ReplayParser.netstandard.csproj", "{AAF78D53-A1DA-424A-B1AA-09895EAB3B2B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Heroes.ReplayParser", "..\Heroes.ReplayParser\Heroes.ReplayParser.csproj", "{AAF78D53-A1DA-424A-B1AA-09895EAB3B2B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MpqTool.netstandard", "..\..\MpqTool\MpqTool.netstandard.csproj", "{FA50E172-836B-47BB-8745-60595E4FB12A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MpqTool", "..\MpqTool\MpqTool.csproj", "{FA50E172-836B-47BB-8745-60595E4FB12A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions Heroes.ReplayParser.ConsoleApplication/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
38 changes: 38 additions & 0 deletions Heroes.ReplayParser.ConsoleApplication/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using Heroes.ReplayParser;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var heroesAccountsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"Heroes of the Storm\Accounts");
var randomReplayFileName = Directory.GetFiles(heroesAccountsFolder, "*.StormReplay", SearchOption.AllDirectories).OrderBy(i => Guid.NewGuid()).First();

// Attempt to parse the replay
// Ignore errors can be set to true if you want to attempt to parse currently unsupported replays, such as 'VS AI' or 'PTR Region' replays
var replayParseResult = DataParser.ParseReplay(randomReplayFileName, ignoreErrors: false, deleteFile: false);

// If successful, the Replay object now has all currently available information
if (replayParseResult.Item1 == DataParser.ReplayParseResult.Success)
{
var replay = replayParseResult.Item2;

Console.WriteLine("Replay Build: " + replay.ReplayBuild);
Console.WriteLine("Map: " + replay.Map);
foreach (var player in replay.Players.OrderByDescending(i => i.IsWinner))
Console.WriteLine("Player: " + player.Name + ", Win: " + player.IsWinner + ", Hero: " + player.Character + ", Lvl: " + player.CharacterLevel + ", Talents: " + string.Join(",", player.Talents.Select(i => i.TalentID + ":" + i.TalentName)));

Console.WriteLine("Press Any Key to Close");
}
else
Console.WriteLine("Failed to Parse Replay: " + replayParseResult.Item1);

Console.Read();
}
}
}
125 changes: 22 additions & 103 deletions Heroes.ReplayParser/Heroes.ReplayParser.csproj
Original file line number Diff line number Diff line change
@@ -1,104 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AAF78D53-A1DA-424A-B1AA-09895EAB3B2B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Heroes.ReplayParser</RootNamespace>
<AssemblyName>Heroes.ReplayParser</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataParser.cs" />
<Compile Include="Message.cs" />
<Compile Include="MPQFiles\ReplayResumableEvents.cs" />
<Compile Include="Statistics.cs" />
<Compile Include="Unit.cs" />
<Compile Include="MPQFiles\MpqHeader.cs" />
<Compile Include="Player.cs" />
<Compile Include="Replay.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MPQFiles\ReplayAttributeEvents.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="MPQFiles\ReplayDetails.cs" />
<Compile Include="MPQFiles\ReplayGameEvents.cs" />
<Compile Include="MPQFiles\ReplayInitData.cs" />
<Compile Include="MPQFiles\ReplayMessageEvents.cs" />
<Compile Include="MPQFiles\ReplayServerBattlelobby.cs" />
<Compile Include="MPQFiles\ReplayTrackerEvents.cs" />
<Compile Include="BitReader.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MpqTool\MpqTool.csproj">
<Project>{fa50e172-836b-47bb-8745-60595e4fb12a}</Project>
<Name>MpqTool</Name>
</ProjectReference>
</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 Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Heroes.ReplayParser</PackageId>
<Authors>Ben Barrett</Authors>
<Company>barrett777</Company>
<Description>A library for parsing Heroes of the Storm replay files (.StormReplay)</Description>
<RepositoryUrl>https://github.com/barrett777/Heroes.ReplayParser</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GitVersionTask" Version="5.1.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MpqTool\MpqTool.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit a7c360b

Please sign in to comment.