Skip to content

Commit 0e23ff6

Browse files
committed
Migrate to .NET Standard/Core
1 parent bf1ce6a commit 0e23ff6

File tree

18 files changed

+148
-841
lines changed

18 files changed

+148
-841
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,30 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: windows-latest
11+
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
1414

15-
- name: Setup MSBuild
16-
uses: microsoft/[email protected]
17-
18-
- name: Setup VSTest
19-
uses: darenm/Setup-VSTest@v1
20-
21-
- name: Setup NuGet
22-
uses: NuGet/[email protected]
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 3.1.101
2319

24-
- name: Restore packages
25-
run: nuget restore ./HearthDb.sln
20+
- name: Install dependencies
21+
run: dotnet restore
2622

2723
- name: Build
28-
run: msbuild ./HearthDb.sln /p:Configuration=Release
24+
run: dotnet build --configuration Release --no-restore
2925

30-
- name: Run Tests
31-
run: vstest.console "./HearthDb.Tests/bin/Release/HearthDb.Tests.dll"
26+
- name: Test
27+
run: dotnet test --no-restore --verbosity normal
3228

3329
- name: Upload artifact
3430
if: github.event_name == 'push'
3531
uses: actions/[email protected]
3632
with:
3733
name: HearthDb.dll
38-
path: "./HearthDb/bin/Release/HearthDb.dll"
34+
path: "./HearthDb/bin/Release/netstandard2.0/HearthDb.dll"
3935

4036
deploy:
4137
needs: build

HearthDb.CardIdGenerator/App.config

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 23 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,31 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{89D6853A-FAEF-4E66-B5C5-95FFE71E9C8C}</ProjectGuid>
83
<OutputType>Exe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>HearthDb.CardIdGenerator</RootNamespace>
11-
<AssemblyName>HearthDb.CardIdGenerator</AssemblyName>
12-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15-
<TargetFrameworkProfile />
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<Copyright>Copyright © HearthSim</Copyright>
166
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<PlatformTarget>AnyCPU</PlatformTarget>
19-
<DebugSymbols>true</DebugSymbols>
20-
<DebugType>full</DebugType>
21-
<Optimize>false</Optimize>
22-
<OutputPath>bin\Debug\</OutputPath>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<PlatformTarget>AnyCPU</PlatformTarget>
29-
<DebugType>pdbonly</DebugType>
30-
<Optimize>true</Optimize>
31-
<OutputPath>bin\Release\</OutputPath>
32-
<DefineConstants>TRACE</DefineConstants>
33-
<ErrorReport>prompt</ErrorReport>
34-
<WarningLevel>4</WarningLevel>
35-
</PropertyGroup>
36-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
37-
<DebugSymbols>true</DebugSymbols>
38-
<OutputPath>bin\x86\Debug\</OutputPath>
39-
<DefineConstants>DEBUG;TRACE</DefineConstants>
40-
<DebugType>full</DebugType>
41-
<PlatformTarget>x86</PlatformTarget>
42-
<ErrorReport>prompt</ErrorReport>
43-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
44-
<Prefer32Bit>true</Prefer32Bit>
45-
</PropertyGroup>
46-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
47-
<OutputPath>bin\x86\Release\</OutputPath>
48-
<DefineConstants>TRACE</DefineConstants>
49-
<Optimize>true</Optimize>
50-
<DebugType>pdbonly</DebugType>
51-
<PlatformTarget>x86</PlatformTarget>
52-
<ErrorReport>prompt</ErrorReport>
53-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
54-
<Prefer32Bit>true</Prefer32Bit>
55-
</PropertyGroup>
56-
<ItemGroup>
57-
<Reference Include="Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
58-
<HintPath>..\packages\Microsoft.Build.15.6.85\lib\net46\Microsoft.Build.dll</HintPath>
59-
<Private>True</Private>
60-
</Reference>
61-
<Reference Include="Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
62-
<HintPath>..\packages\Microsoft.Build.Framework.15.6.85\lib\net46\Microsoft.Build.Framework.dll</HintPath>
63-
<Private>True</Private>
64-
</Reference>
65-
<Reference Include="Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
66-
<HintPath>..\packages\Microsoft.Build.Tasks.Core.15.6.85\lib\net46\Microsoft.Build.Tasks.Core.dll</HintPath>
67-
<Private>True</Private>
68-
</Reference>
69-
<Reference Include="Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
70-
<HintPath>..\packages\Microsoft.Build.Utilities.Core.15.6.85\lib\net46\Microsoft.Build.Utilities.Core.dll</HintPath>
71-
<Private>True</Private>
72-
</Reference>
73-
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
74-
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
75-
</Reference>
76-
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
77-
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
78-
</Reference>
79-
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80-
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
81-
</Reference>
82-
<Reference Include="Microsoft.CodeAnalysis.VisualBasic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
83-
<HintPath>..\packages\Microsoft.CodeAnalysis.VisualBasic.1.0.0\lib\net45\Microsoft.CodeAnalysis.VisualBasic.dll</HintPath>
84-
</Reference>
85-
<Reference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
86-
<HintPath>..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.1.0.0\lib\net45\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll</HintPath>
87-
</Reference>
88-
<Reference Include="Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
89-
<HintPath>..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
90-
</Reference>
91-
<Reference Include="Microsoft.CodeAnalysis.Workspaces.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
92-
<HintPath>..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll</HintPath>
93-
</Reference>
94-
<Reference Include="System" />
95-
<Reference Include="System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
96-
<HintPath>..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
97-
</Reference>
98-
<Reference Include="System.ComponentModel.Composition" />
99-
<Reference Include="System.Composition.AttributedModel, Version=1.0.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
100-
<HintPath>..\packages\System.Composition.AttributedModel.1.1.0\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
101-
</Reference>
102-
<Reference Include="System.Composition.Convention, Version=1.0.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
103-
<HintPath>..\packages\System.Composition.Convention.1.1.0\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath>
104-
</Reference>
105-
<Reference Include="System.Composition.Hosting, Version=1.0.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
106-
<HintPath>..\packages\System.Composition.Hosting.1.1.0\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath>
107-
</Reference>
108-
<Reference Include="System.Composition.Runtime, Version=1.0.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
109-
<HintPath>..\packages\System.Composition.Runtime.1.1.0\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath>
110-
</Reference>
111-
<Reference Include="System.Composition.TypedParts, Version=1.0.32.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
112-
<HintPath>..\packages\System.Composition.TypedParts.1.1.0\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
113-
</Reference>
114-
<Reference Include="System.Core" />
115-
<Reference Include="System.Diagnostics.Process, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
116-
<HintPath>..\packages\System.Diagnostics.Process.4.1.0\lib\net46\System.Diagnostics.Process.dll</HintPath>
117-
<Private>True</Private>
118-
</Reference>
119-
<Reference Include="System.Reflection.Metadata, Version=1.4.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
120-
<HintPath>..\packages\System.Reflection.Metadata.1.5.0\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
121-
</Reference>
122-
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
123-
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
124-
<Private>True</Private>
125-
</Reference>
126-
<Reference Include="System.Threading.Thread, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
127-
<HintPath>..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll</HintPath>
128-
</Reference>
129-
<Reference Include="System.Xml.Linq" />
130-
<Reference Include="System.Data.DataSetExtensions" />
131-
<Reference Include="Microsoft.CSharp" />
132-
<Reference Include="System.Data" />
133-
<Reference Include="System.Net.Http" />
134-
<Reference Include="System.Xml" />
135-
</ItemGroup>
136-
<ItemGroup>
137-
<Compile Include="CardSet.cs" />
138-
<Compile Include="Helper.cs" />
139-
<Compile Include="Program.cs" />
140-
<Compile Include="Properties\AssemblyInfo.cs" />
141-
<Compile Include="SyntaxBuilder.cs" />
142-
</ItemGroup>
143-
<ItemGroup>
144-
<None Include="App.config" />
145-
<None Include="packages.config" />
146-
</ItemGroup>
7+
1478
<ItemGroup>
148-
<ProjectReference Include="..\HearthDb\HearthDb.csproj">
149-
<Project>{7ed14243-e02b-4b94-af00-a67a62c282f0}</Project>
150-
<Name>HearthDb</Name>
151-
</ProjectReference>
9+
<ProjectReference Include="..\HearthDb\HearthDb.csproj" />
15210
</ItemGroup>
11+
15312
<ItemGroup>
154-
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
155-
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
13+
<PackageReference Include="Microsoft.Build" Version="16.5.0" />
14+
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.5.0" />
15+
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.5.0" />
16+
<PackageReference Include="Microsoft.Composition" Version="1.0.31" />
17+
<PackageReference Include="System.Collections" Version="4.3.0" />
18+
<PackageReference Include="System.Composition" Version="1.4.0" />
19+
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
20+
<PackageReference Include="System.Globalization" Version="4.3.0" />
21+
<PackageReference Include="System.Linq" Version="4.3.0" />
22+
<PackageReference Include="System.Reflection.Metadata" Version="1.8.0" />
23+
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
24+
<PackageReference Include="System.Runtime" Version="4.3.1" />
25+
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
26+
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
27+
<PackageReference Include="System.Threading" Version="4.3.0" />
28+
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
29+
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
15630
</ItemGroup>
157-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
158-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
159-
Other similar extension points exist, see Microsoft.Common.targets.
160-
<Target Name="BeforeBuild">
161-
</Target>
162-
<Target Name="AfterBuild">
163-
</Target>
164-
-->
16531
</Project>

