Skip to content

Commit

Permalink
Remove NET 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Jul 1, 2024
1 parent 2cbbeba commit f89e294
Show file tree
Hide file tree
Showing 42 changed files with 26 additions and 2,415 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.423
6.0
- uses: actions/checkout@v3
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
Expand Down Expand Up @@ -76,10 +76,10 @@ jobs:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.423
6.0
- uses: actions/checkout@v3
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
Expand All @@ -92,10 +92,10 @@ jobs:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.423
6.0
- uses: actions/checkout@v3
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.423
6.0
- uses: actions/checkout@v3
- name: 'Run: Compile, Test, Pack'
run: ./build.cmd Compile Test Pack
Expand Down Expand Up @@ -69,21 +69,21 @@ jobs:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.423
6.0
- uses: actions/checkout@v3
- name: 'Run: Compile, Test, Pack'
run: ./build.cmd Compile Test Pack
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.423
6.0
- uses: actions/checkout@v3
- name: 'Run: Compile, Test, Pack'
run: ./build.cmd Compile Test Pack
7 changes: 2 additions & 5 deletions build/Build.CI.GitHubActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyC
var newSteps = new List<GitHubActionsStep>(job.Steps);

// only need to list the ones that are missing from default image
newSteps.Insert(0, new GitHubActionsSetupDotNetStep(new[]
{
"6.0.423"
}));
newSteps.Insert(0, new GitHubActionsSetupDotNetStep(["6.0"]));

var onWindows = image.ToString().StartsWith("windows", StringComparison.OrdinalIgnoreCase);
if (onWindows)
Expand Down Expand Up @@ -98,7 +95,7 @@ public GitHubActionsSetupDotNetStep(string[] versions)

