Skip to content

Commit

Permalink
TEST-0010 Add NET 9 target, update packages and switch to project folder
Browse files Browse the repository at this point in the history
  • Loading branch information
hwinther committed Nov 13, 2024
1 parent bebc43b commit b26f00b
Show file tree
Hide file tree
Showing 12 changed files with 630 additions and 620 deletions.
4 changes: 2 additions & 2 deletions shared/NugetDistSample/NugetDistSample.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>nuget_distribution_example</PackageId>
<Version>0.0.26</Version>
<Version>0.0.33</Version>
<Authors>Hans Christian Winther-Sørensen</Authors>
<Company>WSH</Company>
<PackageDescription>Distributing shared project files example</PackageDescription>
Expand Down
14 changes: 7 additions & 7 deletions shared/NugetDistSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
if (args.Length == 2)
{
var msbuildDir = args[0];
var solutionDir = args[1];
var projectDir = args[1];
Console.WriteLine($"MsbuildDir: {msbuildDir}");
Console.WriteLine($"SolutionDir: {solutionDir}");
Console.WriteLine($"ProjectDir: {projectDir}");

var solutionSignature = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(solutionDir));
var cachePath = Path.Combine(msbuildDir, "..", $"cached-run-{solutionSignature}");
var projectSignature = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(projectDir));
var cachePath = Path.Combine(msbuildDir, "..", $"cached-run-{projectSignature}");
if (Path.Exists(cachePath))
{
Console.WriteLine("Already executed for this solution.");
Console.WriteLine("Already executed for this project.");
return;
}

var gitFolderPath = FindGitFolder(solutionDir);
var gitFolderPath = FindGitFolder(projectDir);
if (gitFolderPath == null)
{
Console.WriteLine(".git folder not found.");
Expand All @@ -39,7 +39,7 @@
}
else
{
Console.WriteLine("Usage: NugetDistSample <MsbuildDir> <SolutionDir>");
Console.WriteLine("Usage: NugetDistSample <MsbuildDir> <ProjectDir>");
}

return;
Expand Down
10 changes: 3 additions & 7 deletions shared/NugetDistSample/build/nuget_distribution_example.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<Project>
<Target Name="DistSampleInit" BeforeTargets="CollectPackageReferences">
<!--Message Text="Dist sample init SolutionDir=$(SolutionDir)" Importance="High" />
<Message Text="Dist sample init MSBuildThisFileDirectory=$(MSBuildThisFileDirectory)" Importance="High" />
<ItemGroup>
<File Include="$(MSBuildThisFileDirectory)..\content\**\*.*"></File>
</ItemGroup>
<Copy SourceFiles="@(File)" DestinationFolder="$(SolutionDir)\"></Copy-->
<Exec Command="dotnet $(MSBuildThisFileDirectory)..\lib\$(TargetFramework)\NugetDistSample.dll $(MSBuildThisFileDirectory) $(SolutionDir)" />
<Warning Code="DSAMPLE001" Text="DistSample executing" />
<Exec
Command="dotnet $(MSBuildThisFileDirectory)..\lib\$(TargetFramework)\NugetDistSample.dll $(MSBuildThisFileDirectory) $(ProjectDir)" />
</Target>
</Project>
3 changes: 2 additions & 1 deletion shared/NugetDistSample/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"version": 1,
"dependencies": {
"net8.0": {}
"net8.0": {},
"net9.0": {}
}
}
Binary file modified shared/NugetDistSample/readme.md
Binary file not shown.
7 changes: 7 additions & 0 deletions src/backend/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"dotnet-stryker"
],
"rollForward": false
},
"dotnet-outdated-tool": {
"version": "4.6.4",
"commands": [
"dotnet-outdated"
],
"rollForward": false
}
}
}
2 changes: 1 addition & 1 deletion src/backend/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
27 changes: 17 additions & 10 deletions src/backend/WebApi/WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<NuGetAuditSuppress
Include="https://github.com/advisories/GHSA-5f2m-466j-3848;https://github.com/advisories/GHSA-x5qj-9vmx-7g6g;https://github.com/advisories/GHSA-xhfc-gr8f-ffwc" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
Expand All @@ -29,8 +34,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -44,7 +49,9 @@

<Target Name="CreateSwaggerJson" AfterTargets="Build" Condition="$(Configuration)=='Debug'">
<Message Text="Updating swagger schema file" Importance="High" />
<Exec EnvironmentVariables="DOTNET_ENVIRONMENT=Swagger;ASPNETCORE_ENVIRONMENT=Swagger" Command="dotnet swagger tofile --output swagger.json $(OutputPath)$(AssemblyName).dll v1" WorkingDirectory="$(ProjectDir)" />
<Exec EnvironmentVariables="DOTNET_ENVIRONMENT=Swagger;ASPNETCORE_ENVIRONMENT=Swagger"
Command="dotnet swagger tofile --output swagger.json $(OutputPath)$(AssemblyName).dll v1"
WorkingDirectory="$(ProjectDir)" />
</Target>

</Project>
Loading

0 comments on commit b26f00b

Please sign in to comment.