HearthDb.CardIdGenerator/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.IO;
55
using Microsoft.CodeAnalysis;
66
using Microsoft.CodeAnalysis.Formatting;
7-
using Microsoft.CodeAnalysis.MSBuild;
87
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
98
using static Microsoft.CodeAnalysis.CSharp.SyntaxKind;
109

@@ -14,7 +13,7 @@ namespace HearthDb.CardIdGenerator
1413
{
1514
internal class Program
1615
{
17-
private const string File = "../../../HearthDb/CardIds.cs";
16+
private const string File = "../../../../HearthDb/CardIds.cs";
1817

1918
static void Main()
2019
{
@@ -34,7 +33,7 @@ static void Main()
3433
@namespace = @namespace.AddMembers(cCardIds);
3534

3635
Console.WriteLine("Formatting namespace. This may take a while...");
37-
var root = Formatter.Format(@namespace, MSBuildWorkspace.Create());
36+
var root = Formatter.Format(@namespace, new AdhocWorkspace());
3837

3938
var rootString = root.ToString();
4039
string prevString;

HearthDb.CardIdGenerator/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,10 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
8-
[assembly: AssemblyTitle("HearthDb.CardIdGenerator")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("HearthDb.CardIdGenerator")]
13-
[assembly: AssemblyCopyright("Copyright © 2015")]
14-
[assembly: AssemblyTrademark("")]
15-
[assembly: AssemblyCulture("")]
16-
175
// Setting ComVisible to false makes the types in this assembly not visible
186
// to COM components. If you need to access a type in this assembly from
197
// COM, set the ComVisible attribute to true on that type.
208
[assembly: ComVisible(false)]
219

2210
// The following GUID is for the ID of the typelib if this project is exposed to COM
2311
[assembly: Guid("89d6853a-faef-4e66-b5c5-95ffe71e9c8c")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)