public override void Write(CustomFileWriter writer)
{
writer.WriteLine("- uses: actions/setup-dotnet@v3");
writer.WriteLine("- uses: actions/setup-dotnet@v4");

using (writer.Indent())
{
Expand Down
3 changes: 1 addition & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void PublishConsoleProject(Project project, string[] targetFrameworks)
PublishConsoleProject(consoleX86Project, ["net462"]);
PublishConsoleProject(consoleProject, ["net462"]);
}
PublishConsoleProject(consoleCoreProject, ["net6.0", "net7.0", "net8.0"]);
PublishConsoleProject(consoleCoreProject, ["net6.0", "net8.0"]);

void CopyConsoleBinaries(AbsolutePath target)
{
Expand All @@ -285,7 +285,6 @@ void CopyConsoleBinaries(AbsolutePath target)
}

CopyDirectoryRecursively(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net6.0"), target / "Net60");
CopyDirectoryRecursively(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net7.0"), target / "Net70");
CopyDirectoryRecursively(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net8.0"), target / "Net80");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<_NSwagCommand>$(NSwagExe)</_NSwagCommand>
<_NSwagCommand
Condition="'$(MSBuildRuntimeType)' == 'Core'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net60)/dotnet-nswag.dll"</_NSwagCommand>
<_NSwagCommand
Condition="'$(TargetFramework)' == 'net7.0'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net70)/dotnet-nswag.dll"</_NSwagCommand>
<_NSwagCommand
Condition="'$(TargetFramework)' == 'net8.0'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net80)/dotnet-nswag.dll"</_NSwagCommand>
</PropertyGroup>
Expand Down
7 changes: 1 addition & 6 deletions src/NSwag.AspNetCore/NSwag.AspNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<PackageTags>Swagger Documentation AspNetCore NetCore TypeScript CodeGen</PackageTags>
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
<SymbolPackageFormat>symbols.nupkg</SymbolPackageFormat>
Expand Down Expand Up @@ -47,11 +47,6 @@
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet6)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet7)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet8)" />
Expand Down
11 changes: 0 additions & 11 deletions src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@
<dependency id="Microsoft.Extensions.ApiDescription.Server" version="$microsoftExtensionsApiDescriptionServerPackageVersion$" />
<dependency id="Microsoft.Extensions.FileProviders.Embedded" version="$MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet6$" exclude="Build,Analyzers" />
</group>
<group targetFramework="net7.0">
<dependency id="NSwag.Annotations" version="$version$" exclude="Build,Analyzers" />
<dependency id="NSwag.Core" version="$version$" exclude="Build,Analyzers" />
<dependency id="NSwag.Core.Yaml" version="$version$" exclude="Build,Analyzers" />
<dependency id="NSwag.Generation.AspNetCore" version="$version$" exclude="Build,Analyzers" />
<dependency id="NSwag.Generation" version="$version$" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.ApiDescription.Server" version="$microsoftExtensionsApiDescriptionServerPackageVersion$" />
<dependency id="Microsoft.Extensions.FileProviders.Embedded" version="$MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet7$" exclude="Build,Analyzers" />
</group>
<group targetFramework="net8.0">
<dependency id="NSwag.Annotations" version="$version$" exclude="Build,Analyzers" />
<dependency id="NSwag.Core" version="$version$" exclude="Build,Analyzers" />
Expand All @@ -76,8 +67,6 @@
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_netstandard2.0\NSwag.AspNetCore.xml" target="lib\netstandard2.0\" />
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_net6.0\NSwag.AspNetCore.dll" target="lib\net6.0\" />
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_net6.0\NSwag.AspNetCore.xml" target="lib\net6.0\" />
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_net7.0\NSwag.AspNetCore.dll" target="lib\net7.0\" />
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_net7.0\NSwag.AspNetCore.xml" target="lib\net7.0\" />
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_net8.0\NSwag.AspNetCore.dll" target="lib\net8.0\" />
<file src="..\..\artifacts\bin\NSwag.AspNetCore\$configuration$_net8.0\NSwag.AspNetCore.xml" target="lib\net8.0\" />
</files>
Expand Down
8 changes: 1 addition & 7 deletions src/NSwag.Commands/NSwag.Commands.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- obsolete usage, missing comments -->
<NoWarn>$(NoWarn),618,1591</NoWarn>
Expand All @@ -17,12 +17,6 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
Expand Down
4 changes: 0 additions & 4 deletions src/NSwag.Commands/NSwagDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ private string GetArgumentsPrefix()
{
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net60/dotnet-nswag.dll") + "\" ";
}
else if (runtime == Runtime.Net70)
{
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net70/dotnet-nswag.dll") + "\" ";
}
else if (runtime == Runtime.Net80)
{
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net80/dotnet-nswag.dll") + "\" ";
Expand Down
3 changes: 0 additions & 3 deletions src/NSwag.Commands/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ public enum Runtime
/// <summary>.NET 6 app.</summary>
Net60,

/// <summary>.NET 7 app.</summary>
Net70,

/// <summary>.NET 8 app.</summary>
Net80,

Expand Down
5 changes: 0 additions & 5 deletions src/NSwag.Commands/RuntimeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ public static Runtime CurrentRuntime
{
return Runtime.Net80;
}

if (framework.Version.Major >= 7)
{
return Runtime.Net70;
}

if (framework.Version.Major >= 6)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public class GenerateSampleSpecificationTests
[Theory]
[InlineData("NSwag.Sample.NET60", "net6.0", false)]
[InlineData("NSwag.Sample.NET60Minimal", "net6.0", false)]
[InlineData("NSwag.Sample.NET70", "net7.0", false)]
[InlineData("NSwag.Sample.NET70Minimal", "net7.0", true)]
[InlineData("NSwag.Sample.NET80", "net8.0", false)]
[InlineData("NSwag.Sample.NET80Minimal", "net8.0", true)]
public async Task Should_generate_openapi_for_project(string projectName, string targetFramework, bool generatesCode)
Expand Down
3 changes: 2 additions & 1 deletion src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

<ItemGroup>
<ProjectReference Include="..\NSwag.ConsoleCore\NSwag.ConsoleCore.csproj" />
<ProjectReference Include="..\NSwag.Sample.NET70\NSwag.Sample.NET70.csproj" />
<ProjectReference Include="..\NSwag.Sample.NET60\NSwag.Sample.NET60.csproj" />
<ProjectReference Include="..\NSwag.Sample.NET80\NSwag.Sample.NET80.csproj" />
</ItemGroup>

</Project>
7 changes: 1 addition & 6 deletions src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<AssemblyName>dotnet-nswag</AssemblyName>
<PackageId>NSwag.ConsoleCore</PackageId>
Expand All @@ -18,11 +18,6 @@
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn),618,1591</NoWarn>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<NoWarn>$(NoWarn),618,1591</NoWarn>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
</PropertyGroup>
Expand All @@ -16,14 +16,9 @@
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.17" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.17" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.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>
<TargetFrameworks>net462;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<PackageTags>Swagger Documentation AspNetCore</PackageTags>
<DefineConstants>$(DefineConstants);ASPNETCORE</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -18,12 +18,6 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.MSBuild/NSwag.MSBuild.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<file src="..\..\artifacts\publish\NSwag.Console.x86\$configuration$\NSwag.x86.exe.config" target="tools/Win" />

<file src="..\..\artifacts\publish\NSwag.ConsoleCore\$configuration$_net6.0\**" target="tools/Net60" />
<file src="..\..\artifacts\publish\NSwag.ConsoleCore\$configuration$_net7.0\**" target="tools/Net70" />
<file src="..\..\artifacts\publish\NSwag.ConsoleCore\$configuration$_net8.0\**" target="tools/Net80" />
</files>
</package>
2 changes: 0 additions & 2 deletions src/NSwag.MSBuild/NSwag.MSBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
<NSwagExe>"$(MSBuildThisFileDirectory)../tools/Win/NSwag.exe"</NSwagExe>
<NSwagExe_x86>"$(MSBuildThisFileDirectory)../tools/Win/NSwag.x86.exe"</NSwagExe_x86>
<NSwagExe_Net60>dotnet "$(MSBuildThisFileDirectory)../tools/Net60/dotnet-nswag.dll"</NSwagExe_Net60>
<NSwagExe_Net70>dotnet "$(MSBuildThisFileDirectory)../tools/Net70/dotnet-nswag.dll"</NSwagExe_Net70>
<NSwagExe_Net80>dotnet "$(MSBuildThisFileDirectory)../tools/Net80/dotnet-nswag.dll"</NSwagExe_Net80>

<NSwagDir>$(MSBuildThisFileDirectory)../tools/Win/</NSwagDir>
<NSwagDir_Net60>$(MSBuildThisFileDirectory)../tools/Net60/</NSwagDir_Net60>
<NSwagDir_Net70>$(MSBuildThisFileDirectory)../tools/Net70/</NSwagDir_Net70>
<NSwagDir_Net80>$(MSBuildThisFileDirectory)../tools/Net80/</NSwagDir_Net80>
</PropertyGroup>
</Project>
2 changes: 0 additions & 2 deletions src/NSwag.NoInstaller.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"NSwag.Generation\\NSwag.Generation.csproj",
"NSwag.Sample.NET60Minimal\\NSwag.Sample.NET60Minimal.csproj",
"NSwag.Sample.NET60\\NSwag.Sample.NET60.csproj",
"NSwag.Sample.NET70Minimal\\NSwag.Sample.NET70Minimal.csproj",
"NSwag.Sample.NET70\\NSwag.Sample.NET70.csproj",
"NSwag.Sample.NET80Minimal\\NSwag.Sample.NET80Minimal.csproj",
"NSwag.Sample.NET80\\NSwag.Sample.NET80.csproj"
]
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ To specify what .NET Core binaries to execute, either use (default)

or

nswag version /runtime:Net70
nswag version /runtime:Net80

## Development

Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Npm/bin/nswag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
var defaultCoreVersion = "Net80";
var supportedCoreVersions = [
{ ver: '6.0', dir: "Net60", },
{ ver: '7.0', dir: "Net70", },
{ ver: '8.0', dir: "Net80", },
];

Expand All @@ -17,7 +16,6 @@ var args = process.argv.splice(2, process.argv.length - 2).map(function (a) { re
args = args.replace("--x86", "/runtime:WinX86");
args = args.replace("/runtime:x86", "/runtime:WinX86");
args = args.replace("--core 6.0", "/runtime:Net60");
args = args.replace("--core 7.0", "/runtime:Net70");
args = args.replace("--core 8.0", "/runtime:Net80");
args = args.replace("--core", "/runtime:" + defaultCoreVersion);

Expand Down
Loading

0 comments on commit f89e294

Please sign in to comment.