Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Update target frameworks to .NET Framework 4.0 and .NET Standard 1.3 (#7
Browse files Browse the repository at this point in the history
)

* Target EnumDisplayName project to .NET Standard 1.3 and .NET Framework 4.0

* Target EnumDisplayName.Test to .NET Core 2.0 and .NET Framework 4.5.2

* Address xunit exception type warnings

* Format .csproj files

* Add NuGet information

* Update appveyor configuration
  • Loading branch information
josh-yates authored Mar 22, 2019
1 parent c5dd1d2 commit 33f8ccd
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 237 deletions.
31 changes: 17 additions & 14 deletions Enable.EnumDisplayName.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,39 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B148408C-C36
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9178269F-0E3D-4CDF-93FC-4C80CFCFD6EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnumDisplayName", "src\EnumDisplayName\EnumDisplayName.csproj", "{E82E2F73-7CF5-4456-9D12-F6606B11365C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnumDisplayName.Test", "test\EnumDisplayName.Test\EnumDisplayName.Test.csproj", "{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A78E82A5-262D-4736-A4AF-CAEE12897981}"
ProjectSection(SolutionItems) = preProject
CodeMaid.config = CodeMaid.config
CustomExtendedCorrectnessRules.ruleset = CustomExtendedCorrectnessRules.ruleset
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnumDisplayName", "src\EnumDisplayName\EnumDisplayName.csproj", "{A586C4D7-7621-4A03-9EE9-0D98D25D91F6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnumDisplayName.Test", "test\EnumDisplayName.Test\EnumDisplayName.Test.csproj", "{D4B5A508-B123-4D71-841B-6A8A20C3CB56}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E82E2F73-7CF5-4456-9D12-F6606B11365C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E82E2F73-7CF5-4456-9D12-F6606B11365C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E82E2F73-7CF5-4456-9D12-F6606B11365C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E82E2F73-7CF5-4456-9D12-F6606B11365C}.Release|Any CPU.Build.0 = Release|Any CPU
{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1}.Release|Any CPU.Build.0 = Release|Any CPU
{A586C4D7-7621-4A03-9EE9-0D98D25D91F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A586C4D7-7621-4A03-9EE9-0D98D25D91F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A586C4D7-7621-4A03-9EE9-0D98D25D91F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A586C4D7-7621-4A03-9EE9-0D98D25D91F6}.Release|Any CPU.Build.0 = Release|Any CPU
{D4B5A508-B123-4D71-841B-6A8A20C3CB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4B5A508-B123-4D71-841B-6A8A20C3CB56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4B5A508-B123-4D71-841B-6A8A20C3CB56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4B5A508-B123-4D71-841B-6A8A20C3CB56}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E82E2F73-7CF5-4456-9D12-F6606B11365C} = {B148408C-C362-4B8C-8892-DB075E781CE1}
{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1} = {9178269F-0E3D-4CDF-93FC-4C80CFCFD6EE}
{A586C4D7-7621-4A03-9EE9-0D98D25D91F6} = {B148408C-C362-4B8C-8892-DB075E781CE1}
{D4B5A508-B123-4D71-841B-6A8A20C3CB56} = {9178269F-0E3D-4CDF-93FC-4C80CFCFD6EE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {34815F33-2BBC-44F6-BE22-7545E2DE857D}
EndGlobalSection
EndGlobal
25 changes: 18 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
version: 1.0.{build}
version: 2.0.{build}
configuration: Release
assembly_info:

image: Visual Studio 2017

environment:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

dotnet_csproj:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
file: '**\*.csproj'
version: '{version}'

before_build:
- cmd: nuget restore -verbosity quiet
- cmd: dotnet restore

build:
publish_nuget: true
parallel: true
verbosity: minimal

test:
assemblies: '**\*.Tests.dll'

deploy: off
80 changes: 30 additions & 50 deletions src/EnumDisplayName/EnumDisplayName.csproj
Original file line number Diff line number Diff line change
@@ -1,58 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E82E2F73-7CF5-4456-9D12-F6606B11365C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Enable.EnumDisplayName</RootNamespace>
<AssemblyName>Enable.EnumDisplayName</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<CodeAnalysisRuleSet>..\..\CustomExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<TargetFrameworks>netstandard1.3;net40</TargetFrameworks>
<CodeAnalysisRuleSet>../../CustomExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>latest</LangVersion>
</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>
<CodeAnalysisRuleSet>..\..\CustomExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>

<PropertyGroup>
<AssemblyName>Enable.EnumDisplayName</AssemblyName>
<Version></Version>
<Authors>Enable</Authors>
<Description>C# attribute and extensions for setting and retrieving enum display names.</Description>
<Copyright>Copyright © Enable</Copyright>
<PackageProjectUrl>https://github.com/EnableSoftware/Enable.EnumDisplayName</PackageProjectUrl>
<PackageIconUrl>https://github.com/EnableSoftware.png</PackageIconUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/EnableSoftware/Enable.EnumDisplayName/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/EnableSoftware/Enable.EnumDisplayName</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<Compile Include="EnumDisplayNameAttribute.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<PackageReference Include="Enable.Common.Argument" Version="2.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="EnumDisplayName.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.2\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.2\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="Enable.Common.Argument, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Enable.Common.Argument.1.0.0\lib\net40\Enable.Common.Argument.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

</Project>
19 changes: 0 additions & 19 deletions src/EnumDisplayName/EnumDisplayName.nuspec

This file was deleted.

4 changes: 4 additions & 0 deletions src/EnumDisplayName/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using System.ComponentModel.DataAnnotations;
using System.Linq;

#if NETSTANDARD1_3
using System.Reflection;
#endif

namespace Enable.EnumDisplayName
{
public static class EnumExtensions
Expand Down
11 changes: 0 additions & 11 deletions src/EnumDisplayName/Properties/AssemblyInfo.cs

This file was deleted.

5 changes: 0 additions & 5 deletions src/EnumDisplayName/packages.config

This file was deleted.

136 changes: 38 additions & 98 deletions test/EnumDisplayName.Test/EnumDisplayName.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,117 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0B7CBB4B-3A2F-4F4E-BB9D-DF224C0C8AA1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
<RootNamespace>Enable.EnumDisplayName</RootNamespace>
<AssemblyName>Enable.EnumDisplayName.Test</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\CustomExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
</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>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\CustomExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>../../CustomExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<Reference Include="Ploeh.AutoFixture, Version=3.50.0.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<HintPath>..\..\packages\AutoFixture.3.50.3\lib\net40\Ploeh.AutoFixture.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.2.0.3545, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
<PackageReference Include="AutoFixture" Version="4.8.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="xunit.core" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Compile Include="EnumDisplayNameAttributeGetDisplayNameTests.cs" />
<Compile Include="EnumDisplayNameAttributeTests.cs" />
<Compile Include="EnumExtensionsGetDisplayNameTests.cs" />
<Compile Include="Enums\MockEnum.cs" />
<Compile Include="Enums\MockEnumDisplayNames.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\InternalMockEnum.Designer.cs">
<AutoGen>True</AutoGen>
<ProjectReference Include="..\..\src\EnumDisplayName\EnumDisplayName.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources\InternalMockEnum.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>InternalMockEnum.resx</DependentUpon>
</Compile>
<Compile Include="Resources\MockEnum.Designer.cs">
<AutoGen>True</AutoGen>
<Compile Update="Resources\MockEnum.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>MockEnum.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.2\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.2\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\EnumDisplayName\EnumDisplayName.csproj">
<Project>{e82e2f73-7cf5-4456-9d12-f6606b11365c}</Project>
<Name>EnumDisplayName</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\InternalMockEnum.resx">
<Generator>ResXFileCodeGenerator</Generator>
<EmbeddedResource Update="Resources\InternalMockEnum.resx">
<LastGenOutput>InternalMockEnum.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
<CustomToolNamespace>Enable.EnumDisplayName.Resources</CustomToolNamespace>
</EmbeddedResource>
<EmbeddedResource Include="Resources\MockEnum.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<EmbeddedResource Update="Resources\MockEnum.resx">
<LastGenOutput>MockEnum.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
<CustomToolNamespace>Enable.EnumDisplayName.Resources</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
</Project>

</Project>
Loading

0 comments on commit 33f8ccd

Please sign in to comment.