Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to .Net 8 #256

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./ApiDoctor.sln
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/ApiDoctor.Console/bin/Debug/net6.0/apidoc.dll",
"program": "${workspaceFolder}/ApiDoctor.Console/bin/Debug/net8.0/apidoc.dll",
"args": [
"generate-snippets",
"--ignore-warnings",
"--path",
"/home/codespace/workspace/microsoft-graph-docs",
"--snippet-generator-path",
"/home/codespace/workspace/microsoft-graph-explorer-api/CodeSnippetsReflection.App/bin/Debug/net6.0/CodeSnippetsReflection.App",
"/home/codespace/workspace/microsoft-graph-explorer-api/CodeSnippetsReflection.App/bin/Debug/net8.0/CodeSnippetsReflection.App",
"--lang",
"Java",
"--git-path",
Expand Down
4 changes: 2 additions & 2 deletions ApiDoctor.Console/ApiDoctor.ConsoleApp.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>true</IsPackable>
<OutputType>Exe</OutputType>
<AssemblyName>apidoc</AssemblyName>
Expand Down Expand Up @@ -63,7 +63,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Graph.Kibali" Version="0.18.0" />
<PackageReference Include="Microsoft.Graph.Kibali" Version="0.19.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions ApiDoctor.Console/ApiDoctor.ConsoleApp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<projectUrl>http://github.com/onedrive/apidoctor</projectUrl>
</metadata>
<files>
<file src="bin\Release\net6.0\apidoc.exe" target="tools" />
<file src="bin\Release\net6.0\*.dll" target="tools" />
<file src="bin\Release\net6.0\*.json" target="tools" />
<file src="bin\Release\net6.0\runtimes\**" target="tools\runtimes" />
<file src="bin\Release\net8.0\apidoc.exe" target="tools" />
<file src="bin\Release\net8.0\*.dll" target="tools" />
<file src="bin\Release\net8.0\*.json" target="tools" />
<file src="bin\Release\net8.0\runtimes\**" target="tools\runtimes" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
Expand All @@ -24,7 +24,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion ApiDoctor.Publishing/ApiDoctor.Publishing.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
Expand Down
4 changes: 2 additions & 2 deletions ApiDoctor.Publishing/ApiDoctor.Publishing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<licenseUrl>http://msdn.microsoft.com/en-US/cc300389</licenseUrl>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<dependencies>
<group targetFramework="netcore60">
<group targetFramework="netcore80">
<dependency id="ApiDoctor.Validation" version="$version$" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin\Release\net6.0\ApiDoctor.Publishing.dll" target="lib\netcore60\ApiDoctor.Publishing.dll" />
<file src="bin\Release\net8.0\ApiDoctor.Publishing.dll" target="lib\netcore80\ApiDoctor.Publishing.dll" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
Expand Down Expand Up @@ -41,7 +41,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion ApiDoctor.Validation/ApiDoctor.Validation.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
Expand Down
6 changes: 3 additions & 3 deletions ApiDoctor.Validation/ApiDoctor.Validation.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<projectUrl>http://github.com/onedrive/apidoctor</projectUrl>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<dependencies>
<group targetFramework="netcore60">
<group targetFramework="netcore80">
<dependency id="Newtonsoft.Json" version="12.0.3" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin\Release\net6.0\ApiDoctor.Validation.dll" target="lib\netcore60\ApiDoctor.Validation.dll" />
<file src="bin\Release\net6.0\MarkdownDeep.dll" target="lib\netcore60\MarkdownDeep.dll" />
<file src="bin\Release\net8.0\ApiDoctor.Validation.dll" target="lib\netcore80\ApiDoctor.Validation.dll" />
<file src="bin\Release\net8.0\MarkdownDeep.dll" target="lib\netcore80\MarkdownDeep.dll" />
</files>
</package>
1 change: 1 addition & 0 deletions ApiDoctor.Validation/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ public static SimpleDataType ParseSimpleTypeString(string lowercaseString)
case "single":
simpleType = SimpleDataType.Single;
break;
case "decimal":
case "double":
simpleType = SimpleDataType.Double;
break;
Expand Down
1 change: 1 addition & 0 deletions ApiDoctor.Validation/OData/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static class ExtensionMethods
{ "Edm.DateTimeOffset", SimpleDataType.DateTimeOffset },
{ "Edm.Duration", SimpleDataType.Duration },
{ "Edm.Double", SimpleDataType.Double },
{ "Edm.Decimal", SimpleDataType.Decimal },
{ "Edm.Float", SimpleDataType.Float },
{ "Edm.Guid", SimpleDataType.Guid },
{ "Edm.TimeOfDay", SimpleDataType.TimeOfDay},
Expand Down
15 changes: 14 additions & 1 deletion ApiDoctor.Validation/ParameterDataType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,12 @@ internal bool JsonLooksDifferentFrom(ParameterDataType type)
type.Type != SimpleDataType.Int16 &&
type.Type != SimpleDataType.Int32 &&
type.Type != SimpleDataType.Int64;
case SimpleDataType.Decimal:
case SimpleDataType.Double:
case SimpleDataType.Float:
case SimpleDataType.Single:
return
type.Type != SimpleDataType.Decimal &&
type.Type != SimpleDataType.Double &&
type.Type != SimpleDataType.Float &&
type.Type != SimpleDataType.Single;
Expand Down Expand Up @@ -334,6 +336,7 @@ internal bool IsLessSpecificThan(ParameterDataType type)

float
-> double
-> decimal

object
-> complex type
Expand Down Expand Up @@ -374,7 +377,11 @@ We should never allow something from one tree to be considered less specific tha
{
return true;
}
else if (this.Type == SimpleDataType.Double && (type.Type == SimpleDataType.Float))
else if (this.Type == SimpleDataType.Decimal && (type.Type == SimpleDataType.Double || type.Type == SimpleDataType.Float))
{
return true;
}
else if (this.Type == SimpleDataType.Double && type.Type == SimpleDataType.Float)
{
return true;
}
Expand Down Expand Up @@ -418,6 +425,7 @@ static ParameterDataType()
GenericObject = new ParameterDataType(SimpleDataType.Object);
GenericCollection = new ParameterDataType(SimpleDataType.Object, true);
Boolean = new ParameterDataType(SimpleDataType.Boolean);
Decimal = new ParameterDataType(SimpleDataType.Decimal);
Double = new ParameterDataType(SimpleDataType.Double);
Float = new ParameterDataType(SimpleDataType.Float);
Guid = new ParameterDataType(SimpleDataType.Guid);
Expand All @@ -440,6 +448,10 @@ public static ParameterDataType GenericCollection
get; private set;
}
public static ParameterDataType Boolean
{
get; private set;
}
public static ParameterDataType Decimal
{
get; private set;
}
Expand Down Expand Up @@ -493,6 +505,7 @@ public enum SimpleDataType

Float,
Double,
Decimal,

Date,
DateTimeOffset,
Expand Down
1 change: 1 addition & 0 deletions ApiDoctor.Validation/ParameterDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public JToken ToExampleJToken()
return new JValue(DateTime.Now.ToString("yyyy-MM-dd"));
case SimpleDataType.DateTimeOffset:
return new JValue(DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"));
case SimpleDataType.Decimal:
case SimpleDataType.Double:
case SimpleDataType.Float:
case SimpleDataType.Single:
Expand Down
Loading