Skip to content

Commit

Permalink
Merge pull request #245 from jamespfluger-ava/feat/dotnet-6-and-dotnet-8
Browse files Browse the repository at this point in the history
Add dotnet 6 and dotnet 8 targets
  • Loading branch information
svc-developer authored Aug 9, 2024
2 parents 1da45db + 638bd98 commit df11c95
Show file tree
Hide file tree
Showing 22 changed files with 2,597 additions and 97 deletions.
31 changes: 31 additions & 0 deletions Avalara.AvaTax.RestClient.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35004.147
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalara.AvaTax.RestClient", "src\Avalara.AvaTax.RestClient.csproj", "{F0EEC671-76CD-47C3-8671-FA178139B2A9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalara.AvaTax.RestClient.Tests", "tests\Avalara.AvaTax.RestClient.Tests.csproj", "{88267F39-00E4-4D70-8E76-EA601E43CCA0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0EEC671-76CD-47C3-8671-FA178139B2A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0EEC671-76CD-47C3-8671-FA178139B2A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0EEC671-76CD-47C3-8671-FA178139B2A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0EEC671-76CD-47C3-8671-FA178139B2A9}.Release|Any CPU.Build.0 = Release|Any CPU
{88267F39-00E4-4D70-8E76-EA601E43CCA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88267F39-00E4-4D70-8E76-EA601E43CCA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88267F39-00E4-4D70-8E76-EA601E43CCA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88267F39-00E4-4D70-8E76-EA601E43CCA0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EF80143E-E986-4C4B-9401-395AF44EF2FE}
EndGlobalSection
EndGlobal
3 changes: 2 additions & 1 deletion src/AvaTaxOfflineHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ private static void WriteZipRateFile(TaxRateModel zipRate, string zip, string pa
TextWriter writer = null;

try {
Directory.GetAccessControl(path);
DirectoryInfo directory = new DirectoryInfo(path);
directory.GetAccessControl();
var content = JsonConvert.SerializeObject(zipRate);
writer = new StreamWriter(Path.Combine(path, zip + ".json"));
writer.Write(content);
Expand Down
109 changes: 59 additions & 50 deletions src/Avalara.AvaTax.RestClient.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net20;net45;net461;net472;netstandard1.6;netstandard2.0</TargetFrameworks>
<DelaySign>false</DelaySign>
<TargetFrameworks>net20;net45;net461;net472;netstandard1.6;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Avalara.AvaTax.RestClient.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>


<!-- .NET Framework 2.0 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net20' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>NETFRAMEWORK;TRACE;DEBUG;NET20</DefineConstants>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
Expand All @@ -15,8 +17,9 @@
<DefineConstants>NETFRAMEWORK;TRACE;RELEASE;NET20</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>




<!-- .NET Framework 4.5 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net45' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>NETFRAMEWORK;TRACE;DEBUG;PORTABLE;NET45</DefineConstants>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
Expand All @@ -25,8 +28,9 @@
<DefineConstants>NETFRAMEWORK;TRACE;RELEASE;PORTABLE;NET45</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>



<!-- .NET Framework 4.6.1 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net461' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>NETFRAMEWORK;TRACE;DEBUG;PORTABLE;NET461</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -35,80 +39,85 @@
<DefineConstants>NETFRAMEWORK;TRACE;RELEASE;PORTABLE;NET461</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>



<!-- .NET Framework 4.7.2 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net472' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>NETFRAMEWORK;TRACE;DEBUG;PORTABLE;NET472</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net472' AND '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineConstants>NETFRAMEWORK;TRACE;RELEASE;PORTABLE;NET472</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>



<!-- .NET Standard 1.6 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.6' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;PORTABLE;NETSTANDARD1_6</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.6' AND '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineConstants>TRACE;RELEASE;PORTABLE;NETSTANDARD1_6</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>


<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- .NET Standard 2.0 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;PORTABLE;NETSTANDARD2_0</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' AND '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineConstants>TRACE;RELEASE;PORTABLE;NETSTANDARD2_0</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>


<!-- .NET 6.0 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;PORTABLE;NET6_0</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' AND '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineConstants>TRACE;RELEASE;PORTABLE;NET6_0</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>


<!-- .NET 8.0 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' AND '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;PORTABLE;NET8_0</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' AND '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineConstants>TRACE;RELEASE;PORTABLE;NET8_0</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>


<ItemGroup>
<None Remove="**" />
<Folder Include="enums" />
<Folder Include="models" />
<Folder Include="models" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net20'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<Reference Include="System.Net.Http" />
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<Reference Include="System.Net.Http" />
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
</ItemGroup>
<ItemGroup>

</ItemGroup>


<!-- .NET Framework 2.0 doesn't have a System.Net.Http package, so it can't be included-->
<Choose>
<When Condition="'$(TargetFramework)' == 'net20'">
<ItemGroup>
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>
</Otherwise>
</Choose>
</Project>
83 changes: 37 additions & 46 deletions tests/Avalara.AvaTax.RestClient.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,88 +1,79 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net451;net45;net461;net472;netcoreapp2.2;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net451;net45;net461;net472;netcoreapp2.2.8;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net451'">
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
</PropertyGroup>

<ItemGroup>
<Compile Remove="**\*.*" />
<None Remove="**" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net451'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<Reference Include="System.Net.Http" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>


<!-- .NET Framework 4.5.1 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net451'">
<Compile Include="net20\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=net20</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- .NET Framework 4.5 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<Reference Include="System.Net.Http" />
<Compile Include="net45\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=net45</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- .NET Framework 4.6.1 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<Reference Include="System.Net.Http" />
<Compile Include="net461\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=net461</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- .NET Framework 4.7.2 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<PackageReference Include="Nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<Compile Include="net472\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=net472</SetTargetFramework>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />

<!-- .NET Core 2.2.8 -->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2.8'">
<Compile Include="netstandard\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=netstandard1.6</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- .NET Core 3.1 -->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<Compile Include="netstandard20\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=netstandard2.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- .NET 6.0 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<Compile Include="net6.0\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=net6.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<!-- .NET 8.0 -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<Compile Include="net6.0\*.cs" />
<ProjectReference Include="..\src\Avalara.AvaTax.RestClient.csproj">
<SetTargetFramework>TargetFramework=net6.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>
</Project>
Loading

0 comments on commit df11c95

Please sign in to comment.